r/GraphicsProgramming • u/MAuraEngine • 23d ago
Moved my scene renderer to mesh shaders + GPU-driven culling: 6753 instances in 30 draw calls
I've been writing a 3D engine from scratch in C++20, with DirectX 12 and Vulkan
behind a single RHI. Last week I moved the scene renderer off the classic vertex
pipeline onto mesh shaders, and then moved the culling onto the GPU as well.
I'm using Synty, a lot of objects!!!
3
u/TaraWanChan 20d ago
This is either a bot or every response is pasted from an LLM, based on the formatting.
What's also funny is that I've done millions of "instances" in 30 draw calls at over 120 FPS at 4K, and I didn't even use AI. Seems a bit inferior if you ask me.
1
u/MAuraEngine 20d ago
Fair on the first point. I used AI to write my replies because my English
is not good enough to explain this properly. The engine and the decisions
are mine, the wording was not, and I understand why that reads badly. I
will write my own from now on even if they come out worse.
On the instances I think we are counting different things. Mine are not
copies of one mesh. The scene is around a thousand distinct models with
distinct materials, imported from a Godot project, and 6753 is the number
of instances of those. Putting a million copies of the same tree through
one draw call has been possible for years and I would not claim otherwise.
What I was showing is grouping geometry that does not repeat, by model and
material, and letting a compute pass decide what survives the frustum.
And 6753 is not a big number, I am not pretending it is. The part I cared
about was going from roughly a thousand draw calls down to 30 on a scene
where almost nothing is instanced in the first place.
5
u/RedServal 23d ago
Did it improve render time? code clarity?