uniform sampler2D texture;
uniform float time = 1.0;
uniform float speedX = 1.0;
uniform float speedY = 1.0;
uniform float video = 0.0;
uniform float colorR = 1.0;
uniform float colorG = 1.0;

void main()
{
	float t = time;
    	vec2 uv = gl_TexCoord[0].xy*vec2(2.0,2.0)-vec2(0.5,0.5);

    uv.x += step(uv.x, 0.5) * (0.5-uv.x) * 2.0;
    uv.y += step(uv.y, 0.5) * (0.5-uv.y) * 2.0;
    

    uv.x -= (0.005*sin(15*t)) * speedX; //step(sin(t),0.1);
    uv.y -= t * speedY; //step(sin(t),0.2);
	vec4 color = texture2D(texture, uv);
	 uv = gl_TexCoord[0].xy*vec2(2.0,2.0)-vec2(0.5,0.5);
	vec4 color2 = texture2D(texture, uv);
	color.a=color2.a;
	gl_FragColor = color;

}