When bringing large scenes into real-time environments a large amount of manual work is demanded for the material setup and application to the individual objects. This is not only a large amount of manual work but also creates a large number of draw calls.
https://www.youtube.com/watch?v=h3s8fvCKqbg
A Draw call consists of the CPU instructing the graphics card to draw something on the screen. Every time the graphics card is instructed to draw something on the screen, an overhead consisting of state changes is generated on the GPU.
A single draw call may only take a fraction of the overall render time, but having too many draw calls will add up and can result in idle times where the graphics card is waiting to be instructed to start a new draw call doing nothing in between.
Therefore the ideal situation is to get as many state changes as possible and batch them together into a single draw call to reduce the points where the CPU and graphics card have to synchronize.
Material Merging
allows users to take one or more objects with multiple materials and merge all materials together into a single one. This process creates a single new material with baked textures that can be used to recreate the materials in any renderer. Existing input textures are baked together into a single texture atlas with UVs being repacked to optimize the UV layout. This allows for drastic draw call reductions.
In this case, the example scene makes up over 83k polygons and 212 draw calls.
Material Merging
the city scene reduces the draw call count from the original 212 to 98 draw calls due to the individual 98 objects sharing the single new material.
The following is an overview of the mesh operation's settings:
The different importance metrics will measure the specific attribute of the faces/meshes and will increase or decrease the size of the geometry accordingly in the resulting texture atlas.
To take the draw call reduction even further we can utilize InstaLOD's Mesh Toolkit (MTK).
The Mesh Toolkit
is equipped with a large number of features to prepare and fix meshes such as Remove Degenerate Faces
, Conform Normals
, Fill Holes
and many more.
In this case, the feature Combine Meshes
is used to combine all 98 objects into a single one, ending up with one object using one material, resulting in a single draw call.
When combining this workflow with the proper use of mesh operations, this city block with 212 draw calls and 83k polygons can be reduced to less than 800 polygons using a single draw call.
The final scene was created using the following operations:
For more information on Imposterizing
please read this article on Imposters.