Drawcalls
Introduction
The engine draws the things you see on the screen in batches and such a batch is called a drawcall.
The time a drawcall takes consists of two parts:
- a static overhead, that is always the same no matter how many things get drawn
- a dynamic part that depends on how many things there are to draw
One basic thing is that each model in idTech4 gets drawn once per light that hits that model. And each of these draws of the model is split into drawcalls for each material.
So if you have a model with two different materials that is hit by 3 lights, the entire model is drawn 3 times, and the engine uses 2 * 3 = 6 drawcalls to do so.
How much drawcalls are "good"?
Thsi number depends highly on the system and the performance you want to achive. In the past the limit to shoot for was about 300..500 drawcalls, but machines from today can easily handle 1000 drawcalls.
But generally spoken, the less drawcalls you have, the better.
How to reduce drawcalls of your scene
- If you are making models: Reduce the number of different materials a model uses by using a texture atlas.
- Combine multiple func_statics made from map geometry (brushes/patches) into one.
- Use the SEED system to combine multiple models in one scene.
- If you are using models, by using less different skins. (this only reduces the texture usage, not the drawcalls, unless you use the SEED system, see above, where it also reduces the number of entities and thus the drawcalls)
Note: To test drawcalls in-game use r_showPrimitives to print to console.
As a last resort you can also reduce the complexity of your scene by removing unnecessary models or replacing far-away detail brushes by decals.