model fmt & heisenbug
[carveJwlIkooP6JGAAIwe30JlM.git] / shaders / vg / water.fs.glsl
1 out vec4 FragColor;
2
3 uniform sampler2D uTexMain;
4 uniform sampler2D uTexDudv;
5 uniform vec2 uInvRes;
6 uniform float uTime;
7
8 in vec2 aUv;
9
10 void main()
11 {
12 vec2 ssuv = gl_FragCoord.xy*uInvRes;
13 vec4 dudva = texture( uTexDudv, aUv + vec2(uTime*0.04f,uTime*0.03f) );
14 vec4 dudvb = texture( uTexDudv, aUv - vec2(uTime*0.1,uTime*0.054) );
15
16 vec2 distortamt = (dudva.rg-0.5) * (dudvb.ba-0.5) * 2.0;
17
18 vec4 reflected = texture( uTexMain, ssuv+distortamt );
19 FragColor = vec4(reflected.rgb*1.0,reflected.a);
20 }