out vec4 FragColor; uniform sampler2D uTexMain; uniform sampler2D uTexDudv; uniform vec2 uInvRes; uniform float uTime; in vec2 aUv; void main() { vec2 ssuv = gl_FragCoord.xy*uInvRes; vec4 dudva = texture( uTexDudv, aUv + vec2(uTime*0.04f,uTime*0.03f) ); vec4 dudvb = texture( uTexDudv, aUv - vec2(uTime*0.1,uTime*0.054) ); vec2 distortamt = (dudva.rg-0.5) * (dudvb.ba-0.5) * 2.0; vec4 reflected = texture( uTexMain, ssuv+distortamt ); FragColor = vec4(reflected.rgb*0.9,reflected.a); }