better low qual mode
[carveJwlIkooP6JGAAIwe30JlM.git] / shaders / common_world.glsl
index 5e1a8919070e9f1865a1250c745f98f329222ed1..d7b3ccfefc0741947a9bcd380b64e44e24d4a23a 100644 (file)
@@ -9,6 +9,7 @@ layout (std140) uniform ub_world_lighting
    float g_water_fog;
    int g_light_count;
    int g_light_preview;
+   int g_shadow_samples;
 };
 
 uniform sampler2D g_world_depth;
@@ -73,6 +74,11 @@ vec3 do_light_shadowing_old( vec3 vfrag )
 
 vec3 do_light_shadowing( vec3 vfrag )
 {
+   if( g_shadow_samples == 0 )
+   {
+      return vfrag;
+   }
+
    float fspread = g_light_colours[0].w;
    vec3  vdir = g_light_directions[0].xyz;
    float flength = g_light_directions[0].w;