Hi,
I posted on here a while back about rendering architecture and came away with some great information.
I am planning on implementing a render queue which collects the visible objects in the scene and sorts them based on different criteria to minimise state change etc..
The thing I am currently undecided about is: what is the best way to submit my draw calls?
(I am wanting to support both OpenGL and Vulkan)
At the moment I have two ideas for how I can handle it.
The renderable handles the rendering (i.e. It calls renderContext->BindVertexBuffer(...) etc) and setup the renderer state
Pro- Each renderable is full in control of how it renders
Con - Have to manually manage state
The renderable pushes RenderCommands (DrawMesh, DrawMeshIndexed etc) into a CommandBuffer that gets executed by the RenderBacked at the end of the frame
Pro - Stateless
Con - Seems more difficult to extend with new features
Pro/Con - The front end only has a subset of rendering capabilities
There are more pros / cons for each, but I have listed a couple to help show my thinking..
Any one have any comments on either of these two approaches or any other approaches that are typically used?
Thanks
↧