]> git.tdb.fi Git - libs/gl.git/blobdiff - shaderlib/shadow.glsl
Support multiple lights in a single pass
[libs/gl.git] / shaderlib / shadow.glsl
index 04cf6832dcffd19a6a4949c1049b98e0f2b64a40..65b003f43bcdef2295678d88624d45a5ed7089d2 100644 (file)
@@ -21,7 +21,7 @@ virtual float get_shadow_factor(int index)
 {
        if(use_shadow_map)
        {
-               if(shadow_coord.x<0 || shadow_coord.x>1 || shadow_coord.y<0 || shadow_coord.y>1)
+               if(index>0 || shadow_coord.x<0 || shadow_coord.x>1 || shadow_coord.y<0 || shadow_coord.y>1)
                        return 1.0;
                float shadow_sample = texture(shadow_map, shadow_coord);
                return mix(1.0, shadow_sample, shadow_darkness);