From 82846a7e6d25652ca605107f7b025fbf29f95a14 Mon Sep 17 00:00:00 2001 From: Bastiaan Olij Date: Wed, 23 Aug 2023 11:14:10 +1000 Subject: [PATCH] Fix missing decal mask in mobile renderer (cherry picked from commit 8449331f134a8a5b771426f2a53d9a81180a0200) --- .../shaders/forward_mobile/scene_forward_mobile.glsl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl index b43138606f9..c976ed951d9 100644 --- a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl @@ -895,6 +895,10 @@ void main() { break; } + if (!bool(decals.data[decal_index].mask & draw_call.layer_mask)) { + continue; //not masked + } + vec3 uv_local = (decals.data[decal_index].xform * vec4(vertex, 1.0)).xyz; if (any(lessThan(uv_local, vec3(0.0, -1.0, 0.0))) || any(greaterThan(uv_local, vec3(1.0)))) { continue; //out of decal