GUI disappearing when using alpha blending

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
Injector
Just popping in
Just popping in
Posts: 18
Joined: Wed Jan 12, 2005 12:06

GUI disappearing when using alpha blending

Postby Injector » Fri Jul 16, 2004 15:39

Hello there,

I am happily using the gui system (with Ogre) for some days now and stumbled upon an issue:

Whenever I use a material with alpha blending enabled and an object using this material is visible, all GUI elements suddenly disappear. They reappear when the object using the respective material is culled...

I am a bit puzzled by that behaviour. All gui elements have an alpha setting of 1.0.

I am using the dotsceneoctree scene manager, i don't know if the behaviour can be related to that.

Any idea greatly appreciated.

Injector

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

GUI disappearing when using alpha blending

Postby CrazyEddie » Fri Jul 16, 2004 19:18

It must be missing state setting in the Ogre GUI renderer object :( I'll see if I can identify which setting is being missed and add it in (could be alpha testing or something silly like that).

I'll post back here when I've fixed it in CVS (may not be before Sunday). Thanks for the report :)

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

GUI disappearing when using alpha blending

Postby CrazyEddie » Sat Jul 17, 2004 23:48

Hi,

I will be looking at this tomorrow - sorry for the delay :(

I don't suppose you could put together a minimal demo that demonstrates the issue (so that I can test it and know when I've fixed the problem)?

If not don't worry too much, but the fix may take a little longer (as I'll need to find a way to reproduce the problem first!).

Thanks,

CE.

User avatar
Injector
Just popping in
Just popping in
Posts: 18
Joined: Wed Jan 12, 2005 12:06

GUI disappearing when using alpha blending

Postby Injector » Mon Jul 19, 2004 06:45

Thanks for the reply.
I will try to compile a little demo later today.

Stay tuned.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

GUI disappearing when using alpha blending

Postby CrazyEddie » Mon Jul 19, 2004 09:41

Thanks, that will be an enourmous help :)

User avatar
Injector
Just popping in
Just popping in
Posts: 18
Joined: Wed Jan 12, 2005 12:06

GUI disappearing when using alpha blending

Postby Injector » Mon Jul 19, 2004 12:45

Ok, I modified the CameraTrack demo to include a simple message box (from one of your demos).

There are three files (case sensitive).

http://www.deck13.com/Ogre.material
http://www.deck13.com/CameraTrack.rar
http://www.deck13.com/Release.rar

I added the line "scene_blend alpha_blend" to the earrings material within Ogre.material. CameraTrack.rar contains the source code, Release.rar the binaries which are supposed to go in the common Ogre directory "Samples/Common/bin/Release" to make sure the app finds all materials, textures, etc. (Don't forget to put your Layout.tga in a place where Ogre can find it :D ). I updated Ogre and CEGUI from CVS this morning.
I hope rar's are ok for you and that this demo helps you finding the problem. If I have missed anything, let me know.

Thank you very much.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

GUI disappearing when using alpha blending

Postby CrazyEddie » Mon Jul 19, 2004 13:13

Yep rar files are fine.

Thanks for doing this - definately a problem somewhere :lol: With any luck I'll have a solution in CVS tomorrow.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

GUI disappearing when using alpha blending

Postby CrazyEddie » Mon Jul 19, 2004 19:06

This issue is now fixed. Thanks for reporting this, and for the demo - it was a great help :D

CVS has a 5 hour sync time for anonymous access, in the mean time see the patch below.

CE.

Code: Select all

Index: src/renderers/OgreGUIRenderer/ogrerenderer.cpp
===================================================================
RCS file: /cvsroot/crayzedsgui/cegui_mk2/src/renderers/OgreGUIRenderer/ogrerenderer.cpp,v
retrieving revision 1.13
diff -u -r1.13 ogrerenderer.cpp
--- src/renderers/OgreGUIRenderer/ogrerenderer.cpp   4 Jul 2004 10:27:18 -0000   1.13
+++ src/renderers/OgreGUIRenderer/ogrerenderer.cpp   19 Jul 2004 18:57:48 -0000
@@ -357,6 +357,7 @@
    d_render_sys->_setColourBufferWriteEnabled(true, true, true, true);
 
    // initialise texture settings
+   d_render_sys->_setTextureCoordCalculation(0, TEXCALC_NONE);
    d_render_sys->_setTextureCoordSet(0, 0);
    d_render_sys->_setTextureUnitFiltering(0, FO_LINEAR, FO_LINEAR, FO_POINT);
    d_render_sys->_setTextureAddressingMode(0, TextureUnitState::TAM_CLAMP);

User avatar
Injector
Just popping in
Just popping in
Posts: 18
Joined: Wed Jan 12, 2005 12:06

GUI disappearing when using alpha blending

Postby Injector » Tue Jul 20, 2004 11:05

The fix indeed fixed the issue in the little demo I supplied, thanks for this.
Unfortunately, in my 'real' application, the problem was still there and here is why: I use vertex/fragment programs.

So without thinking about it too much I added the following two lines to the OgreRenderer::initRenderStates() method:

Code: Select all

d_render_sys->unbindGpuProgram(GPT_FRAGMENT_PROGRAM);
d_render_sys->unbindGpuProgram(GPT_VERTEX_PROGRAM);


and this seems to do the trick. :D

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

GUI disappearing when using alpha blending

Postby CrazyEddie » Tue Jul 20, 2004 17:38

Hehe :)

Thanks for this. I think it now has all the settings covered, at least I hope so. I'll add these calls to CVS in a little while :D


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 6 guests