uniform sampler2D tex;

void main()
{	
	vec3 color = texture2D(tex, gl_TexCoord[0].xy).rgb;
	float luminance = dot( vec3(0.3, 0.59, 0.11), color);
	
	 
	float factor = luminance / (1.0 + luminance);
	
	gl_FragColor = vec4( vec3(factor) * color, 1.0 );
}