Skip to content
Snippets Groups Projects
Commit 9de895aa authored by Graham Linden's avatar Graham Linden
Browse files

SL-10369

Fix handling of backfaces in shared shadow sampling broken during de-duplication.
parent fb75cf03
No related branches found
No related tags found
No related merge requests found
......@@ -120,6 +120,13 @@ float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen)
float shadow = 0.0f;
vec4 spos = vec4(shadow_pos,1.0);
// if we know this point is facing away from the sun then we know it's in shadow without having to do a squirrelly shadow-map lookup
if (dp_directional_light <= 0.0)
{
return 0.0;
}
if (spos.z > -shadow_clip.w)
{
vec4 lpos;
......@@ -174,7 +181,8 @@ float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen)
shadow /= weight;
}
return shadow;
return min(dp_directional_light, shadow);
}
float sampleSpotShadow(vec3 pos, vec3 norm, int index, vec2 pos_screen)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment