Static Geometry Batcher is a tool that generates batched meshes out of selected, individual meshes available on the scene, based on the materials they use. If some meshes share the same material(s) they can be batched. This improves rendering performance by reducing draw calls, what is particularly crucial on mobile platforms. The batcher can be used along the built-in Unity static batching mechanism.
To balance culling and the draw calls count, the tool lets the user specify the number of batched segments (along all three world axes: X, Y and Z) to be generated. The number should be specified on a per-game basis to give the best performance. This control gives you the ability to have more efficient batching mechanism that is tailored to your game, than is provided by the built-in Unity solution.
Multi-materials meshes are handled automatically.
Use it along our other tool, Texture Atlas Generator for even better performance!
Take a look at the YouTube demonstration:
- Batch Name – name of the batch to generate.
- Segments – triple defining how many segments, along each of the world axes, should be generated.
- Selection/Layer – if Selection is active, the scene’s selected game objects will be batched. If Layer is active, game objects to batch are taken into account if they are on the chosen layer.
- Generate – generates the batch(es). As many as the Segments triple indicates.
- Delete – deletes the batch under name given in Batch Name field (simply deletes game objects with names that match Batch Name).
- Original Mesh Renderers OFF – turns off the original game objects’ mesh renderers.
- Original Mesh Renderers ON – turns on the original game objects’ mesh renderers.
A test level is at StaticGeometryBatcher/Assets/BlossomGames/StaticGeometryBatcher/Examples/Levels/test.unity.
This quick tutorial will show you how to use Static Geometry Batcher step by step.
- Load the test scene under StaticGeometryBatcher/Assets/BlossomGames/StaticGeometryBatcher/Examples/Levels/test.unity.
- Open Static Geometry Batcher.
- Name the batch in the field Batch Name.
- Set the Segments triple to [2, 1, 2].
- Press Generate. The generated batches are game objects whose names start with BATCH string, are followed by Batch Name, name of the material and eventually the batch-segment index.
- Press Original Mesh Renderers OFF. This is really needed as right now there are sort of two instances of all meshes that were chosen to batch – the original ones and those being parts of the batches. By turning off the original mesh renderers only the batched ones will be rendered.