[Solved] Unexpected Transparency with OpenGL3

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Socram
Just popping in
Just popping in
Posts: 4
Joined: Mon Oct 03, 2011 18:51

[Solved] Unexpected Transparency with OpenGL3

Postby Socram » Wed Sep 17, 2014 06:48

So I'm having an odd issue that I've been scratching my head over for the past couple hours. I got CEGUI hooked up correctly earlier today to a rendering/game engine project I've been working on for a couple months. Whenever I call the renderAllGUIContexts function the models in my scene (which rendered normally before) are suddenly all transparent. I've attached a picture to illustrate. I've naively looked into some depth buffer and blend function settings for openGL but have had no luck, and I'm pretty lost at where to start with this problem. Any insight or potential explanation would be extremely helpful, thanks for your time.

Image
Last edited by Socram on Thu Sep 18, 2014 14:30, edited 3 times in total.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Unexpected Transparency when adding CEGUI to openGL3

Postby Ident » Wed Sep 17, 2014 07:33

You didnt provide us with a CEGUI.log : viewtopic.php?f=10&t=3351

I cant really help much without knowing your setup. The only thing I can ask until I get your log is: Do you use enableExtraStateSettings on the OpenGL3Renderer? If not, please tell me if activating it changes anything.

Edit: Also keep in mind that not only Blending will be enabled by CEGUI, but also the blend func and separate blend func will be changed. If you already disable Blending via OpenGL before rendering your own stuff, then you should be good though.
CrazyEddie: "I don't like GUIs"

Socram
Just popping in
Just popping in
Posts: 4
Joined: Mon Oct 03, 2011 18:51

Re: Unexpected Transparency when adding CEGUI to openGL3

Postby Socram » Wed Sep 17, 2014 21:10

Ah I'm so sorry I missed that, it had been a long night and I missed that thread, my apologies.

Here is the essential part of the log:

17/09/2014 01:36:24 (Std) ---- Version: 0.8.4 (Build: Sep 17 2014 Debug Microsoft Windows MSVC++ Great Scott! 32 bit) ----
17/09/2014 01:36:24 (Std) ---- Renderer module is: CEGUI::OpenGL3Renderer - Official OpenGL 3.2 core based renderer module. TextureTarget support enabled via FBO OGL 3.2 core implementation. ----
17/09/2014 01:36:24 (Std) ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
17/09/2014 01:36:24 (Std) ---- Image Codec module is: SILLYImageCodec - Official SILLY based image codec ----
17/09/2014 01:36:24 (Std) ---- Scripting module is: None ----

In addition here is a pastebin of the entire thing, if you need to see it: http://pastebin.com/gLdAiYWS

After calling enableExtraStateSettings the window now looks like this http://i.imgur.com/9JeMYv6.jpg. I'm not sure what this means honestly, it appears some sort of global transparency or blending issue or something, as it effects everything regardless of shader, texture, etc. I'm going to fiddle with somethings and see what I can figure out through trial and error. Thanks again for your help and insight.

Socram
Just popping in
Just popping in
Posts: 4
Joined: Mon Oct 03, 2011 18:51

Re: Unexpected Transparency when adding CEGUI to openGL3

Postby Socram » Wed Sep 17, 2014 21:53

Sorry to double post, just wanted to say I figured it out, don't know how I missed it last night, I must have been really tired haha.

It was an issue with GL_BLEND being enabled by CEGUI renderer, and not being disabled after, even with enableExtraStateSettings enabled. To solve the issue I call glDisable(GL_BLEND) after the renderAllGUIContexts call, and I am not using enableExtraStateSettings and everything appears to be fine. Thanks for your time.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Unexpected Transparency when adding CEGUI to openGL3

Postby Ident » Thu Sep 18, 2014 06:46

Btw., you can use the code tags for posting the full log.

You are correct, neither the extra states nor the endRendering functions of OpenGL- and OpenGL3Renderer clean this up. Would you expect this to happen? I think it might be doable to add certain things to the extraStates function, like setting all changed states back to default. Of course, a user would still have to set them to their liking afterwards (which is redundant) but the extraStates function doesnt aim for giving the best performance. The best performance is reached if you only change states where necessary. We could of course also do a glGet but that would be quite a big performance impact. I would prefer not to. but then again, if it is just the extraStates function that is affected..
CrazyEddie: "I don't like GUIs"

Socram
Just popping in
Just popping in
Posts: 4
Joined: Mon Oct 03, 2011 18:51

Re: Unexpected Transparency when adding CEGUI to openGL3

Postby Socram » Thu Sep 18, 2014 14:27

No I don't think the issue I had should suggest any changes need to be made to the renderer or extraStates functionality, I just wanted to post exactly what went down for any future CEGUI users who may have this issue. If anything, perhaps a note could be added somewhere in the beginner documentation (unless there already is and I missed it) that explicitly states for newbies like me that the CEGUI draw call sets certain states (and perhaps a list of what those states are) and that they will need to be changed back after the call if your particular setup is affected by them.

Honestly I should have just gotten some sleep and looked at the issue with a rested mind because this should have been one of the first things I tried, but I'm on a bit of a time crunch for this project so I wanted to get some insight as soon as possible. Thanks a lot for your time, I'm sorry if this felt like a non-issue.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Unexpected Transparency when adding CEGUI to openGL3

Postby Ident » Thu Sep 18, 2014 18:13

Socram wrote:No I don't think the issue I had should suggest any changes need to be made to the renderer or extraStates functionality, I just wanted to post exactly what went down for any future CEGUI users who may have this issue. If anything, perhaps a note could be added somewhere in the beginner documentation (unless there already is and I missed it) that explicitly states for newbies like me that the CEGUI draw call sets certain states (and perhaps a list of what those states are) and that they will need to be changed back after the call if your particular setup is affected by them.

Honestly I should have just gotten some sleep and looked at the issue with a rested mind because this should have been one of the first things I tried, but I'm on a bit of a time crunch for this project so I wanted to get some insight as soon as possible. Thanks a lot for your time, I'm sorry if this felt like a non-issue.

I added a mantis bug report:
http://cegui.org.uk/mantis/view.php?id=1053

It is likely we will change large parts of the docu for 1.0 before its release. I am not sure about v0-8 though.
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 14 guests