summaryrefslogtreecommitdiff
path: root/drivers/gles2/shaders/material.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles2/shaders/material.glsl')
-rw-r--r--drivers/gles2/shaders/material.glsl8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gles2/shaders/material.glsl b/drivers/gles2/shaders/material.glsl
index 38fb03ab5c..ccd80bf2f0 100644
--- a/drivers/gles2/shaders/material.glsl
+++ b/drivers/gles2/shaders/material.glsl
@@ -1175,6 +1175,10 @@ FRAGMENT_SHADER_CODE
vec3 mdiffuse = diffuse.rgb;
vec3 light;
+#if defined(USE_LIGHT_SHADOW_COLOR)
+ vec3 shadow_color=vec3(0.0,0.0,0.0);
+#endif
+
#if defined(USE_LIGHT_SHADER_CODE)
//light is written by the light shader
{
@@ -1195,6 +1199,10 @@ LIGHT_SHADER_CODE
#endif
diffuse.rgb = const_light_mult * ambient_light *diffuse.rgb + light * attenuation * shadow_attenuation;
+#if defined(USE_LIGHT_SHADOW_COLOR)
+ diffuse.rgb += light * shadow_color * attenuation * (1.0 - shadow_attenuation);
+#endif
+
#ifdef USE_FOG
diffuse.rgb = mix(diffuse.rgb,fog_interp.rgb,fog_interp.a);