From ce4efd6f80a3b8f059ec939922e0bafaea73d39d Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Fri, 25 Sep 2020 16:10:00 +0200 Subject: [PATCH 1/4] Fix compilation issue with debug mode and hair --- .../Runtime/Lighting/LightLoop/Deferred.compute | 2 ++ .../Runtime/Lighting/LightLoop/LightLoop.hlsl | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/Deferred.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/Deferred.compute index ff8f1b39077..0982f1fda8c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/Deferred.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/Deferred.compute @@ -176,12 +176,14 @@ void SHADE_OPAQUE_ENTRY(uint3 dispatchThreadId : SV_DispatchThreadID, uint2 grou diffuseLighting *= GetCurrentExposureMultiplier(); specularLighting *= GetCurrentExposureMultiplier(); +#ifdef OUTPUT_SPLIT_LIGHTING if (_EnableSubsurfaceScattering != 0 && ShouldOutputSplitLighting(bsdfData)) { specularLightingUAV[COORD_TEXTURE2D_X(pixelCoord)] = float4(specularLighting, 1.0); diffuseLightingUAV[COORD_TEXTURE2D_X(pixelCoord)] = TagLightingForSSS(diffuseLighting); } else +#endif { specularLightingUAV[COORD_TEXTURE2D_X(pixelCoord)] = float4(diffuseLighting + specularLighting, 1.0); } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl index ba0e10b069a..623c8e17918 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl @@ -163,10 +163,12 @@ void ApplyDebug(LightLoopContext context, PositionInputs posInput, BSDFData bsdf lightLoopOutput.diffuseLighting = SAMPLE_TEXTURE2D_LOD(_DebugMatCapTexture, s_linear_repeat_sampler, UV, 0).rgb * (_MatcapMixAlbedo > 0 ? defaultColor.rgb * _MatcapViewScale : 1.0f); - if (ShouldOutputSplitLighting(bsdfData) && _EnableSubsurfaceScattering != 0) + #ifdef OUTPUT_SPLIT_LIGHTING + if (_EnableSubsurfaceScattering != 0 && ShouldOutputSplitLighting(bsdfData)) { lightLoopOutput.specularLighting = lightLoopOutput.diffuseLighting; } + #endif } #endif From 77882593ecbf3ab71bebd0ba125a2e35530d257a Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Fri, 25 Sep 2020 16:10:40 +0200 Subject: [PATCH 2/4] 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 546e93760c9..dc1189012c7 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -96,6 +96,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed alignment of framesettings in HDRP Default Settings - Fixed an exception thrown when closing the look dev because there is no active SRP anymore. - Fixed an issue where entering playmode would close the LookDev window. +- Fixed shader compilation issue with Hair shader and debug display mode ### Changed - Preparation pass for RTSSShadows to be supported by render graph. From ce7708897363b0eef39208cebe364514494b8c58 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Mon, 28 Sep 2020 10:19:08 +0200 Subject: [PATCH 3/4] Update Deferred.compute --- .../Runtime/Lighting/LightLoop/Deferred.compute | 2 -- 1 file changed, 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/Deferred.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/Deferred.compute index 0982f1fda8c..ff8f1b39077 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/Deferred.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/Deferred.compute @@ -176,14 +176,12 @@ void SHADE_OPAQUE_ENTRY(uint3 dispatchThreadId : SV_DispatchThreadID, uint2 grou diffuseLighting *= GetCurrentExposureMultiplier(); specularLighting *= GetCurrentExposureMultiplier(); -#ifdef OUTPUT_SPLIT_LIGHTING if (_EnableSubsurfaceScattering != 0 && ShouldOutputSplitLighting(bsdfData)) { specularLightingUAV[COORD_TEXTURE2D_X(pixelCoord)] = float4(specularLighting, 1.0); diffuseLightingUAV[COORD_TEXTURE2D_X(pixelCoord)] = TagLightingForSSS(diffuseLighting); } else -#endif { specularLightingUAV[COORD_TEXTURE2D_X(pixelCoord)] = float4(diffuseLighting + specularLighting, 1.0); } From fdb68d0de20f4893bbfcf2191c81d690ebb0a30a Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Mon, 28 Sep 2020 10:24:49 +0200 Subject: [PATCH 4/4] Update LightLoop.hlsl --- .../Runtime/Lighting/LightLoop/LightLoop.hlsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl index 623c8e17918..2e7d34643ff 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl @@ -163,7 +163,7 @@ void ApplyDebug(LightLoopContext context, PositionInputs posInput, BSDFData bsdf lightLoopOutput.diffuseLighting = SAMPLE_TEXTURE2D_LOD(_DebugMatCapTexture, s_linear_repeat_sampler, UV, 0).rgb * (_MatcapMixAlbedo > 0 ? defaultColor.rgb * _MatcapViewScale : 1.0f); - #ifdef OUTPUT_SPLIT_LIGHTING + #ifdef OUTPUT_SPLIT_LIGHTING // Work as matcap view is only call in forward, OUTPUT_SPLIT_LIGHTING isn't define in deferred.compute if (_EnableSubsurfaceScattering != 0 && ShouldOutputSplitLighting(bsdfData)) { lightLoopOutput.specularLighting = lightLoopOutput.diffuseLighting;