I created some windows with transparent Backgrounds.
With an image from an .png which is at 75% alpha.
Now every window is rendered fine, but when a windows is on top of the other, the underlying window is shining through, but i don't want that.
I wan't that the parts covered by the top window are not rendered and only my window-background (from ogre) is shining through.
(like it is in Half-Life 2 or Dod:S or CS:S)
Is this possible?
and if yes... how?
Windows with transparent background & underlying windows
Moderators: CEGUI MVP, CEGUI Team
-
nebukadnezzar
- Just popping in

- Posts: 7
- Joined: Sun Jul 09, 2006 10:42
- Contact:
- scriptkid
- Home away from home

- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
Hi,
i don't get this part: "I want that the parts covered by the top window are not rendered and only my window-background (from ogre) is shining through."
Can you post a screenshot of what you mean? Or photoshop such situation?
A suggestion (although i don't understand the question):
-There is an "InheritsAlpha" property for parent/chield relations when using alpha.
Thanks and good luck!
i don't get this part: "I want that the parts covered by the top window are not rendered and only my window-background (from ogre) is shining through."
Can you post a screenshot of what you mean? Or photoshop such situation?
A suggestion (although i don't understand the question):
-There is an "InheritsAlpha" property for parent/chield relations when using alpha.
Thanks and good luck!
-
nebukadnezzar
- Just popping in

- Posts: 7
- Joined: Sun Jul 09, 2006 10:42
- Contact:
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
I can see the effect you're after, and there's no easy setting to get it done. I think the 'Background' there is actually rendered last.
I think to get a similar effect you need to use a StaticImage or what have you which is rendered over the top of all other windows (i.e. set it as always on top) with say 20% or 30% alpha (i.e. the inverse of what you would use if it was the windows that had the alpha setting) . You must set the appropriate modes to enable inputs to 'pass through' this top-most window to the underlying widgets - either set the StaticImage as disabled (for <=0.4.x), or use the "MousePassThroughEnabled" setting (for >=0.5.x).
Let us know if this works!
CE
I think to get a similar effect you need to use a StaticImage or what have you which is rendered over the top of all other windows (i.e. set it as always on top) with say 20% or 30% alpha (i.e. the inverse of what you would use if it was the windows that had the alpha setting) . You must set the appropriate modes to enable inputs to 'pass through' this top-most window to the underlying widgets - either set the StaticImage as disabled (for <=0.4.x), or use the "MousePassThroughEnabled" setting (for >=0.5.x).
Let us know if this works!
CE
-
nebukadnezzar
- Just popping in

- Posts: 7
- Joined: Sun Jul 09, 2006 10:42
- Contact:
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hello,
I hacked around the OpenGL renderer a bit and added a configurable option to enable and disable Z buffer testing (and also switch the direction of the sort for the quads) at will. The changes are actually not too bad, just a few lines; we might want to consider adding this in as an option on some of the renderers - we also get a small performance boost out of it too when running in z-test enabled mode
(Historical Note: The original version of CEGUI did not support alpha blending between GUI elements at all, and relied on using the z-buffer and front to back drawing order).
I did not try this on the Ogre3D renderer as yet, since I have not got everything set-up on here again yet, but having done it on the GL renderer - as a kind of proof of concept - I can say that you should end up with a very similar effect to what you desire, so long as the underlying imagery that you do want to be blended is rendered to the screen before any gui stuff (don't forget to clear the z buffer after drawing your scene and prior to rendering the UI
).
CE.
I hacked around the OpenGL renderer a bit and added a configurable option to enable and disable Z buffer testing (and also switch the direction of the sort for the quads) at will. The changes are actually not too bad, just a few lines; we might want to consider adding this in as an option on some of the renderers - we also get a small performance boost out of it too when running in z-test enabled mode
(Historical Note: The original version of CEGUI did not support alpha blending between GUI elements at all, and relied on using the z-buffer and front to back drawing order).
I did not try this on the Ogre3D renderer as yet, since I have not got everything set-up on here again yet, but having done it on the GL renderer - as a kind of proof of concept - I can say that you should end up with a very similar effect to what you desire, so long as the underlying imagery that you do want to be blended is rendered to the screen before any gui stuff (don't forget to clear the z buffer after drawing your scene and prior to rendering the UI
CE.
Who is online
Users browsing this forum: No registered users and 10 guests