Unity offers a second batching mechanism through Static Batching. This batching feature is similar to Dynamic Batching in a couple of ways, such as which objects are batched is determined at runtime based on what's visible to the Camera, and the contents of these batches will vary from frame to frame. However, there is one very important difference: it only works on objects that are marked Static
, hence the name Static Batching.
The Static Batching system has its own set of requirements:
- As the name implies, the meshes must be flagged as
Static
(specifically,Batching Static
) - Additional memory must be set aside for each mesh being statically batched
- There is an upper limit on the number of vertices that can be combined in a static batch that varies per Graphics API and platform, which is around 32k-64k vertices (check out the documentation/aforementioned blog post for specifics)
- The mesh instances can come from any source mesh, but they must share the same Material reference
Let...