kwin/effects/cube/data/cylinder.frag
Martin Gräßlin 4fa09b63b4 Sphere and Cylinder become part of Cube effect. That is much more convenient than having an own effect for each (only loading the shader is actually required).
Btw caps of cylinder and sphere are working correctly again.

svn path=/trunk/KDE/kdebase/workspace/; revision=925809
2009-02-14 09:29:01 +00:00

24 lines
671 B
GLSL

uniform sampler2D winTexture;
uniform float windowWidth;
uniform float windowHeight;
uniform float opacity;
uniform float front;
vec2 pix2tex(vec2 pix)
{
return vec2(pix.x / windowWidth, pix.y / windowHeight);
}
void main()
{
if( front > 0.0 && gl_FrontFacing )
discard;
if( front < 0.0 && !gl_FrontFacing )
discard;
// remove the shadow decoration quads
if( gl_TexCoord[0].x < 0.0 || gl_TexCoord[0].x > windowWidth ||
gl_TexCoord[0].y < 0.0 || gl_TexCoord[0].y > windowHeight )
discard;
gl_FragColor.rgba = texture2D(winTexture, pix2tex(gl_TexCoord[0].xy)).rgba;
gl_FragColor.a = gl_FragColor.a * opacity;
}