uniform sampler2D texture;

void main()
{
	//gl_FragColor =  gl_Color * texture2D(texture, gl_TexCoord[0].xy);
	vec4 pixelColor = texture2D(texture, gl_TexCoord[0].xy);	
	float avg = (pixelColor.x + pixelColor.y + pixelColor.z)/3.0;
	gl_FragColor = vec4(avg,avg,avg,pixelColor.w);	
}