CEGUI on DirectX 11 with OGRE 14

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
lyn19417
Gnoblar
Posts: 1
Joined: Wed Apr 16, 2025 7:26 pm
x 2

CEGUI on DirectX 11 with OGRE 14

Post by lyn19417 »

Hello :)

I recently started using OGRE 14 with CEGUI for a project of mine. I encountered difficulties while incorporating CEGUI as I realized sometime after that DirectX 11 didn't support multiple viewports being cleared. (https://learn.microsoft.com/fr-fr/windo ... targetview) Often you would either get all your viewports with the wrong clear color or in the worst cases, all your viewports simply not rendering anything. Although I'm not completely understanding the way CEGUI's OgreRenderer works, it seems to me that it's very likely to be the problem as other RenderSystems like D3D9, OpenGL or Vulkan work fine.

With context aside, I spent hours (10+) to actually try to fix the CEGUI UI covering what's beneath. (in my case it was my scene content)
The method I'm going to show looks more like a hack as I'm not entirely sure what's the reason behind why it works. (if you have any insights on that, let me know!)
Also note that it's not foolproof, what I tried didn't seem to have any side-effect but it doesn't mean that there aren't any!

Without further ado, the steps are as follow: (Assuming you have a setup where you at least cloned the CEGUI source code in your project)

  1. Open the source file "YOUR CEGUI SRC\cegui\src\RendererModules\Ogre\GeometryBuffer.cpp"
  2. Locate the draw() method
  3. Comment line d_owner.setupRenderingBlendMode(d_blendMode);
  4. Comment line d_renderSystem.setScissorTest(i->clip, d_clipRect.left(), d_clipRect.top(), d_clipRect.right(), d_clipRect.bottom())
  5. Recompile the OgreRenderer

Now you should be good to go now!

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 500
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 180

Re: CEGUI on DirectX 11 with OGRE 14

Post by sercero »

And with this change the other renderers work fine too? (I mean: DirectX9, OpenGL, etc?)

If that is the case then why is that code there? :?