diff options
Diffstat (limited to 'drivers/gles2/shaders/scene.glsl')
-rw-r--r-- | drivers/gles2/shaders/scene.glsl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl index 242329d4a7..6f6f827d60 100644 --- a/drivers/gles2/shaders/scene.glsl +++ b/drivers/gles2/shaders/scene.glsl @@ -158,6 +158,7 @@ varying highp vec3 specular_interp; // general for all lights uniform highp vec4 light_color; +uniform highp vec4 shadow_color; uniform highp float light_specular; // directional @@ -912,6 +913,7 @@ uniform highp vec3 light_direction; //may be used by fog, so leave here //done in fragment // general for all lights uniform highp vec4 light_color; +uniform highp vec4 shadow_color; uniform highp float light_specular; // directional @@ -1680,7 +1682,7 @@ FRAGMENT_SHADER_CODE float shadow = sample_shadow(light_shadow_atlas, splane); - light_att *= shadow; + light_att *= mix(shadow_color.rgb, vec3(1.0), shadow); } #endif @@ -1757,7 +1759,7 @@ FRAGMENT_SHADER_CODE shadow_att = mix(shadow_att, shadow_att2, pssm_blend); } #endif - light_att *= shadow_att; + light_att *= mix(shadow_color.rgb, vec3(1.0), shadow_att); } #endif //LIGHT_USE_PSSM4 @@ -1798,7 +1800,7 @@ FRAGMENT_SHADER_CODE shadow_att = mix(shadow_att, shadow_att2, pssm_blend); } #endif - light_att *= shadow_att; + light_att *= mix(shadow_color.rgb, vec3(1.0), shadow_att); } #endif //LIGHT_USE_PSSM2 @@ -1905,7 +1907,7 @@ FRAGMENT_SHADER_CODE } #endif - light_att *= shadow; + light_att *= mix(shadow_color.rgb, vec3(1.0), shadow); } } #endif //use vertex lighting @@ -1953,7 +1955,7 @@ FRAGMENT_SHADER_CODE highp vec4 splane = shadow_coord; float shadow = sample_shadow(light_shadow_atlas, splane); - light_att *= shadow; + light_att *= mix(shadow_color.rgb, vec3(1.0), shadow); } #endif |