#ifdef GL_ES
precision highp float;
#endif

uniform float time;
uniform sampler2D tex0;

void main(void)
{
	vec2 p = gl_TexCoord[0].xy;
	if (time<1000.0)
	{
		float distx = (p.y+1.0)*(1.0-time/1000.0);
		distx = distx*distx*distx;
		float disty = (p.x+1.0)*(1.0-time/1000.0);
		disty = disty*disty*disty;
		p.x = p.x + distx;
		p.y = p.y + disty;
	}
	if (p.x < 0.0 || p.x > 1.0)
	{
		gl_FragColor = vec4(0.0,0.0,0.0,0.0);
	}
	else
	{
		gl_FragColor = texture2D(tex0, p.xy);
	}
}
