[colour='FF000000'] makes text transparent

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

roby65
Just popping in
Just popping in
Posts: 8
Joined: Fri Jan 04, 2013 11:39

[colour='FF000000'] makes text transparent

Postby roby65 » Mon Feb 04, 2013 20:48

Hi,

i was playing around with text colors, and i got this problem.
When there is a text with [colour='FF000000'] before (that is black), the text becomes transparent.
I can't find out why this problem is there, maybe i'm missing something?

Roby

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

Re: [colour='FF000000'] makes text transparent

Postby CrazyEddie » Tue Feb 05, 2013 09:03

You have hardware or a renderer module (Irrlicht?) that does not support seperate colour/alpha blend modes, which results in a 'blow-through' effect when the rendering is done to an intermediate texture and then composited to the final display. You can aleviate it by not rendering to texture first (normally achieved by disabling AutoRenderingSurface on FrameWindows), but depending on what you're doing that will either mean you can't use RenderEffects or rotation and may have a negative effect of performance too.

If you are using Irrlicht, there's not much we can do about it since they don't expose these facilities from the underlying APIs. If you're limited by your hardware (unlikely) then there is nothing that can be done ;)

CE

roby65
Just popping in
Just popping in
Posts: 8
Joined: Fri Jan 04, 2013 11:39

Re: [colour='FF000000'] makes text transparent

Postby roby65 » Wed Feb 06, 2013 01:26

CrazyEddie wrote:You have hardware or a renderer module (Irrlicht?) that does not support seperate colour/alpha blend modes, which results in a 'blow-through' effect when the rendering is done to an intermediate texture and then composited to the final display. You can aleviate it by not rendering to texture first (normally achieved by disabling AutoRenderingSurface on FrameWindows), but depending on what you're doing that will either mean you can't use RenderEffects or rotation and may have a negative effect of performance too.

If you are using Irrlicht, there's not much we can do about it since they don't expose these facilities from the underlying APIs. If you're limited by your hardware (unlikely) then there is nothing that can be done ;)

CE

I am using Directx, is there a way to fix this?
Maybe i should disable some render state?

Roby

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

Re: [colour='FF000000'] makes text transparent

Postby CrazyEddie » Wed Feb 06, 2013 09:14

Maybe you should?!

This thread has pissed me off. We are now on day two and will be going into day three, and still I'm going to have to try to tease information out of you.

Answer me this: Why don't you follow the forum guidelines and the text at the top there that you can't fail to see and provide some information so that we have some clue as to the components that you are using?

CE

roby65
Just popping in
Just popping in
Posts: 8
Joined: Fri Jan 04, 2013 11:39

Re: [colour='FF000000'] makes text transparent

Postby roby65 » Mon Feb 11, 2013 12:53

Hi,

i'm very sorry, i didn't want to piss you off.
I want to apologize, i'm really sorry.

This is the important part of CEGUI.log

Code: Select all

04/02/2013 22:10:30 (Std)    ---- Version 0.7.7 (Build: Dec 19 2012 Microsoft Windows MSVC++ Great Scott! 32 bit) ----
04/02/2013 22:10:30 (Std)    ---- Renderer module is: CEGUI::Direct3D9Renderer - Official Direct3D 9 based 2nd generation renderer module. ----
04/02/2013 22:10:30 (Std)    ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
04/02/2013 22:10:30 (Std)    ---- Image Codec module is: SILLYImageCodec - Official SILLY based image codec ----
04/02/2013 22:10:30 (Std)    ---- Scripting module is: None ----


This is the entire cegui.log:
http://pastebin.com/Kv8gWgNk

This is the cegui init:

Code: Select all

try
   {
      GUI=&CEGUI::Direct3D9Renderer::bootstrapSystem(pOriginal);

      CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider());
      rp->setResourceGroupDirectory("schemes", "vaultmp/datafiles/schemes/");
      rp->setResourceGroupDirectory("imagesets", "vaultmp/datafiles/imagesets/");
      rp->setResourceGroupDirectory("fonts", "vaultmp/datafiles/fonts/");
      rp->setResourceGroupDirectory("layouts", "vaultmp/datafiles/layouts/");
      rp->setResourceGroupDirectory("looknfeels", "vaultmp/datafiles/looknfeel/");
      rp->setResourceGroupDirectory("lua_scripts", "vaultmp/datafiles/lua_scripts/");

      CEGUI::Imageset::setDefaultResourceGroup("imagesets");
      CEGUI::Font::setDefaultResourceGroup("fonts");
      CEGUI::Scheme::setDefaultResourceGroup("schemes");
      CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
      CEGUI::WindowManager::setDefaultResourceGroup("layouts");
      CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
      CEGUI::AnimationManager::setDefaultResourceGroup("animations");

      using namespace CEGUI;
      SchemeManager::getSingleton().create("TaharezLook.scheme");
      CEGUI::System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow");
      WindowManager& winMgr = WindowManager::getSingleton();
      DefaultWindow* root = (DefaultWindow*)winMgr.createWindow("DefaultWindow", "Root");
      CEGUI::System::getSingleton().setGUISheet(root);
      wnd = (FrameWindow*)winMgr.createWindow("TaharezLook/FrameWindow", "Demo Window");
      root->addChildWindow(wnd);
      wnd->setPosition(UVector2(cegui_reldim(0.01f), cegui_reldim( 0.01f)));
      wnd->setSize(UVector2(cegui_reldim(0.35f), cegui_reldim( 0.30f)));
      wnd->setMaxSize(UVector2(cegui_reldim(1.0f), cegui_reldim( 1.0f)));
      wnd->setMinSize(UVector2(cegui_reldim(0.1f), cegui_reldim( 0.1f)));
      wnd->setText("Chat Box");

      
      CEGUI::Editbox* editb=(CEGUI::Editbox*)winMgr.createWindow("TaharezLook/Editbox", "Edit Box");
      wnd->addChildWindow(editb);
      editb->setText("");
      editb->setSize(UVector2(cegui_reldim(1.0f), cegui_reldim( 0.15f)));
      editb->setPosition(UVector2(cegui_reldim(0.0f), cegui_reldim( 0.85f)));

      CEGUI::Listbox* listb=(CEGUI::Listbox*)winMgr.createWindow("TaharezLook/Listbox", "List Box");
      wnd->addChildWindow(listb);
      listb->setText("");
      listb->setSize(UVector2(cegui_reldim(1.0f), cegui_reldim( 0.85f)));
      listb->setPosition(UVector2(cegui_reldim(0.0f), cegui_reldim( 0.0f)));

      CEGUI::MouseCursor::getSingleton().hide();
   }
   catch(CEGUI::Exception e)
   {
      MessageBoxA(0,e.getMessage().c_str(),"",0);
      exit(0);
   }


This is the draw:

Code: Select all

IDirect3DStateBlock9* pStateBlock = NULL;
      m_pIDirect3DDevice9->CreateStateBlock(D3DSBT_ALL, &pStateBlock);
      pStateBlock->Capture();
      CEGUI::System::getSingleton().renderGUI();
      pStateBlock->Apply();
      pStateBlock->Release();


Tell me if i missed something....
Again, i'm very, very sorry.

Roby

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

Re: [colour='FF000000'] makes text transparent

Postby CrazyEddie » Tue Feb 12, 2013 09:53

I don't have a definitive answer as to why you're getting the effect you're getting - I'm going to have to offer the lame answer that I think it's render state related, but I'm not sure which state or states it could be.

If you have the CEGUI samples built, do you get the same issue in them? If you do then I would suggest it's hardware or driver related. If you don't get the same issue in the samples then it's definitely something local to your own code, and so we'll be back looking at render states.

While we're on the subject of states, I will recommend that you change the code that captures and restores the states around the renderGUI call to only capture the states into an already created state block - creating and releasing that state block each frame will cause you a real performance hit.

And... while we're on the subject of state blocks, what you might try, to confirm or disprove my theory about states is this:
    - When you start your app, just after initialising the D3D device, create and capture all states into a 'defaults state block'
    - At render time:
      - capture the current states into a 'saved states block'
      - apply the 'defaults state block'
      - call renderGUI
      - appy the 'saved states block'

Note that this is not intended as a permament solution, but as a test. It basically gives CEGU the default states that it's expecting. If you still get the issue, try updating your drivers (or do that first!). What hardware are you running on and does it support seperate blend modes for colour and alpha (you can check with the d3d caps viewer I think).

Sorry I could not give you a simple fix :)

CE.

roby65
Just popping in
Just popping in
Posts: 8
Joined: Fri Jan 04, 2013 11:39

Re: [colour='FF000000'] makes text transparent

Postby roby65 » Fri Feb 15, 2013 19:21

CrazyEddie wrote:
    - When you start your app, just after initialising the D3D device, create and capture all states into a 'defaults state block'
    - At render time:
      - capture the current states into a 'saved states block'
      - apply the 'defaults state block'
      - call renderGUI
      - appy the 'saved states block'


Tried this, it works perfectly.
For me this can be the "final solution", i'm gonna benchmark if this creates problem with the fps but if not i will just leave as it is now.

Thanks you a lot
Roby


Return to “Help”

Who is online

Users browsing this forum: No registered users and 24 guests