Enable batch-rendering
Closed this issue · 1 comments
Overview
If there are RenderManager
and RenderedElement
classes, the render pipeline can use the managers to render the elements that belong to them. This can be used to do batch rendering, e.g. a PolygonRenderManager
could group PolygonRenderedElement
instances by layer and then render groups by writing all vertices and indices for the polygons into single buffers and render them in one draw-call.
The RenderManager
and RenderedElement
should also be extendable by user classes, so users have the potential to render anything the way they want to and optimize it for their specific use cases.
Engine Performance
Batch rendering should then be implemented for all out-of-the-box elements that are included in the engine: polygons, lines, textures etc.
References
The following old commit contains an rough implementation of this system:
I think rendering should be split into data classes and renderers for those classes.