diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 5a639b5f79c..e8f04574608 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -30,8 +30,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 - Shadowmask and realtime reflection probe property are hide in Quality settings diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl index 64ad119c8fd..1e856c8d89f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl @@ -643,7 +643,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