~tkluck/ubuntu/precise/gnome-shell/lp883443

« back to all changes in this revision

Viewing changes to data/shaders/dim-window.glsl

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha, Jeremy Bicha, Martin Pitt
  • Date: 2011-09-22 08:50:45 UTC
  • mfrom: (1.1.31 upstream)
  • Revision ID: package-import@ubuntu.com-20110922085045-o8abj9mx33iljb42
Tags: 3.1.92-0ubuntu1
[ Jeremy Bicha ]
* New upstream release.
  - Adds browser plugin for installing, enabling, disabling, and
    uninstalling shell extensions. (Note that extensions.gnome.org
    isn't yet in operation.)
  - Lots of bugfixes
* debian/control.in:
  - Depend on caribou libraries
  - Recommend gnome-session-fallback, needed when graphics support
    test fails (LP: #852950)
  - Bump minimum gjs dependency to 1.29.18 and minimum mutter 
    to 3.1.92
* debian/patches/01_favorite_apps.patch: Updated
* debian/patches/04_build-without-caribou.patch: Dropped

[ Martin Pitt ]
* debian/control.in: Add libjson-glib-dev build dependency as per
  configure.ac.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#version 110
2
 
uniform sampler2D sampler0;
 
2
uniform sampler2D tex;
3
3
uniform float fraction;
4
4
uniform float height;
5
5
const float c = -0.2;
12
12
vec4 off = vec4(0.633, 0.633, 0.633, 0);
13
13
void main()
14
14
{
15
 
  vec4 color = texture2D(sampler0, gl_TexCoord[0].st);
16
 
  float y = height * gl_TexCoord[0][1];
 
15
  vec4 color = texture2D(tex, cogl_tex_coord_in[0].xy);
 
16
  float y = height * cogl_tex_coord_in[0].y;
17
17
 
18
18
  // To reduce contrast, blend with a mid gray
19
 
  gl_FragColor = color * contrast - off * c;
 
19
  cogl_color_out = color * contrast - off * c * color.a;
20
20
 
21
 
  // We only fully dim at a distance of BORDER_MAX_HEIGHT from the edge and
 
21
  // We only fully dim at a distance of BORDER_MAX_HEIGHT from the top and
22
22
  // when the fraction is 1.0. For other locations and fractions we linearly
23
 
  // interpolate back to the original undimmed color.
24
 
  gl_FragColor = color + (gl_FragColor - color) * min(y / border_max_height, 1.0);
25
 
  gl_FragColor = color + (gl_FragColor - color) * fraction;
 
23
  // interpolate back to the original undimmed color, so the top of the window
 
24
  // is at full color.
 
25
  cogl_color_out = color + (cogl_color_out - color) * max(min(y / border_max_height, 1.0), 0.0);
 
26
  cogl_color_out = color + (cogl_color_out - color) * fraction;
26
27
}