//.name Desaturate
//.category Filters; Colors
//.param vec3 rgb; -2.0; 2.0; Red; Green; Blue; 0.2126; 0.7152; 0.0722;
//.input sampler2D tex0; Input

uniform sampler2D tex0;
uniform float amount;
uniform vec3 rgb;

void main(void)
{
	vec4 a = texture2D(tex0, gl_TexCoord[0].st);
	gl_FragColor = vec4(mix(a.rgb, vec3(a.r * rgb.r + a.g * rgb.g + a.b * rgb.b), amount), a.a);
}
