2011-02-17 17:44:52 +00:00
|
|
|
uniform sampler2D sampler;
|
2011-02-12 00:36:21 +00:00
|
|
|
uniform vec4 modulation;
|
2010-11-14 19:49:00 +00:00
|
|
|
uniform float saturation;
|
2011-01-02 20:31:42 +00:00
|
|
|
uniform int u_forceAlpha;
|
2010-11-14 19:49:00 +00:00
|
|
|
|
2010-11-28 15:21:12 +00:00
|
|
|
varying vec2 varyingTexCoords;
|
2010-11-14 19:49:00 +00:00
|
|
|
|
2010-11-28 15:21:12 +00:00
|
|
|
//varying vec4 color;
|
2010-11-14 19:49:00 +00:00
|
|
|
|
|
|
|
void main() {
|
2011-02-17 17:44:52 +00:00
|
|
|
vec4 tex = texture2D(sampler, varyingTexCoords);
|
2011-02-12 00:36:21 +00:00
|
|
|
|
2012-09-04 18:55:37 +00:00
|
|
|
tex.a = min(tex.a + float(u_forceAlpha), 1.0);
|
2011-02-12 00:36:21 +00:00
|
|
|
|
2011-12-18 18:41:14 +00:00
|
|
|
if (saturation != 1.0) {
|
|
|
|
tex.rgb = mix(vec3(dot( vec3( 0.30, 0.59, 0.11 ), tex.rgb )), tex.rgb, saturation);
|
2010-11-14 19:49:00 +00:00
|
|
|
}
|
2011-02-12 00:36:21 +00:00
|
|
|
|
|
|
|
tex *= modulation;
|
|
|
|
|
2011-07-23 16:57:50 +00:00
|
|
|
#ifdef KWIN_SHADER_DEBUG
|
|
|
|
tex.g = min(tex.g + 0.5, 1.0);
|
|
|
|
#endif
|
2011-02-12 00:36:21 +00:00
|
|
|
|
2010-11-28 15:21:12 +00:00
|
|
|
gl_FragColor = tex;
|
2010-11-14 19:49:00 +00:00
|
|
|
}
|