SFTtech/openage

Batch Rendering

Opened this issue · 0 comments

Batch rendering describes the process of drawing multiple render objects in a single draw call. An efficient implementation could save us a lot of draw calls and thus rendering time. For every batch, we want to keep the amount of texture bindings at uniform updates minimum. Therefore, the render objects in a batch should be similar, e.g. by sharing uniform values.

The big question for batch rendering is how we group render objects into batches. The renderer currently has no way of (automatically) knowing how render objects are related and which of them could be organized into a batch. There should be a mechanism to either assign render objects to a batch manually or automatically create batches on-the-fly. A BatchManager could keep track of created batches.

As a start, we could try to group render objects in the level 2 renderer that share a common set of animations (e.g. animations used for the same unit). The group is consolidated into a single batch renderable that is then passed to the level 1 renderer and drawn as a single object.