Dynamic GPU Instancing

Started by
2 comments, last by AxeGuywithanAxe 7 years, 9 months ago

Hey guys, I wanted to get other's insight when it comes to gpu instancing. I have a submission stage in my rendering pipeline. In this pipeline I have two options for gpu instancing. The first option is to have some type of "manager" class, that holds all instances of a certain mesh, in this method the manager would cull for each relevant view, and submit an instancing call to the render queue. The second option is to sort the render queue, then create instancing groups based on the index buffer/vertexbuffer/etc.. The benefits of the first method is that it doesn't require much logic by the rendering pipeline. The manager knows how much of each model to render, so it will just submit the commands for rendering. The second method is beneficial because it's more dynamic, but adds more complexity to the render queue , i.e instead of just sorting, you must sort.. then build "instancing groups" based on custom criteria... and then submit the commands.

Advertisement

I sort like this: http://www.socoso.com.au/tiogra/trees.html you could still render as meshes, I just pack em all for simplicity.

You'll have to specify your API target. With GL 3.3+ / D3D11 / Metal / Vulkan / D3D12 instancing is a walk in the park, it becomes very easy to render multiple instances of multiple meshes with multiple materials with just one draw call (or a few of them).

However if you're aiming to D3D9 / GLES3 style, then yeah, it needs more work.

Thank you both for your responses, yeah I'm currently targeting D3D11 and eventually D3D12.

This topic is closed to new replies.

Advertisement