kwin/effects/sharpen/data/sharpen.frag
Lucas Murray 846496d2c1 Cleaned up the effects/ directory by moving each individual effect into
its own directory, cleaned up the effect config macros and renamed
"MakeTransparent" to "Translucency" so that it matches its visible name.

svn path=/trunk/KDE/kdebase/workspace/; revision=921749
2009-02-05 15:35:38 +00:00

24 lines
767 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()
{
float amount = 0.4;
vec3 tex = texture2D(sceneTex, pix2tex(gl_TexCoord[0].xy)).rgb * (1.0 + 4.0 * amount);
tex -= texture2D(sceneTex, pix2tex(gl_TexCoord[0].xy + vec2(0.0, 1.0))).rgb * amount;
tex -= texture2D(sceneTex, pix2tex(gl_TexCoord[0].xy + vec2(0.0, -1.0))).rgb * amount;
tex -= texture2D(sceneTex, pix2tex(gl_TexCoord[0].xy + vec2(1.0, 0.0))).rgb * amount;
tex -= texture2D(sceneTex, pix2tex(gl_TexCoord[0].xy + vec2(-1.0, 0.0))).rgb * amount;
gl_FragColor = vec4(tex, 1.0);
}