uniform sampler2D baseMap;
uniform float Time;
uniform float amount;

varying vec2 Texcoord;

void main(void)
{
   float time = Time * 5.0;
   vec2 uv = Texcoord;
   float xOffset = sin( (uv.y + time)* 20.0 * sin( (uv.y  + Time) * 10.0)) * cos(uv.x * 5.0 * uv.y * Time) * 0.1;
   
   float x = xOffset * 0.3 * amount;
   float y = sin(uv.x * 4.0 + time) * 0.03 * amount;
   uv.x += x;
   uv.y += y;
   
   vec2 uv2 = Texcoord;
   uv2.x += x * 0.3;
   uv2.y += y * 0.3;
   
   gl_FragColor = 0.25*texture2D( baseMap, uv ) + 0.75*texture2D( baseMap, uv2 );
}

