kwin/effects/data/invert.frag
Rivo Laks f69139e825 Add invert effect which inverts aka negates desktop's colors.
Shortcut is Ctrl+F6 for now.
  Requires shaders.

svn path=/trunk/KDE/kdebase/workspace/; revision=683162
2007-07-04 09:59:07 +00:00

18 lines
369 B
GLSL

uniform sampler2D sceneTex;
uniform float textureWidth;
uniform float textureHeight;
// Converts pixel coordinates to texture coordinates
vec2 pix2tex(vec2 pix)
{
return vec2(pix.x / textureWidth, 1.0 - pix.y / textureHeight);
}
void main()
{
vec3 tex = texture2D(sceneTex, pix2tex(gl_TexCoord[0].xy)).rgb;
gl_FragColor = vec4(vec3(1.0) - tex, 1.0);
}