diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 7189925eb13..78f5a494291 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -709,6 +709,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed fallback for ray tracing and light layers (1258837). - Fixed Sorting Priority not displayed correctly in the DrawRenderers custom pass UI. - Fixed glitch in Project settings window when selecting diffusion profiles in material section (case 1253090) +- Fixed issue with light layers bigger than 8 (and above the supported range). ### Changed - Improve MIP selection for decals on Transparents 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 4bd1b0e3dbe..8e04e93387f 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 @@ -668,7 +668,8 @@ void EncodeIntoGBuffer( SurfaceData surfaceData } #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