uniform float time;
uniform vec2 resolution;
uniform vec2 mouse;
uniform sampler2D backBuffer;

void main(void)
{
    vec2 halfres = vec2(mouse.x - 50.0, resolution.y - ( resolution.y * mouse.y) - 50.0);
    vec2 cPos = gl_FragCoord.xy;

    cPos.x -= 0.5*halfres.x*sin(time/2.0)+0.3*halfres.x*cos(time)+halfres.x;
    cPos.y -= 0.4*halfres.y*sin(time/5.0)+0.3*halfres.y*cos(time)+halfres.y;
    float cLength = length(cPos);
    float bLength = length(cPos * 1.1);

    vec2 uv = gl_FragCoord.xy/resolution.xy;
	vec3 col = texture2D(backBuffer,uv).xyz* (1.0 - ((length(gl_FragCoord.xy - vec2(mouse.x,resolution.y * (1.0 - mouse.y)) ) / 200.0) ) * 
	(( (length(gl_FragCoord.xy - vec2(600.0,300.0) ) / 200.0) )));

    gl_FragColor = vec4(col,1.0);
}