Static Sprites

Discord Support | Forum | Email


Static Sprites is a lite tool to optimize the rendering of non-moving sprites. The improved performance means you can now render thousands of sprites on even low-end mobile devices without a hitch!


As a technical background, Unity normally dynamically batches the rendering of sprites as an optimization. Dynamic batching means it groups the geometry into similar renderable batches each frame, and this generally works pretty well for small moving geometry. However, dynamic batching is not optimal for non-moving sprites, since the CPU still does a lot of work constructing the batches each frame. If you open the Unity Profiler or Frame Stats, you can check the Dynamic Batching batched draw calls count. That is all the redundant work, since the sprites don't move.


Static batching on the other hand, is much faster as it pre-generates the batches and geometry to be rendered just once. However, Unity's static batching system only works for meshes, unfortunately. Toggling the Static checkbox on sprites does nothing.


That's where Static Sprites comes in. Simply attach this component to a game object, and any sprite that is in the hierarchy under it is statically batched on start. It does this automatically, intelligently combining sprites into singular meshes while respecting differing materials, textures, atlasing, colors, sorting orders and layers, and Flip XY direction.


Features

  • Automatically static batches non-moving sprites
  • Supports differing textures, colors, materials, atlasing, sorting layer ID, sorting order, and Flip XY
  • API to unbatch sprites as well
  • Support for exporting combined sprites to a folder outside Play mode

See Technical Details for in-depth details.


And that’s it! If you are using sprites in your game, this is an easy-win for optimization.

Increase your framerate, save battery life, and render more sprites!


Discord Support | Forum | Email