Skip to content

Commit 171f03b

Browse files
Proper area light NaN fix (#4220)
* Proper fix * changelog Co-authored-by: sebastienlagarde <[email protected]>
1 parent bbbcb4c commit 171f03b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

com.unity.render-pipelines.core/ShaderLibrary/AreaLighting.hlsl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ real3 ComputeEdgeFactor(real3 V1, real3 V2)
2121
if (V1oV2 < 0)
2222
{
2323
// Undo range reduction.
24-
y = PI * rsqrt(saturate(1 - V1oV2 * V1oV2)) - y;
24+
const float epsilon = 1e-5f;
25+
y = PI * rsqrt(max(epsilon, saturate(1 - V1oV2 * V1oV2))) - y;
2526
}
2627

2728
return V1xV2 * y;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
153153
- Fixed global Settings ignore the path set via Fix All in HDRP wizard (case 1327978)
154154
- Fixed GBuffer clear option in FrameSettings not working
155155
- Fixed usage of Panini Projection with floating point HDRP and Post Processing color buffers.
156+
- Fixed a NaN generating in Area light code.
156157

157158
### Changed
158159
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard

0 commit comments

Comments
 (0)