Rendering custom opengl-windows.
Posted: Thu May 07, 2009 07:49
I'm looking for a way to render 3D-graphics within the gui. Creating a CEGUI::Window that renders OpenGL graphics within the gui. Since this seems like something pretty standard I'm a bit confused that I can't find an easy way to do this. I have only found one solution and my question is therefore, is there an easier way?
My idea is this.
Create a custom renderer that has a method for rendering all graphics drawn by the gui so far. My custom 3D-CEGUI::Window will call this from Window::drawSelf and then render its own graphics using a viewport ontop of the underlaying prerendered graphics. Then the rest of the gui windows will continue rendering ontop of this window. This approach requires that the gui renders its components from back to front. I assume this is a fixed design choice since alpha-blending will be hard otherwise.
The custom renderer will not use the zbuffer for layering the gui-graphics, instead it will use rendering order. Is this safe?
I guess i could just render all grapthics onto a texture and insert it into the standard opengl-renderer but I'm afraid this will hit performance.
Surely others have done this before my questing is just how did you do it?
My idea is this.
Create a custom renderer that has a method for rendering all graphics drawn by the gui so far. My custom 3D-CEGUI::Window will call this from Window::drawSelf and then render its own graphics using a viewport ontop of the underlaying prerendered graphics. Then the rest of the gui windows will continue rendering ontop of this window. This approach requires that the gui renders its components from back to front. I assume this is a fixed design choice since alpha-blending will be hard otherwise.
The custom renderer will not use the zbuffer for layering the gui-graphics, instead it will use rendering order. Is this safe?
I guess i could just render all grapthics onto a texture and insert it into the standard opengl-renderer but I'm afraid this will hit performance.
Surely others have done this before my questing is just how did you do it?