Skip to content

Commit 16989c6

Browse files
Fix hair shader compilation issue with Debug Display mode (#2023)
* Fix compilation issue with debug mode and hair * Update CHANGELOG.md
1 parent f3069a5 commit 16989c6

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
9797
- Fixed alignment of framesettings in HDRP Default Settings
9898
- Fixed an exception thrown when closing the look dev because there is no active SRP anymore.
9999
- Fixed an issue where entering playmode would close the LookDev window.
100+
- Fixed shader compilation issue with Hair shader and debug display mode
100101

101102
### Changed
102103
- Preparation pass for RTSSShadows to be supported by render graph.

com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/Deferred.compute

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,14 @@ void SHADE_OPAQUE_ENTRY(uint3 dispatchThreadId : SV_DispatchThreadID, uint2 grou
176176
diffuseLighting *= GetCurrentExposureMultiplier();
177177
specularLighting *= GetCurrentExposureMultiplier();
178178

179+
#ifdef OUTPUT_SPLIT_LIGHTING
179180
if (_EnableSubsurfaceScattering != 0 && ShouldOutputSplitLighting(bsdfData))
180181
{
181182
specularLightingUAV[COORD_TEXTURE2D_X(pixelCoord)] = float4(specularLighting, 1.0);
182183
diffuseLightingUAV[COORD_TEXTURE2D_X(pixelCoord)] = TagLightingForSSS(diffuseLighting);
183184
}
184185
else
186+
#endif
185187
{
186188
specularLightingUAV[COORD_TEXTURE2D_X(pixelCoord)] = float4(diffuseLighting + specularLighting, 1.0);
187189
}

com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,12 @@ void ApplyDebug(LightLoopContext context, PositionInputs posInput, BSDFData bsdf
163163

164164
lightLoopOutput.diffuseLighting = SAMPLE_TEXTURE2D_LOD(_DebugMatCapTexture, s_linear_repeat_sampler, UV, 0).rgb * (_MatcapMixAlbedo > 0 ? defaultColor.rgb * _MatcapViewScale : 1.0f);
165165

166-
if (ShouldOutputSplitLighting(bsdfData) && _EnableSubsurfaceScattering != 0)
166+
#ifdef OUTPUT_SPLIT_LIGHTING
167+
if (_EnableSubsurfaceScattering != 0 && ShouldOutputSplitLighting(bsdfData))
167168
{
168169
lightLoopOutput.specularLighting = lightLoopOutput.diffuseLighting;
169170
}
171+
#endif
170172

171173
}
172174
#endif

0 commit comments

Comments
 (0)