summaryrefslogtreecommitdiff
path: root/shaders
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-05-29 15:03:10 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-05-29 15:03:10 +0200
commit5354f0c4e3bb157b63150c0e3415d0c3fdef8704 (patch)
treeb3754d9a71080dffe5c109667f5f3dd3ff80a37c /shaders
parent08bc996d3673124bfb4221d5a7dc5b48a9ebbee4 (diff)
Added slight moving animation to water texture.
Diffstat (limited to 'shaders')
-rw-r--r--shaders/water_fragment.glsl3
1 files changed, 2 insertions, 1 deletions
diff --git a/shaders/water_fragment.glsl b/shaders/water_fragment.glsl
index 857a500..150f071 100644
--- a/shaders/water_fragment.glsl
+++ b/shaders/water_fragment.glsl
@@ -3,9 +3,10 @@
varying vec3 pos;
uniform vec3 player_pos;
uniform sampler2D tex;
+uniform float t;
void main() {
- gl_FragColor = texture2D(tex, gl_TexCoord[0].st) - vec4(.2, .2, 0, 0);
+ gl_FragColor = texture2D(tex, gl_TexCoord[0].st + vec2(t, t)) - vec4(.2, .2, 0, 0);
gl_FragColor = mix(gl_FragColor, gl_Fog.color, pow(length(player_pos - pos)/100, 5));
gl_FragColor.a = 0.7;
}