- Home /
The question is answered, right answer was accepted
How many triangles/polygons is a draw call worth?
Let me explain, because my title probably sounds ... illogical. There comes a time to find a balance between polygon count and drawcalls. My target is PC, and hopefully Xbox One, PS4. So, if we consider drawcalls, polygons, and culling(both frustrum and occlusion, how many polygons are worth being combined before its worth breaking up a model for occlusion, thus increasing drawcalls at times, but reducing polycount at other times? For the sake of simplicity, lets say half the model is visible for half the time, and uses one texture. Lets also say, CPU and memory performance are balanced either way. Disregaurd batching. Just looking for a rough idea.
Arbitrary Example: 30k model, 1 material, 1 piece, is 5 drawcalls. In 2 pieces is 10 drawcalls 30k polygons, or 5calls and 15k polygons if culled.
Which is more efficient if half oft he model is visible half of the time, but the other half of the time, all of it is visible?
Again, just looking for a rough idea of how many polygons saved a drawcall should be valued as.
Its hard to judge as drawcalls will depend on a number of things, including number of textures in the material, shader passes and lighting etc.
You will find that that 5 draw call model suddenly becomes more when you run under that extra point light.
I find that in a fairly detailed and averagely populated scene on Android with varied lighting, turning the character by just a few degrees can make it change drastically from 200 to 400 draw calls, unoptimised of course.
I'm under the impression that mesh combining saves on $$anonymous$$aterials and VBOs... I could be completely off there. This allows batching which will save calls.
So clever devices like Texture Atlassing can really help in this department as you can share a material but use different parts of the texture for different models, allowing batching saving on calls.
Xbox and PS4 would be quite pre-set but targetting for PC you must assume worst case scenario in order to make the $$anonymous$$imum specs attainable for as large an audience as viable.
Let the GPU do the work. Drawcalls are CPU based, I think.
Answer by MakeCodeNow · May 29, 2014 at 01:28 AM
Draw calls are primarily a CPU side cost. Vertices are primarily a GPU side cost (unless you are doing things like CPU skinning). Most modern games are more likely to be CPU bound than GPU bound, especially the platforms you have in mind. In the rare case that you are GPU bound it's probably pixel processing, not vertex processing, that's the limit.
TL;DL, breaking meshes to decrease GPU vertex work is almost always going to be a loss.
In general, split objects up into more draw calls when it makes sense. If you need two different materials, then ok. If this is a chair and that's a potted plant, then ok. But don't split the chair or plant (or wall or rock formation or whatever) up just to try to save the GPU some work.
Well, im shooting for around 600k - 800k polygons visible. And thats with LODs in action. And possibly more polys if it performs well enough. So, what im getting at is, in a case where you have the RA$$anonymous$$/VRA$$anonymous$$ and CPU both perfor$$anonymous$$g at significant levels, whats the value of a drawcall? 1k poly saved? 5k? 10k? 20k? 50k? I would guess starting at 10k is worth it in this case, but I really dont know. Im hoping someones worked on a large game and has a general idea.
I'm a former AAA dev. 800k polys per frame would be doable on PS360 let alone on your target hardware.
In general, it's dangerous to speculatively optimize. The only way to know what matters is to take the time to profile your game on your target hardware. This is doubly true when speculative optimization makes more work for you. Taking the time to split meshes based on poly budgets will take extra time and may or may not have any benefit.
Also, Unity has an internal limit of 65k verts per object, so you'll have to split at that granularity or Unity will do it for you.
Theres gotta be a general range of worth in a large game, but I suppose I better make a test scene.