From db3258264a2d2c838640cb5347ea03ec54cd9696 Mon Sep 17 00:00:00 2001 From: Robert Swain Date: Thu, 25 Nov 2021 08:30:57 +0100 Subject: [PATCH] bevy_pbr2: Fix shadow logic --- pipelined/bevy_pbr2/src/render/pbr.wgsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipelined/bevy_pbr2/src/render/pbr.wgsl b/pipelined/bevy_pbr2/src/render/pbr.wgsl index bb5515657a1f4..45e6fc2a923de 100644 --- a/pipelined/bevy_pbr2/src/render/pbr.wgsl +++ b/pipelined/bevy_pbr2/src/render/pbr.wgsl @@ -501,7 +501,7 @@ fn fragment(in: FragmentInput) -> [[location(0)]] vec4 { let light = lights.point_lights[i]; var shadow: f32; if ((mesh.flags & MESH_FLAGS_SHADOW_RECEIVER_BIT) != 0u - || (light.flags & POINT_LIGHT_FLAGS_SHADOWS_ENABLED_BIT) != 0u) { + && (light.flags & POINT_LIGHT_FLAGS_SHADOWS_ENABLED_BIT) != 0u) { shadow = fetch_point_shadow(i, in.world_position, in.world_normal); } else { shadow = 1.0; @@ -513,7 +513,7 @@ fn fragment(in: FragmentInput) -> [[location(0)]] vec4 { let light = lights.directional_lights[i]; var shadow: f32; if ((mesh.flags & MESH_FLAGS_SHADOW_RECEIVER_BIT) != 0u - || (light.flags & DIRECTIONAL_LIGHT_FLAGS_SHADOWS_ENABLED_BIT) != 0u) { + && (light.flags & DIRECTIONAL_LIGHT_FLAGS_SHADOWS_ENABLED_BIT) != 0u) { shadow = fetch_directional_shadow(i, in.world_position, in.world_normal); } else { shadow = 1.0;