
#version 330 core
in vec2 texCoord;
in vec4 vertexFragColor;
out vec4 fragColor;


uniform sampler2D texture0;
uniform sampler2D texture1;
uniform float tim3 = 21.0;
uniform float speedX = -0.1;
uniform float speedY = 0.3;
uniform float video = 0.0;
uniform float value1 = 1.0;
uniform float value2 = 0.5;
uniform float value3 = 2.0;
uniform float value4 = 2.0;
uniform float contrast = 0.025;
uniform float alpha = 1.0;
uniform vec4 color = vec4(1);

void main()
{
	float t = tim3;
	vec2 uv = texCoord.xy;

    vec2 uv2 = uv;
	uv2 *= 2.0;
    uv2.x += t*.1;
    uv2.y += t*.1;
    
    vec4 disp = texture(texture1, uv2) - vec4(0.5,0.5,0.5,0.0);
    vec2 n_uv = uv;
    n_uv += 1.6* disp.x*disp.y;
	//n_uv.y *= -1.0;
	n_uv *= t*.2 - 10.0;
	fragColor = texture(texture0, n_uv);
	
}
	 

	  
