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
Render to Texture
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
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.
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.
Render to texture detailed
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
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
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Render to texture detailed
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 4 guests