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

« back to all changes in this revision

Viewing changes to kwin/effects/cube/data/cylinder.frag

  • 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 float opacity;
 
3
uniform float brightness;
 
4
uniform float saturation;
 
5
 
 
6
varying vec2 varyingTexCoords;
 
7
 
 
8
void main()
 
9
{
 
10
    vec4 tex = texture2D(sampler, varyingTexCoords);
 
11
    if( saturation != 1.0 )
 
12
        {
 
13
        vec3 desaturated = tex.rgb * vec3( 0.30, 0.59, 0.11 );
 
14
        desaturated = vec3( dot( desaturated, tex.rgb ));
 
15
        tex.rgb = tex.rgb * vec3( saturation ) + desaturated * vec3( 1.0 - saturation );
 
16
        }
 
17
//     tex.rgb = tex.rgb * opacity * brightness;
 
18
//     tex.a = tex.a * opacity;
 
19
    gl_FragColor = tex;
 
20
}