
uniform sampler2D texSharp;
uniform sampler2D texBlur;
uniform float tx,ty;
uniform float radR;
uniform float radG;
uniform float radB;
uniform float radius;
void main()
{
	vec2 uv = gl_TexCoord[0].xy;
	vec4 col = texture2D(texSharp,uv);
	vec2 center = vec2(0.5+tx,0.5+ty);
	vec4 c=vec4(0.0);
	int i=0;
	int count=0;
	vec2 uv1 = uv-center;
	float a = atan(uv1.x , uv1.y);
	float d = distance(uv,center);
	d*=d;

	vec2 uv2 = - vec2(sin(a),cos(a));

	c.r += texture2D(texBlur,uv+uv2*vec2(radR*0.1)*d).r;
	c.g += texture2D(texBlur,uv+uv2*vec2(radG*0.1)*d).g;
	c.b += texture2D(texBlur,uv+uv2*vec2(radB*0.1)*d).b;

	d*=2.0+radius;
	if(d > 1.0)
		d=  1.0;
	if(d < 0.0)
		d=  0.0;
	gl_FragColor = c*vec4(d)+vec4(1.0-d)*col;
}
