Skip to content

Commit

Permalink
UPBGE: Fix variance shadow for spot.
Browse files Browse the repository at this point in the history
The shadow distance wasn't divided by the w component of the
vector from light to fragment position.
  • Loading branch information
youle31 committed Jun 14, 2017
1 parent 59897a0 commit 164dda3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/blender/gpu/shaders/gpu_shader_material.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -2461,7 +2461,7 @@ float test_shadow_pcf(sampler2DShadow shadowmap, vec4 co, float samples, float s
float test_shadow_vsm(sampler2D shadowmap, vec4 co, float bias, float bleedbias)
{
vec2 moments = texture2DProj(shadowmap, co).rg;
float dist = co.z;
float dist = co.z / co.w;
float p = 0.0;

if (dist <= moments.x)
Expand Down

0 comments on commit 164dda3

Please sign in to comment.