summaryrefslogtreecommitdiff
path: root/drivers/gles2/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles2/shaders')
-rw-r--r--drivers/gles2/shaders/scene.glsl18
-rw-r--r--drivers/gles2/shaders/stdlib.glsl9
2 files changed, 10 insertions, 17 deletions
diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl
index 2b0b095ac9..958de94485 100644
--- a/drivers/gles2/shaders/scene.glsl
+++ b/drivers/gles2/shaders/scene.glsl
@@ -1218,11 +1218,11 @@ LIGHT_SHADER_CODE
#define SAMPLE_SHADOW_TEXEL_PROJ(p_shadow, p_pos) step(p_pos.z, texture2DProj(p_shadow, p_pos).r)
float sample_shadow(
- highp sampler2D shadow,highp vec4 spos) {
+ highp sampler2D shadow, highp vec4 spos) {
#ifdef SHADOW_MODE_PCF_13
- spos.xyz/=spos.w;
+ spos.xyz /= spos.w;
vec2 pos = spos.xy;
float depth = spos.z;
@@ -1244,7 +1244,7 @@ float sample_shadow(
#ifdef SHADOW_MODE_PCF_5
- spos.xyz/=spos.w;
+ spos.xyz /= spos.w;
vec2 pos = spos.xy;
float depth = spos.z;
@@ -1541,9 +1541,8 @@ FRAGMENT_SHADER_CODE
#ifdef USE_SHADOW
-
#ifdef USE_VERTEX_LIGHTING
-//compute shadows in a mobile friendly way
+ //compute shadows in a mobile friendly way
#ifdef LIGHT_USE_PSSM4
//take advantage of prefetch
@@ -1552,7 +1551,6 @@ FRAGMENT_SHADER_CODE
float shadow3 = sample_shadow(light_directional_shadow, shadow_coord3);
float shadow4 = sample_shadow(light_directional_shadow, shadow_coord4);
-
if (depth_z < light_split_offsets.w) {
float pssm_fade = 0.0;
float shadow_att = 1.0;
@@ -1605,7 +1603,6 @@ FRAGMENT_SHADER_CODE
}
#endif
light_att *= shadow_att;
-
}
#endif //LIGHT_USE_PSSM4
@@ -1616,8 +1613,6 @@ FRAGMENT_SHADER_CODE
float shadow1 = sample_shadow(light_directional_shadow, shadow_coord);
float shadow2 = sample_shadow(light_directional_shadow, shadow_coord2);
-
-
if (depth_z < light_split_offsets.y) {
float shadow_att = 1.0;
float pssm_fade = 0.0;
@@ -1680,12 +1675,11 @@ FRAGMENT_SHADER_CODE
#ifdef LIGHT_USE_PSSM4
-
if (depth_z < light_split_offsets.y) {
- if (depth_z < light_split_offsets.x) {
+ if (depth_z < light_split_offsets.x) {
pssm_coord = shadow_coord;
-#ifdef LIGHT_USE_PSSM_BLEND
+#ifdef LIGHT_USE_PSSM_BLEND
pssm_coord2 = shadow_coord2;
pssm_blend = smoothstep(0.0, light_split_offsets.x, depth_z);
diff --git a/drivers/gles2/shaders/stdlib.glsl b/drivers/gles2/shaders/stdlib.glsl
index 8662dcfe53..3674d70c9f 100644
--- a/drivers/gles2/shaders/stdlib.glsl
+++ b/drivers/gles2/shaders/stdlib.glsl
@@ -39,10 +39,9 @@ highp vec4 texel2DFetch(highp sampler2D tex, ivec2 size, ivec2 coord) {
#ifndef USE_GLES_OVER_GL
highp mat4 transpose(highp mat4 src) {
return mat4(
- vec4( src[0].x, src[1].x, src[2].x, src[3].x ),
- vec4( src[0].y, src[1].y, src[2].y, src[3].y ),
- vec4( src[0].z, src[1].z, src[2].z, src[3].z ),
- vec4( src[0].w, src[1].w, src[2].w, src[3].w )
- );
+ vec4(src[0].x, src[1].x, src[2].x, src[3].x),
+ vec4(src[0].y, src[1].y, src[2].y, src[3].y),
+ vec4(src[0].z, src[1].z, src[2].z, src[3].z),
+ vec4(src[0].w, src[1].w, src[2].w, src[3].w));
}
#endif