uniform sampler2D tex;
varying vec2 texcoord;
uniform float blendfactor;


void main(void)
{
	vec4 texcolor_normal = texture2D(tex, texcoord);
	vec4 texcolor_inverted = vec4(1.0-texcolor_normal.r, 1.0-texcolor_normal.g, 1.0-texcolor_normal.b, 1.0);
    gl_FragColor = texcolor_normal + (texcolor_inverted - texcolor_normal) * blendfactor;
}
