uniform vec4 g_color;
varying vec2 texture_coordinate;
uniform sampler2D g_texture;

void main()
{
	float value = 0.0;
	
	vec4 texColor = texture2D(g_texture, texture_coordinate);
	float c = (texColor.r + texColor.g + texColor.b)/(3.0);
	
	float r = value * texColor.r + c*(1.0 - value);
	float g = value * texColor.g + c*(1.0 - value);
	float b = value * texColor.b + c*(1.0 - value);
	
	gl_FragColor = vec4(r,g,b, texColor.a)*g_color;
}