2008-07-15 19:21:50 +00:00
|
|
|
uniform sampler2D winTexture;
|
|
|
|
uniform float windowWidth;
|
|
|
|
uniform float windowHeight;
|
|
|
|
uniform float opacity;
|
2009-02-14 09:29:01 +00:00
|
|
|
uniform float front;
|
2008-07-15 19:21:50 +00:00
|
|
|
|
|
|
|
vec2 pix2tex(vec2 pix)
|
|
|
|
{
|
|
|
|
return vec2(pix.x / windowWidth, pix.y / windowHeight);
|
|
|
|
}
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2009-02-14 09:29:01 +00:00
|
|
|
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;
|
2008-07-15 19:21:50 +00:00
|
|
|
gl_FragColor.rgba = texture2D(winTexture, pix2tex(gl_TexCoord[0].xy)).rgba;
|
2009-02-14 09:29:01 +00:00
|
|
|
gl_FragColor.a = gl_FragColor.a * opacity;
|
2008-07-15 19:21:50 +00:00
|
|
|
}
|