CEGUI messing with my textures

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

MrDoom
Just popping in
Just popping in
Posts: 12
Joined: Sun May 04, 2008 00:24

CEGUI messing with my textures

Postby MrDoom » Fri May 09, 2008 20:04

It seems that when I render CEGUI, the textures on my terrain no longer render.

Without CEGUI:
Image

With CEGUI:
Image

The only difference between those two screenshots is that I am running a call to render CEGUI after I have rendered everything else in my scene and before I call EndScene and Present on D3D. Everything else is the same.

Anyone know what might cause this?

EDIT
It also seems to be messing with my alpha, since when the GUI is rendering, I can see through my terrain like it's partially transparent.

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

Postby CrazyEddie » Sat May 10, 2008 08:24

For performance reasons we do not save and restore the D3D state - so after rendering CEGUI the render states will be in whatever state the CEGUI renderer left them in. If restoring individual states is an issue, you may need to make the appropriate calls to record the D3D state before rendering CEGUI, then restore those states after rendering CEGUI. I can't remember off what those D3D interface names are called, but I know they exist :)

CE.

MrDoom
Just popping in
Just popping in
Posts: 12
Joined: Sun May 04, 2008 00:24

Postby MrDoom » Sat May 10, 2008 13:56

Yeah, you can make a State Block. This works now:

Code: Select all

// Get the device's current states.
LPDIRECT3DSTATEBLOCK9 sb = NULL;
d3dDevice9->CreateStateBlock(D3DSBT_ALL, &sb);

// Render the GUI.
CEGUI::System::getSingletonPtr()->renderGUI();

// Clean anything that CEGUI might have messed with.
if(sb)
{
   sb->Apply();
   sb->Release();
}


Return to “Help”

Who is online

Users browsing this forum: No registered users and 18 guests