Skip to content

Commit

Permalink
Merge branch 'yaobin/finReSTIRNaN' into 'main'
Browse files Browse the repository at this point in the history
[REMIX-3331] Fix NaN in ReSTIR GI Pass

See merge request lightspeedrtx/dxvk-remix-nv!902
  • Loading branch information
Yaobin Ouyang committed Jul 18, 2024
2 parents 604c037 + 1e2b08f commit 74cca47
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dxvk/shaders/rtx/pass/integrate/integrate_nee.comp.slang
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ void main(uint2 threadIndex : SV_DispatchThreadID, uint2 LocalIndex : SV_GroupTh
neeSample.setPortalID(RESTIR_GI_INVALID_INDIRECT_LIGHT_PORTAL_ID);
neeSample.position = lightSample.position;
neeSample.normal = lightSample.normal;
neeSample.radiance = lightSample.radiance / lightSample.solidAnglePdf;
// TODO: The radiance value is stored in 16bit floats and clamping is needed to avoid NaN issue.
// Need to move clamping to the ReSTIRGI_Reservoir::pack() function.
neeSample.radiance = min(lightSample.radiance / lightSample.solidAnglePdf, float16Max);
neeSample.setVirtualFraction(0.0);

float wi = RAB_GetGITargetPdfForSurface(neeSample.radiance, neeSample.position, surface);
Expand Down

0 comments on commit 74cca47

Please sign in to comment.