//.name Vignette
//.category Filters; Stylize
//.param float amount; 0.0; 1.0; Amount
//.param float inner; 0.0; 2.0; Inner Radius
//.param float outer; 0.0; 2.0; Outer Radius
//.input sampler2D tex0; Input

uniform sampler2D tex0;
uniform float amount, inner, outer;
varying vec2 pos;

void main(void)
{
	vec4 color = 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);

	gl_FragData[0] = vec4(mix(color.rgb, color.rgb * vig, amount), color.a);
}
