varying vec2 texCoord;

uniform sampler2D waterMap;
uniform sampler2D uwMap;
uniform sampler2D ripplesMap;
uniform float yscroll;
uniform float testvalue;
void main (void)
{
	vec2 uv=texCoord;
	uv+=vec2((texture2D(ripplesMap, texCoord/vec2(1.0,2.0)+vec2(0.0,yscroll/2160.0)).x-0.5)/(200.0*0.17),0.0);
	uv+=vec2(0.0,(texture2D(ripplesMap, texCoord/vec2(1.0,2.0)+vec2(0.0,1.0-(yscroll/2160.0))).x-0.5)/(200.0*0.17));
	vec4 x=texture2D(uwMap, uv);
	vec4 pix;
	if (x.b>0.0)
		pix =(mix(x,texture2D(waterMap,texCoord),0.1)); 
	else 
		pix=texture2D(waterMap,texCoord);

    gl_FragColor = pix;
}
