Render Above AND Below the overlay layer...

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

zuur
Not too shy to talk
Not too shy to talk
Posts: 31
Joined: Tue Apr 01, 2008 21:17

Render Above AND Below the overlay layer...

Postby zuur » Thu Aug 06, 2009 02:08

Hi there,

I have an Ogre application using CEGUI and am currently using the OgreCEGUIRenderer to render the gui after the Ogre::RENDER_QUEUE_OVERLAY, which is what I want for the gui in general.

I'm also using CEGUI elements to render labels on top of objects in the scene - CEGUI gives me some nice functionality here to design the labels the way I want, and it's all working nicely, except the labels *must* be rendered before the overlay layer...

My initial thought was to create two OgreCEGUIRenderer's, setting the second one to render under the overlay layer, and just use the second one for rendering my labels; having looked into it I see that CEGUI::WindowManager is a singleton, so when I added the label widgets I'm not sure how I'd specify which renderer to use... is it even possible to have multiple renderers? Is there a better way of doing this?

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

Re: Render Above AND Below the overlay layer...

Postby CrazyEddie » Thu Aug 06, 2009 08:48

Quite an interesting topic, and something that's still not going to be easy in the 0.7.0 version (perhaps harder!). You don't need two renderer objects to do this, I guess the confusion comes from the fact we automate part of the rendering process for Ogre - but this does not preclude you from disabling that and handling the rendering yourself.

Largely it depends on how those unit labels are composed - meaning are they windows attached to a 'root' window of some kind, or do you manage their rendering more directly? If they're on a root window of some kind, you may be able to setGUISheet with the 'labels' sheet, add a render queue listener to the appropriate place and have it call CEGUI::System::renderGUI (this draws the labels), then set a different root window with another call to setGUISheet and have another listener (or the standard CEGUI one) to call the render function again for the main GUI layer.

Having said this, I think mods to the renderer module should be made in order to allow >1 set of geometry to be stored, otherwise I think each render 'pass' would wipe out the previous cached data and kill performance (not 100% sure on this point since I don't have that code to hand).

So to conclude, I think it's almost certainly possible, but you'll likely have to play around with some modifications to get a 'decent' solution.

CE.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 5 guests