Skip to content

Commit 60ff03d

Browse files
[9.x.x] Fix Microshadow not working properly with LightLayers enabled in deferred #522
1 parent b5c6f7f commit 60ff03d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
8888
- Fixed error when undo a Reflection Probe removal in a prefab instance. (case 1244047)
8989
- Fixed various multi-editing issues when changing Emission parameters.
9090
- Fixed issue that prevented cubemap thumbnails from rendering (only on D3D11 and Metal).
91+
- Fixed Microshadow not working correctly in deferred with LightLayers
9192

9293
### Changed
9394
- Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history.

com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,8 @@ float GetAmbientOcclusionForMicroShadowing(BSDFData bsdfData)
195195
{
196196
float sourceAO;
197197
#if (SHADERPASS == SHADERPASS_DEFERRED_LIGHTING)
198-
// Note: In deferred pass we don't have space in GBuffer to store ambientOcclusion unless LIGHT_LAYERS is enabled
199-
// so we use specularOcclusion instead
200-
// The define LIGHT_LAYERS only exist for the GBuffer and the Forward pass. To avoid to add another
201-
// variant to deferred.compute, we use dynamic branching instead with _EnableLightLayers.
202-
sourceAO = _EnableLightLayers ? bsdfData.ambientOcclusion : bsdfData.specularOcclusion;
198+
// Note: In deferred pass we don't have space in GBuffer to store ambientOcclusion so we use specularOcclusion instead
199+
sourceAO = bsdfData.specularOcclusion;
203200
#else
204201
sourceAO = bsdfData.ambientOcclusion;
205202
#endif

0 commit comments

Comments
 (0)