summaryrefslogtreecommitdiff
path: root/drivers/gles2/shaders
diff options
context:
space:
mode:
authorLeon Krause <lk@leonkrause.com>2018-10-06 02:17:24 +0200
committerLeon Krause <lk@leonkrause.com>2018-10-06 02:17:24 +0200
commit7a4d5ddb4dceb6c5620c7f1d88a7610a365e9084 (patch)
tree54891a8051ab9277338ae50905fab963b639388e /drivers/gles2/shaders
parente869d53e6de7b6668a13f1abeb1bdbcddc56143e (diff)
Format GLES2 scene.glsl
Diffstat (limited to 'drivers/gles2/shaders')
-rw-r--r--drivers/gles2/shaders/scene.glsl35
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl
index c47a06a859..7b57f5d497 100644
--- a/drivers/gles2/shaders/scene.glsl
+++ b/drivers/gles2/shaders/scene.glsl
@@ -310,7 +310,6 @@ uniform highp float fog_height_max;
uniform mediump float fog_height_curve;
#endif
-
#endif //fog
void main() {
@@ -625,19 +624,19 @@ VERTEX_SHADER_CODE
{
- float fog_z = smoothstep(fog_depth_begin, fog_max_distance, length(vertex));
+ float fog_z = smoothstep(fog_depth_begin, fog_max_distance, length(vertex));
- fog_amount = pow(fog_z, fog_depth_curve);
+ fog_amount = pow(fog_z, fog_depth_curve);
}
#endif
#ifdef FOG_HEIGHT_ENABLED
{
- float y = (camera_matrix * vec4(vertex_interp, 1.0)).y;
- fog_amount = max(fog_amount, pow(smoothstep(fog_height_min, fog_height_max, y), fog_height_curve));
+ float y = (camera_matrix * vec4(vertex_interp, 1.0)).y;
+ fog_amount = max(fog_amount, pow(smoothstep(fog_height_min, fog_height_max, y), fog_height_curve));
}
#endif
- fog_interp = vec4(fog_color,fog_amount);
+ fog_interp = vec4(fog_color, fog_amount);
#endif //fog
@@ -2021,8 +2020,8 @@ FRAGMENT_SHADER_CODE
#if defined(USE_VERTEX_LIGHTING)
- gl_FragColor.rgb = mix(gl_FragColor.rgb,fog_interp.rgb,fog_interp.a);
-#else //pixel based fog
+ gl_FragColor.rgb = mix(gl_FragColor.rgb, fog_interp.rgb, fog_interp.a);
+#else //pixel based fog
float fog_amount = 0.0;
#ifdef LIGHT_MODE_DIRECTIONAL
@@ -2036,26 +2035,26 @@ FRAGMENT_SHADER_CODE
{
- float fog_z = smoothstep(fog_depth_begin, fog_max_distance, length(vertex));
+ float fog_z = smoothstep(fog_depth_begin, fog_max_distance, length(vertex));
- fog_amount = pow(fog_z, fog_depth_curve);
+ fog_amount = pow(fog_z, fog_depth_curve);
- if (fog_transmit_enabled) {
- vec3 total_light = gl_FragColor.rgb;
- float transmit = pow(fog_z, fog_transmit_curve);
- fog_color = mix(max(total_light, fog_color), fog_color, transmit);
- }
+ if (fog_transmit_enabled) {
+ vec3 total_light = gl_FragColor.rgb;
+ float transmit = pow(fog_z, fog_transmit_curve);
+ fog_color = mix(max(total_light, fog_color), fog_color, transmit);
+ }
}
#endif
#ifdef FOG_HEIGHT_ENABLED
{
- float y = (camera_matrix * vec4(vertex, 1.0)).y;
- fog_amount = max(fog_amount, pow(smoothstep(fog_height_min, fog_height_max, y), fog_height_curve));
+ float y = (camera_matrix * vec4(vertex, 1.0)).y;
+ fog_amount = max(fog_amount, pow(smoothstep(fog_height_min, fog_height_max, y), fog_height_curve));
}
#endif
- gl_FragColor.rgb = mix(gl_FragColor.rgb,fog_color,fog_amount);
+ gl_FragColor.rgb = mix(gl_FragColor.rgb, fog_color, fog_amount);
#endif //use vertex lit