Skip to content

Commit

Permalink
Fix hair shader compilation issue with Debug Display mode (#2023)
Browse files Browse the repository at this point in the history
* Fix compilation issue with debug mode and hair

* Update CHANGELOG.md
  • Loading branch information
sebastienlagarde committed Sep 25, 2020
1 parent f3069a5 commit 16989c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 16989c6

Please sign in to comment.