Improving Performance of a Mobile Game in Unity 3D

Gaming on mobile has evolved quite a lot in recent years, from having simple 2D games to offer a full 3D experience. But despite that, it still has limited processing power, so to provide a smooth gaming experience, some considerations need to be made regarding design choices.

Below are the top 5 points to look at to improve performance on mobile devices:

Avoid transparency

Pixel overdraw is quite expensive and could drastically reduce the framerate on mobile devices. To prevent this, avoid using Transparent Shaders or basically any Shader that contains transparency (ex. Particle Shaders).

For Opaque geometry use Shaders from Mobile/ category.

Avoid Real-time Shadows

Real-time Shadows might look cool, but they require quite a lot of processing power. So it’s best to bake them into Lightmaps instead.

Use Static Batching to reduce Draw calls

Static Batching is a way to let Unity combine Static Objects together, which in turn will reduce the number of Draw calls, thus improving rendering performance.

To enable static Batching mark all the static Objects in Scene as "Batching Static" then go to Edit -> Project Settings... -> Player and make sure Static Batching is checked.

Use Dynamic Batching with Caution

Dynamic batching is somewhat controversial. On one side it lets Unity combine Dynamic Objects into fewer Objects, potentially improving performance, but on the other side, it has to do so every frame which could hurt the performance instead.

Overall it’s better to disable Dynamic Batching when targeting mobile platforms.

Avoid using OnGUI

OnGUI lets you quickly create user UI from code but it’s very slow compared to Unity’s UI Canvas, so only use it for prototyping.

Leave a Reply

Your email address will not be published. Required fields are marked *