From 46dcb8355e08688fe91866773660b050431148c4 Mon Sep 17 00:00:00 2001 From: Adrien de Tocqueville Date: Thu, 22 Oct 2020 13:12:38 +0200 Subject: [PATCH 1/2] Use SafeNormalize --- .../Runtime/Material/Lit/LitDecalData.hlsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl index 2ec0165034d..af6e087cf2a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl @@ -8,7 +8,7 @@ void ApplyDecalToSurfaceData(DecalSurfaceData decalSurfaceData, float3 vtxNormal // Always test the normal as we can have decompression artifact if (decalSurfaceData.normalWS.w < 1.0) { - surfaceData.normalWS.xyz = normalize(surfaceData.normalWS.xyz * decalSurfaceData.normalWS.w + decalSurfaceData.normalWS.xyz); + surfaceData.normalWS.xyz = SafeNormalize(surfaceData.normalWS.xyz * decalSurfaceData.normalWS.w + decalSurfaceData.normalWS.xyz); } #ifdef DECALS_4RT // only smoothness in 3RT mode From 86120677d54add32b23c22ca27f5efdf9e74187b Mon Sep 17 00:00:00 2001 From: Adrien de Tocqueville Date: Fri, 23 Oct 2020 11:31:48 +0200 Subject: [PATCH 2/2] Update CHANGELOG.md --- 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 bc506a9780d..cef61679751 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -24,6 +24,7 @@ The version number for this package has increased due to a version update of a r - Fixed upside down XR occlusion mesh. - Fixed precision issue with the atmospheric fog. - Claryfied doc for the LayeredLit material. +- Fixed nan when a decal affects normals. ### Changed - Combined occlusion meshes into one to reduce draw calls and state changes with XR single-pass.