summaryrefslogtreecommitdiff
path: root/drivers/gles2/shaders/scene.glsl
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-02-18 13:48:17 +0100
committerGitHub <noreply@github.com>2019-02-18 13:48:17 +0100
commit19f79d04fbf69ba7366fd9dd0269e97b181f1638 (patch)
tree0efc155b28f701598583ccb8c2a478022c9348d8 /drivers/gles2/shaders/scene.glsl
parentf023e40f6e7eab1e7a4fd17f4902bbab521d8054 (diff)
parent9b0326d2f32f07283b5b4e73af963a3b7c0cfae0 (diff)
Merge pull request #26005 from clayjohn/gles2_shadow_color
Added shadow_color property to gles2
Diffstat (limited to 'drivers/gles2/shaders/scene.glsl')
-rw-r--r--drivers/gles2/shaders/scene.glsl12
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