Render to Texture

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

User avatar
exien
Just popping in
Just popping in
Posts: 7
Joined: Sat Oct 22, 2005 22:26

Render to Texture

Postby exien » Thu Feb 16, 2006 06:30

Is it possible to render a CEGUI window to texture? I could really use a system where I can render a window to a texture so I can use it in a 3D world (with Ogre) :)

Exien

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

Postby CrazyEddie » Thu Feb 16, 2006 11:24

Hi,

Yes, this is possible, since the CEGUI 'overlay' (it's not strictly an overlay, but that name will suffice here, as we'll see) is, if I recall, basically rendererd to all viewports with overlays enabled. So to achieve what you want you'd basically disable overlays on the main view and enable them on the one for your RenderTexture.

However, if you want something more selective, like one window gets sent to a texture and other windows appear on the main display, then things get a lot more complex, and depending on exactly what you need, you may have to tweak the OgreCEGUIRenderer somewhat.

HTH

CE.

csiri
Just popping in
Just popping in
Posts: 1
Joined: Thu Feb 23, 2006 08:18

Render to texture detailed

Postby csiri » Thu Feb 23, 2006 09:43

Hi,

I'm currently working on a project and I need to render different windows (FrameWindows with all their children) into different textures. Could you give me more hints or more preferably sample source code on how to achieve this?
Thanks a lot.

Csiri

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

Re: Render to texture detailed

Postby CrazyEddie » Mon Feb 27, 2006 10:13

csiri wrote:I need to render different windows (FrameWindows with all their children) into different textures. Could you give me more hints or more preferably sample source code on how to achieve this?


First of all you will need to modify the Renderer that you're using in such a way that you can specify a target texture for some given rendering.

You will then need to modify System::renderGUI in such a way that instead of just rendering a single window (that being the active 'sheet'), it actually maintains a list of windows to be rendered and the target textures for them. You would then iterate over this list, calling into the Renderer to set the target texture, and then getting the window to render itself.

There is no example source code showing this, since nobody has done it yet (as far as I know).

Hope this gives you some clues ;)

CE.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 3 guests