diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2011-05-28 19:17:22 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2011-05-28 19:27:11 +0200 |
commit | 91458d9a72fc0e74d4a6601221bbeaba907bfa85 (patch) | |
tree | f42354a60028e1aa5cc8fba6b29169279463a635 | |
parent | 303636788d5e6ae546f4581f772e71309e3bcffc (diff) |
Color terrain blue while underwater, raised sand level.
-rw-r--r-- | shaders/terrain_fragment.glsl | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/shaders/terrain_fragment.glsl b/shaders/terrain_fragment.glsl index 7197883..8b966fd 100644 --- a/shaders/terrain_fragment.glsl +++ b/shaders/terrain_fragment.glsl @@ -11,10 +11,8 @@ void main() { vec3 n = normalize(normal); float diffuse = max(dot(n, light_pos), 0.5); - //float f1 = clamp((pos.y-15.0) / 3.0, 0.0, 1.0); - //float f2 = clamp((pos.y-2) / 3.0, 0.0, 1.0); float f1 = clamp((pos.y-60.0) / 3.0, 0.0, 1.0); - float f2 = clamp((pos.y-30) / 3.0, 0.0, 1.0); + float f2 = clamp((pos.y-33) / 3.0, 0.0, 1.0); vec4 grass = texture2D(tex[0], gl_TexCoord[0].st); vec4 rock = texture2D(tex[1], gl_TexCoord[0].st); @@ -22,9 +20,6 @@ void main() { gl_FragColor = mix(mix(soil, grass, f2), rock, f1) * diffuse; - //gl_FragColor = mix(gl_FragColor, gl_FragColor*vec4(0, 0, 1, 0), clamp(31 - pos.y, 0.0, 1.0)); - //gl_FragColor += vec4(0, 0, 1, clamp(31 - pos.y, 0.0, 1.0)); - /* selection marker */ if(show_sel && pos.x >= selpos.x-1 && pos.x <= selpos.x+1 && @@ -33,6 +28,8 @@ void main() { gl_FragColor += texture2D(marktex, st); } gl_FragColor = mix(gl_FragColor, gl_Fog.color, pow(length(player_pos - pos)/100, 5)); + if(player_pos.y < 30 - 1.7) + gl_FragColor = mix(gl_FragColor, vec4(0, .3, .8, 0), .7); } /* vim: set syn=glsl: */ |