uniform float ratio1;
uniform float ratio2;

void main() {
	vec4 col = texture2D(tex,gl_TexCoord[0].st); //baseColor
	col = mix(gl_Color,vec4(col.rgb,col.a*gl_Color.a),mixTexturing); //get actual pixel color (vertex + texture if present)
	vec4 col2 = vec4(col);
	
	//negative
	col2 = vec4(1.0-col2.rgb,col.a);
	col2 = mix(col,col2,ratio1);
	
	//grayscale
	float gray = dot(col2.rgb,vec3(0.299,0.587,0.114));
	col2 = vec4(gray,gray,gray,col2.a);
	col2 = mix(col,col2,ratio2);
	
	gl_FragColor = col2;
}