Rendering Update


24-03-2008 17:39:21


Quads are created and added to queues. Every quad is rendered every frame, but they are organized in the QuadContainer queues to minimize batching. (that is, as many quads as possible are thrown at the renderer for each render operation) Even though the batching is minimized due to use of a texture atlas, font glyphs are rendered to their own texture. This causes another render batch whenever text is introduced.


Use texture batching to display the GUI. Multiple Widgets will be drawn into a single texture, and update it as necessary. Every frame these textures are rendered. Using RBGUI as an example, the window widget is its own texture. All child widgets create the window texture, and every frame the window is represented by 1 quad, with its corresponding texture. Each Texture will be another render operation, so in this regard batching is not minimal. The benefit of this?

1. It is easy to create a class that is used for drawing rectangles, lines, triangles, text, etc. and using this to draw a widget.
2. Incorporating the use of RenderSystem::setScissorTest function, to handle clipping.
3. The ease of maintaining and updating text functionality, related to drawing, alignment, etc.

I am still in the process of looking into this second approach, using RBGUI as a reference. That library has some cool unique widgets, and combined with QuickGUI's event system and soon-to-be skinning system, the library will be very useful.