From 3950f9df62c8eb49adb025813e666fba960a9f49 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 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 From 7539faeae1eb2a26d178a2dabaff0cd8be32bcfb Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 30 Jun 2020 17:07:21 +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 6ccbb2aeafb..64cf3b82744 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -699,6 +699,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Force to rebake probe with missing baked texture. (1253367) - Fix supported Mac platform detection to handle new major version (11.0) properly - Fixed typo in the Render Pipeline Wizard under HDRP+VR +- Fixed issue with light layers bigger than 8 (and above the supported range). ### Changed - Improve MIP selection for decals on Transparents