A draw call is the act of submitting geometry to the GPU for rendering. There is a strong correlation between the number of draw calls used to render a scene and the overall scene performance.
Draw calls are not directly controlled by the content creator, but various content creation techniques and detail settings can directly or indirectly affect the number of draw calls required.
The data required to perform a draw call is known as a render chunk. This can be though of as the "noun form" (where draw calls are the "verb form") although there is not a strict 1:1 correlation.
Draw calls require cpu time from both the application and the driver, and require some amount of setup time from the GPU before rendering can occur. This overhead can be significant and is effectively wasted time- no polygons are rendered. For this reason, it is important to minimize the number of draw calls required to render a given amount of geometry (or conversely, to maximize the amount of work performed by any given draw call). A single draw call may render up to 65k vertices (before hardware instancing) and the closer that we come to that number, the lower the percentage of overhead. That doesn't mean that the vertex count and polygon count has no effect on performance, but rather that small draw calls are far more expensive than their counts would imply.
Mitigating Draw Call Overhead
There are a variety of techniques used internally by E2 to attempt to mitigate the draw call overhead:
- Mesh stitching and hardware instancing, where applicable, each help collapse a large number of draw calls into a single draw call.
- Individual draw calls which share a single material may be grouped together to reduce state changes.
At the end of the day however, E2 can only work with the data that it is given. It is important to build efficient content that does not waste draw calls. A significant portion of this burden is on creators of mesh assets, however route builders should also be aware of the implications of choices that they make.
Techniques that can be used by mesh creators to minimize overhead include:
- Reducing the number of materials in used in each model. Most assets require only a single material. Large high-detail assets may require a small handful of materials, but should reduce to a single material at lower LODs.
- Creating the asset in such a way that it may use mesh stitching, at least on lower LODs.
- Using a texture atlas to allow multiple assets to be stitched into a single draw call.