From 570231e41532c0d64787a799f929878c4a5faca6 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 30 Jun 2020 17:04:49 +0200 Subject: [PATCH 1/2] Mask layers to consider only the supported 8 bits --- .../Runtime/Material/Lit/Lit.hlsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From 7c62d1109a2b7570184a86443c843b71eec88bf3 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Thu, 2 Jul 2020 09:45:07 +0200 Subject: [PATCH 2/2] changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 7bb9d4c08b1..4b6dbfe32b1 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue where editing the Look Dev default profile would not reflect directly in the Look Dev window. - 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 issue with light layers bigger than 8 (and above the supported range). ### Changed - Shadowmask and realtime reflection probe property are hide in Quality settings