Improving Performance of a Mobile Game in Unity 3D

Improving Performance of a Mobile Game in Unity 3D

by NSDG • Sep 26, 2019 • 0 Comments
212

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

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

1. 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.

2. Avoid realtime Shadows

Realtime Shadows might look cool, but they require quite alot of processing power. So it's best to bake them into Lightmaps instead.

3. 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.

4. 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 have to do so every frame which could hurt the performance instead.

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

5. Avoid using OnGUI

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

Conclusion

Hope you found these tips useful, also if you have any more optimization tips, feel free to post them in the comments.