uniform sampler2D tex;

varying vec4 colour;
varying vec2 texcoord;

void main()
{
	vec4 result;
	vec4 pix = texture2D(tex, texcoord);
	if (pix.a == 0.0) {
		result = vec4(colour.rgb, 1.0);
	}
	else {
		float s = (colour.r + colour.g + colour.b) / 3.0;
		result = vec4(pix.rgb * s * 1.25, 1.0);
	}
	gl_FragColor = result;
}
