Fix blend func for shaders
svn path=/trunk/KDE/kdebase/workspace/; revision=1203714
This commit is contained in:
parent
8ef7cec838
commit
bcabc01ecc
1 changed files with 9 additions and 4 deletions
|
@ -1680,12 +1680,17 @@ void SceneOpenGL::Window::prepareShaderRenderStates( TextureType type, double op
|
|||
// setup blending of transparent windows
|
||||
glPushAttrib( GL_ENABLE_BIT );
|
||||
bool opaque = isOpaque() && opacity == 1.0;
|
||||
bool alpha = toplevel->hasAlpha() || type != Content;
|
||||
if( type != Content )
|
||||
opaque = false;
|
||||
if( !opaque )
|
||||
{
|
||||
glEnable( GL_BLEND );
|
||||
glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA );
|
||||
if (!opaque) {
|
||||
glEnable(GL_BLEND);
|
||||
if (alpha) {
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
} else {
|
||||
glBlendColor((float)opacity, (float)opacity, (float)opacity, (float)opacity);
|
||||
glBlendFunc(GL_ONE, GL_ONE_MINUS_CONSTANT_ALPHA);
|
||||
}
|
||||
}
|
||||
shader->setUniform("opacity", (float)opacity);
|
||||
shader->setUniform("saturation", (float)saturation);
|
||||
|
|
Loading…
Reference in a new issue