Setup guide
30 | Best Practices: Mobile | Unity
Reducing Draw Calls
Keep the total number of draw calls to a minimum. A conservative target would be less than 100 draw calls per
frame.
Unity provides several built-in features to help reduce draw calls such as batching and culling.
Draw Call Batching
Unity attempts to combine objects at runtime and draw them in a single draw call. This helps reduce overhead
on the CPU. There are two types of draw call batching: Static and Dynamic.
Static batching is used for objects that will not move, rotate or scale, and must be set explicitly per object. To
mark an object static, select the Static checkbox in the object Inspector.
Note: Static batching is not available for Unity Free.
Dynamic batching is used for moving objects and is applied automatically when objects meet certain criteria,
such as sharing the same material, not using real-time shadows, or not using multipass shaders. More
information on dynamic batching criteria may be found here: https://docs.unity3d.com/Documentation/Manual/
DrawCallBatching.html
Culling
Unity offers the ability to set manual per-layer culling distances on the camera via Per-Layer Cull Distance.
This may be useful for culling small objects that do not contribute to the scene when viewed from a given
distance. More information about how to set up culling distances may be found here: https://docs.unity3d.com/
Documentation/ScriptReference/Camera-layerCullDistances.html.
Unity also has an integrated Occlusion Culling system. The advice to early VR titles is to favor modest “scenes”
instead of “open worlds,” and Occlusion Culling may be overkill for modest scenes. More information about the
Occlusion Culling system can be found here: http://blogs.unity3d.com/2013/12/02/occlusion-culling-in-unity-4-3-
the-basics/.
Reducing Memory Bandwidth
•
Texture Compression: Texture compression offers a significant performance benefit. Favor ETC2
compressed texture formats.
•
Texture Mipmaps: Always use mipmaps for in-game textures. Fortunately, Unity automatically generates
mipmaps for textures on import. To see the available mipmapping options, switch Texture Type to Advanced
in the texture inspector.
•
Texture Filtering: Trilinear filtering is often a good idea for VR. It does have a performance cost, but it is worth
it. Anisotropic filtering may be used as well, but keep it to a single anisotropic texture lookup per fragment.
•
Texture Sizes: Favor texture detail over geometric detail, e.g., use high-resolution textures over more
triangles. We have a lot of texture memory, and it is pretty much free from a performance standpoint. That
said, textures from the Asset Store often come at resolutions which are wasteful for mobile. You can often
reduce the size of these textures with no appreciable difference.
•
Framebuffer Format: Most scenes should be built to work with a 16 bit depth buffer resolution. Additionally, if
your world is mostly pre-lit to compressed textures, a 16 bit color buffer may be used.
•
Screen Resolution: Setting Screen.Resolution to a lower resolution may provide a sizeable speedup for most
Unity apps.










