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

SL-10732

Fix accum of shadow weights and handling of clipped areas in spot shadow sampling.
parent b5bcba51
No related branches found
No related tags found
No related merge requests found
...@@ -161,7 +161,7 @@ float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen) ...@@ -161,7 +161,7 @@ float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen)
float sampleSpotShadow(vec3 pos, vec3 norm, int index, vec2 pos_screen) float sampleSpotShadow(vec3 pos, vec3 norm, int index, vec2 pos_screen)
{ {
float shadow = 1.0f; float shadow = 0.0f;
pos += norm * spot_shadow_offset; pos += norm * spot_shadow_offset;
vec4 spos = vec4(pos,1.0); vec4 spos = vec4(pos,1.0);
...@@ -194,6 +194,10 @@ float sampleSpotShadow(vec3 pos, vec3 norm, int index, vec2 pos_screen) ...@@ -194,6 +194,10 @@ float sampleSpotShadow(vec3 pos, vec3 norm, int index, vec2 pos_screen)
shadow /= weight; shadow /= weight;
} }
else
{
shadow = 1.0f;
}
return shadow; return shadow;
} }
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