uniform sampler2D textureId; 
varying vec2 texture_coordinate;
void main (void)
{
	vec4 sum = vec4(0.0, 0.0, 0.0, 1.0);
	vec4 pixa = texture2D(textureId, vec2(texture_coordinate.x, texture_coordinate.y));
	// float av = pixa.x * pixa.y * pixa.z; // B&W only
	float av = float(pixa.x + pixa.y + pixa.z) / 3.0;
	pixa.r = pixa.g = pixa.b = av;

	sum += pixa;
	gl_FragColor = sum;
}