Sweet Spot for # of vertices in Vertex Buffer vs. # of instances
Members - Reputation: 103
Posted 26 November 2012 - 10:33 AM
GDNet+ - Reputation: 1813
Posted 27 November 2012 - 01:37 AM
In my experience drawing less than 1000 unique vertices: you're trashing GPU performance, even on ultra-low-end due to CPU being too busy dispatching.
That said, if all your models are static and/or guaranteed to be relatively coherent, pre-transform them and slap them in a single draw call (and therefore buffer), as long as you meet the required memory budget.
For your specific example however, instancing is absolutely necessary, and I would not really worry about it.
Moderators - Reputation: 14262
Members - Reputation: 4739
Posted 27 November 2012 - 04:51 AM
But this does not consider the arrangement of objects in batches or instancing, at least it should be clear that a single render call for 2 tris is sub-optimal.
My game: Gnoblins
Developer journal about Gnoblins
Small goodies: Simple alpha transparency in deferred shader
GDNet+ - Reputation: 2601
Posted 27 November 2012 - 06:02 AM
Depending on what else you are rendering in the scene, it may even be that the optimal mix of vertices vs. instances could change depending on where you are within the scene... For example, if you are bound elsewhere in the pipeline, then you should go with Hodgeman's tip - save memory where you can. However, if you are bound at vertex assembly (which is very unlikely!) then you would have to profile and see what combo works best for you.
I hope that helps!
Check out our (now available) D3D11 book: Practical Rendering and Computation with Direct3D 11
Check out my Direct3D 11 engine on CodePlex: Hieroglyph 3
Check out our free online D3D10 book: Programming Vertex, Geometry, and Pixel Shaders
Lunar Rift :: Dual-Paraboloid Mapping Article :: Parallax Occlusion Mapping Article :: Fast Silhouettes Article