From bd5c2d5b5548ea32cb5b5c5ee21ae9da28453866 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Mon, 19 Apr 2021 10:39:22 +0200 Subject: [PATCH 1/2] Proper fix --- .../ShaderLibrary/AreaLighting.hlsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; From 40077bf476da7250b61a32f6f708b28922ea432a Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Mon, 19 Apr 2021 10:41:04 +0200 Subject: [PATCH 2/2] changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 976c1e96b4c..66282719aa7 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -146,6 +146,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed issue with the color space of AOVs (case 1324759) - Fixed issue with history buffers when using multiple AOVs (case 1323684). - Fixed camera preview with multi selection (case 1324126). +- Fixed a NaN generating in Area light code. ### Changed - Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard