X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=shaderlib%2Fshadow.glsl;h=2e8a05b0889ab77464cc45e4324cc1e231c222d0;hb=5e611353c5fcaf9219bd3037a32bce0f91313264;hp=d6e2b385f8955009abf737d998fbe7dd984f8996;hpb=edc150206f9762facf37b419705ddb8cf21f4e4c;p=libs%2Fgl.git diff --git a/shaderlib/shadow.glsl b/shaderlib/shadow.glsl index d6e2b385..2e8a05b0 100644 --- a/shaderlib/shadow.glsl +++ b/shaderlib/shadow.glsl @@ -52,7 +52,7 @@ virtual float get_shadow_factor(int index, vec4 world_pos) return 1.0; vec4 region = shadows[index].region; - float shadow_sample = texture(shadow_map, vec3(shadow_coord.xy*region.zw+region.xy, shadow_coord.z)); + float shadow_sample = texture(shadow_map, vec3(shadow_coord.xy*region.zw+region.xy, min(shadow_coord.z, 1.0))); return mix(1.0, shadow_sample, shadows[index].darkness); } else