diff --git a/com.unity.render-pipelines.core/ShaderLibrary/AreaLighting.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/AreaLighting.hlsl index 368095cdaa1..95a53c3e993 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/AreaLighting.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/AreaLighting.hlsl @@ -21,7 +21,8 @@ real3 ComputeEdgeFactor(real3 V1, real3 V2) if (V1oV2 < 0) { // Undo range reduction. - y = PI * rsqrt(saturate(1 - V1oV2 * V1oV2)) - y; + const float epsilon = 1e-5f; + y = PI * rsqrt(max(epsilon, saturate(1 - V1oV2 * V1oV2))) - y; } return V1xV2 * y; diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 3c67cfcb0e8..2c2c9918daa 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -153,6 +153,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed global Settings ignore the path set via Fix All in HDRP wizard (case 1327978) - Fixed GBuffer clear option in FrameSettings not working - Fixed usage of Panini Projection with floating point HDRP and Post Processing color buffers. +- Fixed a NaN generating in Area light code. ### Changed - Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard