uniform sampler2D texture;
uniform float time = 1.0;
uniform float speedX = 0.0;
uniform float speedY = 0.0;
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;
void main()
{
	float t = time;
    	vec2 uv = gl_TexCoord[0].xy;
		

    uv.x += step(uv.x, .5 ) * (0.5-uv.x) * 2.0;
    uv.y += step(uv.y, .5) * (0.5-uv.y) * 2.0;
    
    uv.x -= t * speedX; //step(sin(t),0.2);
    uv.y -= t * speedY; //step(sin(t),0.2);

	uv.x += value1;
	uv.y += value2;
	
	gl_FragColor = texture2D(texture, uv);   
}