Unity 5 to Unity 2024 android performance tips

Hello to unity mobile game developers

I have worked on mobile games about 2 years. These are my performance experiences on unity 5 and mobile devices:
My main target is Lenovo A3300 with mali400 GPU

[Download all in one documentation]( Unity 5 to Unity 2024 android performance tips page-3#post-6991658)

  1. You can change unity height map resolution to reduce terrain triangles(note: after changing height map resolution, your created height map will be lose)

  2. Unity default sky box uses IBL lighting shader. you need avoid unity default skybox for mobile devices. Its drop around 20 fps on mobile devices. Replace default sky box with new one and change Ambient Source to Color.

3.One of the easier ways to achieve high frame rates is that reduce screen resolution: My best choice for low end devices is 800x450(16:9) or 900x506 (16:9)
2829108--206103--3 (1).jpg

4.Fastest shader for mobiles is Mobile->Vertex Lit shader that reduce draw calls and calculate lighting on Vertex’s instead of Pixels.

  1. For particles you can easily reduce max particle counts and set particle size to larger value for same results

  2. You can optimize scripts with this function
    2829108--206105--7 (1).jpg

  3. Occlusion culling is not suitable for mobiles. you can use this best solution for mobile devices without problem:
    Unity Asset Store - The Best Assets for Game Making

15 Likes

8.Child all static game objects to an empty game object (called “Scene”)and set its as static for static batching and reduce draw calls
Unity Manual Link

2829110--206106--8.jpg

9.Best performance and good quality settings for low end android devices


Best performance and good quality settings for mid-high end android devices

2 Likes
  1. Set your terrain shader to Legacy Diffuse in terrain settings

Good tips, so what is wrong with occlusion culling? I read that occlusion culling is good for mobile? According to our profiler, “culling” is taking like, 30% of our CPU in the profiler! Any idea? Check our post here https://forum.unity3d.com/threads/android-culling-performance.437749/

No. OC is not good for mobile at all. It makes a lot of lags on Low-End mobiles.
I suggested that you can use Per-Layer Camera Clipping Instead of OC. I’ve tested it already. It is the best solution for culling on mobiles. You don’t need to cull terrain along with other game objects. Its also reduce draw calls.
My test on the big scene:

2829774--206166--Untitled (1).jpg

3 Likes
  1. Some devices like Xperia Z1 has good GPU chip. but when you play some games like asphalt 8, these games run slowly. Its because Z1 native resolution is 1080p and 1080p is very heavy even for PS4. You can set your default resolution to 720p and run your game with solid 60 fps even with a lots of effects and heavy shaders.

Not much difference between 1080 and 720 on 6 inch screen.

1 Like

How do you do custom resolutions, for example half res, on every different screen size?

Thanks!

You can read this in first post
it is simple:


These is 16:9 resolutions list:
1980x1920
1600x900
1280x720
900x506
800x450
700x394
640x360

Reducing resolution is the best solution to run games smoothly on every devices. you can run a game with 3 images effects with 640x360 res on low end devices.
I’m added resolution setting to my games settings menu for support to every devices. Players can turn on image effects and reduce resolution or vice versa

You need add this codes to your main camera on the scene. I set main menu resolution to 1280x720 and game scene resolution according to selected on settings menu.
You can see Xbox one is 50% less powerful than ps4, but with lower resolution it can run games smoother than ps4!!!

2 Likes

hi aliyeredon2
thanks for the tip they re really usefull, especially for low end mobile, i tryed Per-Layer Camera Clipping it kind of work
but for some reason all the mesh that has collision mesh component lose their collision . any idea how to fix that?
cheers

ah nevermind i find my problem, when creating a new layer i had to enable physic in the physic manager.
cheers

2 Likes

I’ve found the old M2H Culling free script package works well for mobile platforms. It also works in Unity 5 as well as the 4.xx series. I’ve used it on several mobile client projects and it’s always helped.

4 Likes
  1. You can simply bake normal map and occlusion map into diffuse texture with photo shop. Its similar to shader code in runtime(multiply occlusion texture to diffuse texture)
    Watch tutorial
    Download free rocks:Link

Compare result:
2832500--206477--www.GIFCreator.me_pI53nV.gif
2832500--206478--www.GIFCreator.me_EPxe9e.gif

5 Likes

Heres a great video that helped me a lot!

Especially when you import your models disable the Read/Write toggle
Also when theyre not needed set normals & tangents to none

I gained about 15-20 fps just from this

2832692--206497--objects.png

5 Likes

I should test it
Thank you

No problem :slight_smile: let me know if it works, I went from a pretty unplayable game on low end devices (I am using Xperia E3 for testing) to smooth game play. Was really happy!

I’ve tested it.Nothing has changed. I’ve tested on Unity 4&5.
tested on LenovoA 3500 with Mali400 gpu…

1 Like
  1. Terrain optimization

New test with Per-Layer Camera Clipping

3 Likes

Nice tips! shall use these in my projects. :slight_smile:

I love 60 fps games
My last game tests:

Lenovo A3500 - Mali400 MP2
Resolution : 900*506
Terrain pixel error = 200
Per-Layer camera clipping used for everythings
AmplifyColor
fps : 40-50

Xperia Z1 - Adreno 330
Resolution : 1280x720
Terrain pixel error = 200
Per-Layer camera clipping used for everything
AmplifyColor + Unity sun shaft
60 fps with 4 enemies

2 Likes

In this site you can find mobile gpus power and compare to consoles and each others
http://kyokojap.myweb.hinet.net/gpu_gflops/

For example my Mali 400 MP2 has 9 GFlops and my Xperia has 120 GFlops power.
Xbox 20
X360 240
Xbox One 1311
Xbox One S 1405

4 Likes