summaryrefslogtreecommitdiff
path: root/shaders/water_fragment.glsl
blob: 150f071758f07af9556ff0f234b040e66369a5a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#version 120

varying vec3 pos;
uniform vec3 player_pos;
uniform sampler2D tex;
uniform float t;

void main() {
	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;
}

/* vim: set syn=glsl: */