uniform sampler2D tex0;
//uniform float amount, inner, outer;
uniform float inner;
uniform float outer;
uniform float amount;
uniform vec3 channels;

void main(void)
{
	vec4 texel = texture2D(tex0, gl_TexCoord[0].st);

	float distance = length(gl_TexCoord[0].st - vec2(0.5, 0.5)) * 2.0;
	float vig = smoothstep(outer, inner, distance);

  vec3 desaturated = dot(texel, channels);

	gl_FragData[0] = vec4(mix(texel, desaturated, (1.0 - vig) * amount), texel.a);
}
