Skip to content

[9.x.x] Fix Microshadow not working properly with LightLayers enabled in deferred #522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -609,6 +609,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed the show cookie atlas debug mode not displaying correctly when enabling the clear cookie atlas option.
- Fixed various multi-editing issues when changing Emission parameters.
- Fixed error when undo a Reflection Probe removal in a prefab instance. (case 1244047)
- Fixed Microshadow not working correctly in deferred with LightLayers

### Changed
- Improve MIP selection for decals on Transparents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,8 @@ float GetAmbientOcclusionForMicroShadowing(BSDFData bsdfData)
{
float sourceAO;
#if (SHADERPASS == SHADERPASS_DEFERRED_LIGHTING)
// Note: In deferred pass we don't have space in GBuffer to store ambientOcclusion unless LIGHT_LAYERS is enabled
// so we use specularOcclusion instead
// The define LIGHT_LAYERS only exist for the GBuffer and the Forward pass. To avoid to add another
// variant to deferred.compute, we use dynamic branching instead with _EnableLightLayers.
sourceAO = _EnableLightLayers ? bsdfData.ambientOcclusion : bsdfData.specularOcclusion;
// Note: In deferred pass we don't have space in GBuffer to store ambientOcclusion so we use specularOcclusion instead
sourceAO = bsdfData.specularOcclusion;
#else
sourceAO = bsdfData.ambientOcclusion;
#endif
Expand Down