Version: (using Devel) Installed from: Compiled sources OS: Linux I created the 'Glassified' plasma theme (http://kde-look.org/content/show.php/Glassified?content=81388) and discovered a bug by using OpenGL as the render engine for desktop effects. While XRender renders my theme correctly OpenGL does not at all. Primarily the panel and dialogs are darker there. It seems to me that OpenGL turns white into black (but only the panel and dialog).
Created attachment 25111 [details] Rendering with OpenGL The panel rendered with OpenGL
Created attachment 25112 [details] Rendering with XRender The panel rendered with xrender (That's how it should look like)
I've tested this bug more and found that when the center of the panel-background.svg is completly transparent no plasmoid is shom in the panel. They are neither clickable nor visible. Just away. i don#t know really how much this is a fault of KDE or OpenGL, but it's definitly a problem of transparency for the panel and dialogs when using OpenGL as the render engine for kde4 and desktop effects.
*** Bug 163683 has been marked as a duplicate of this bug. ***
having used glassified with opengl compositing with success, i'm guessing this is a driver / kwin mismatch. i was using an intel 3100 chipset, and it worked lovely (love the theme, btw =); what chipset and driver are you using? (then i'll triage this over to either kwin or mark it as an upstream x.org/driver issue since this is not a plasma issue)
I can confirm this bug with nVidia drivers 169.12. I use the theme all the time (Alternating with Akoma) and I didn't even know it was being rendered inferiorly. ^_^;
@aaron Nice to hear that it works correctly with non-Nvidia chipsets (and that you like my theme). I'm using the same Nvidia drivers like Lucas with a GeForce 7200gs. Seems to be no problem of plasma though.
Problem is caused by different blending formulas. OpenGL uses: Res = (1 - Opacity) * Bg + Opacity * Fg XRender uses: Res = (1 - Opacity) * Bg + Fg As XRender produces the same results as what is shown in Inkscape I'll assume the OpenGL formula is incorrect.
Created attachment 25456 [details] Change OpenGL blending formula
Comment on attachment 25456 [details] Change OpenGL blending formula Didn't test the patch, fails miserably.
Created attachment 25471 [details] Use premultiplied blending I can't work out how to test the shader opacity function but this one works for normal rendering.
Thank you Lucas for finding out and patching the problem! Unfortunately i am not able to test it, because i use precompiled kde4-packages from opensuse and don't know really how to recompile it. What's next? Will it be commited? Many users would be thankful. Lucas, is it possible for you to send me your compiled and patched file?
The first formula from comment #8 looks correct to me, not the second one, unless I'm missing something. Rivo?
For OpenGL, the correct formula is definitely the first one in comment #8. But the second formula might be correct as well :-) XRender probably uses premultiplied pixmaps for blending, in which case the second formula is correct for XRender: it just assumes that Fg has already been multiplied by opacity. So in the end the two formulas are actually equal, just that in XRender's case, Opacity * Fg has been optimized.
Yup, that's correct. This bug however is for the blending of the translucent canvas of an "opaque" window that has such as the panel. The Plasma panel's window canvas has premultiplied contents so it is displayed incorrectly in OpenGL mode. There are two ways of correcting it: 1) Convert OpenGL to use premultiplied opacity canvases and premultiply all window opacities (My second patch does this). 2) Have the Plasma panel depremultiply the opacity of it's canvas before sending to KWin for display and then remultiply in the XRender renderer. The second method is most likely the correct choice but it doesn't look to be the most efficient compared to the first.
Recent changes to the Plasma panel resize configuration thingy has made this bug MUCH more apparent. Now when in OpenGL mode the entire panel configuration is rendered one way but when you hover over it with the mouse it changes, causing massive amounts of glitching. This needs to be fixed before RC1.
I am mistaken, the panel glitch is not caused by this bug. However it does only effect OpenGL mode.
Ignore all my previous comments, OpenGL is fine. What is not fine however is: 1) Plasma doesn't depremultiply the SVG rasters after they have been generated so the can be correctly rendered in windows, and 2) XRender needs to premultiply window contents before they are rendered to compensate.
SVN commit 841974 by lmurray: X ARGB windows are stored with alpha premultiplied. Adjusted OpenGL rendering to accomodate that and therefore fixed incorrect rendering of windows with transparencies such as the Plasma panel. BUG: 163054 M +8 -10 scene_opengl.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=841974
*** Bug 168926 has been marked as a duplicate of this bug. ***
Thank you for this final fix! Are there any plans for backporting it to kde 4.1?
*** Bug 174988 has been marked as a duplicate of this bug. ***
*** Bug 170965 has been marked as a duplicate of this bug. ***