Skip to content

Commit 355a935

Browse files
kechosebastienlagarde
authored andcommitted
[Fogbugz # 1386436] Fixing FPTL failing when near and far are very tight. #6826
1 parent 3b8ec5e commit 355a935

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2222
- Fixed Post Process not editable in the default frame settings.
2323
- Fixed errors spamming when in player mode due to ray tracing light cluster debug view (case 1390471).
2424
- Fixed missing unit in ray tracing related tooltips and docs (case 1397491).
25+
- Fixed artifacts on gpu light culling when the frustum near and far are very spread out (case 1386436)
2526

2627
## [12.1.4] - 2021-12-07
2728

com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild.compute

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ void FinePruneLights(uint threadID, int iNrCoarseLights, uint2 viTilLL, float vL
454454
{
455455
LightVolumeData lightData = _LightVolumeData[idxCoarse];
456456
const bool bIsSpotDisc = true; // (lightData.flags&IS_CIRCULAR_SPOT_SHAPE) != 0;
457-
for(int i=0; i<PIXEL_PER_THREAD && !lightValid; i++)
457+
for(int i=0; i<PIXEL_PER_THREAD; i++)
458458
{
459459
int idx = t + i*NR_THREADS;
460460

@@ -477,12 +477,14 @@ void FinePruneLights(uint threadID, int iNrCoarseLights, uint2 viTilLL, float vL
477477
#else
478478
lightValid = isValid;
479479
#endif
480+
if (isValid)
481+
break;
480482
}
481483
}
482484
else if (uLightVolume == LIGHTVOLUMETYPE_SPHERE)
483485
{
484486
LightVolumeData lightData = _LightVolumeData[idxCoarse];
485-
for(int i=0; i<PIXEL_PER_THREAD && !lightValid; i++)
487+
for(int i=0; i<PIXEL_PER_THREAD; i++)
486488
{
487489
int idx = t + i*NR_THREADS;
488490

@@ -500,12 +502,14 @@ void FinePruneLights(uint threadID, int iNrCoarseLights, uint2 viTilLL, float vL
500502
#else
501503
lightValid = isValid;
502504
#endif
505+
if (isValid)
506+
break;
503507
}
504508
}
505509
else if (uLightVolume == LIGHTVOLUMETYPE_BOX)
506510
{
507511
LightVolumeData lightData = _LightVolumeData[idxCoarse];
508-
for(int i=0; i<PIXEL_PER_THREAD && !lightValid; i++)
512+
for(int i=0; i<PIXEL_PER_THREAD; i++)
509513
{
510514
int idx = t + i*NR_THREADS;
511515

@@ -523,6 +527,8 @@ void FinePruneLights(uint threadID, int iNrCoarseLights, uint2 viTilLL, float vL
523527
#else
524528
lightValid = isValid;
525529
#endif
530+
if (isValid)
531+
break;
526532
}
527533
}
528534
else

0 commit comments

Comments
 (0)