~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kwin/scene-fragment.glsl

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
uniform sampler2D sampler;
 
2
uniform vec4 modulation;
 
3
uniform float saturation;
 
4
uniform int debug;
 
5
uniform int u_forceAlpha;
 
6
 
 
7
varying vec2 varyingTexCoords;
 
8
 
 
9
//varying vec4 color;
 
10
 
 
11
void main() {
 
12
    vec4 tex = texture2D(sampler, varyingTexCoords);
 
13
 
 
14
    if (u_forceAlpha > 0) {
 
15
        tex.a = 1.0;
 
16
    }
 
17
 
 
18
    if( saturation != 1.0 ) {
 
19
        vec3 desaturated = tex.rgb * vec3( 0.30, 0.59, 0.11 );
 
20
        desaturated = vec3( dot( desaturated, tex.rgb ));
 
21
        tex.rgb = tex.rgb * vec3( saturation ) + desaturated * vec3( 1.0 - saturation );
 
22
    }
 
23
 
 
24
    tex *= modulation;
 
25
 
 
26
    /*if (debug != 0) {
 
27
        tex.g += 0.5;
 
28
    }*/
 
29
 
 
30
    gl_FragColor = tex;
 
31
}