Render to Texture
Posted: Thu Feb 16, 2006 06:30
by exien
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
Posted: Thu Feb 16, 2006 11:24
by CrazyEddie
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.
Render to texture detailed
Posted: Thu Feb 23, 2006 09:43
by csiri
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
Re: Render to texture detailed
Posted: Mon Feb 27, 2006 10:13
by CrazyEddie
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.