1 uniform sampler2D winTexture;
2 uniform float textureWidth;
3 uniform float textureHeight;
5 uniform float brightness;
6 uniform float saturation;
8 // Converts pixel coordinates to texture coordinates
9 vec2 pix2tex( vec2 pix )
11 return vec2( pix.s / textureWidth, pix.t / textureHeight );
16 vec4 tex = texture2D( winTexture, pix2tex( gl_TexCoord[0].st ));
17 tex = vec4( vec3( 1.0 ) - tex.rgb, tex.a * opacity );
18 if( saturation != 1.0 )
20 vec3 desaturated = tex.rgb * vec3( 0.30, 0.59, 0.11 );
21 desaturated = vec3( dot( desaturated, tex.rgb ));
22 tex.rgb = tex.rgb * vec3( saturation ) + desaturated * vec3( 1.0 - saturation );
24 tex.rgb = tex.rgb * vec3( brightness );