So, if I understand this properly the engine has a feature to use 1 draw call for all copies of one mesh, right? I try to use “stat scenerendering” to see how many draw calls I spend. There’re many lines but I guess the “Mesh draw calls” shows me the number I want. Right now it’s 300-600 draw calls but I have only 3 static meshes in my scene plus around 100 copies of them and a few BSP meshes.
So does that feature works by default or I should turn it on somewhere? I have 5-6 BSP cylinders with 64 sides each. May the engine count each side as one draw call?
Is there an easy way? A checkbox or something? I cant even code a "Hello world’ =\ I just want to reduce my scene draw calls, i thought instancing feature is implemented in the editor.
The engine does not automatically issue one draw call for many components using the same mesh, however components using the same mesh and material do get reduced state setup overhead during rendering. Instancing is the hardware feature that allows many meshes with one draw call, and can only be done with an InstancedStaticMeshComponent. The reason we can’t use this all the time, and that you have to set it up manually, is that quite a few of the per-object features that normal components support don’t work as a InstancedStaticMeshComponent. For example - lightmaps, and most of the settings under PrimitiveComponent / Rendering. Some of these are due to limitations of instancing and some we just haven’t implemented yet.
Also, hardware instancing actually increases GPU cost, because all the per-object work has been moved to the vertex shader. So if you have a lot of high poly meshes, instancing will reduce the rendering thread (CPU cost) but increase the GPU cost to render them.
In summary, components using the same mesh and material will render faster automatically, but with the same number of draw calls as if they used different materials.