Skip to content

[Backport 7.x.x] Fix issue with light layers > 7 in the deferred path #1093

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
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 @@ -94,6 +94,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed an issue where manipulating the color wheels in a volume component would reset the cursor every time.
- Fixed an issue where static sky lighting would not be updated for a new scene until it's reloaded at least once.
- Fixed missing include guards in shadow hlsl files.
- Fixed issue with light layers bigger than 8 (and above the supported range).

### Changed
- Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,8 @@ void EncodeIntoGBuffer( SurfaceData surfaceData
outGBuffer3 *= GetCurrentExposureMultiplier();

#ifdef LIGHT_LAYERS
OUT_GBUFFER_LIGHT_LAYERS = float4(0.0, 0.0, 0.0, builtinData.renderingLayers / 255.0);
// Note: we need to mask out only 8bits of the layer mask before encoding it as otherwise any value > 255 will map to all layers active
OUT_GBUFFER_LIGHT_LAYERS = float4(0.0, 0.0, 0.0, (builtinData.renderingLayers & 0x000000FF) / 255.0);
#endif

#ifdef SHADOWS_SHADOWMASK
Expand Down