3 uniform sampler2D uTexMain;
4 uniform sampler2D uTexWater;
15 vec2 ssuv = gl_FragCoord.xy*uInvRes;
16 vec4 mapwater = texture( uTexWater, vec2(aUv.x,aUv.y-uTime));
18 float undistort = smoothstep(0.1,0.6,distance( uCam, aCo )*0.1);
19 vec2 trimedge = smoothstep(0.0,0.2,1.0-abs(ssuv-0.5)*2.0);
20 undistort *= trimedge.x * trimedge.y;
22 vec2 warpamt = (mapwater.rg-0.5)*0.05*aUv.y*undistort;
23 vec4 mapbackbuffer = texture( uTexMain, ssuv + warpamt );
25 float opacity = 1.0-smoothstep(0.4,1.0,aUv.y);
26 FragColor = vec4( mapbackbuffer.rgb, opacity );