Lag on mobile phone

Hy, I’m new in game developing, right now I make a 3d game with my friend and I have a issue, I use low poly buildings and nature pack, the map is not to charged, with nothing in scene, just mesh terrain, profiler show 40k tiers, is that normal?

Thanks

Sorry for my english
:v:

How did you come to the conclusion that you have lag? Is your fps low? How many set passes do you have?

1 Like

With profiler on my phone (huawei p20 lite) on camera.render I have about 15-20 fps, the game feel a bit lagy

P. S: So I have 30 Setpass, draw calls 140, tries 70k,verts 86k

I have no idea how you got the draw call number, since Unity no longer shows it anywhere. If by draw calls you meant batches then it’s really bad. Are you using static\dynamic batching? (Unity - Manual: Draw call batching) If you do, try making it more efficient by recycling materials.

Your triangle and vertex count is ok. In my current development I have around 40-60k tris in a scene, and it runs fine at 60 fps on Galaxy Core 2, so Unity can output that many triangles and not choke the gpu.

You should probably work on reducing your setpass count. 30 is a bit high in my opinion. From what I’ve seen 12-14 passes is a healthy number for mobile (but I test on a 2014 device, so maybe my numbers are outdated).

What shaders are you using? Mobile devices don’t like rendering realtime shadows, so try to avoid them if you can. Dynamic lighting tends to inflate setpasses, so maybe your high setpass count is caused by that.

Also if you can post some of your profiling results it would be easier to help you. Maybe the profiler shows that you are massively taxing your CPU with inefficient scripts or physics.

1 Like

I use baked light mode, yes I use both them static\dynamic batching.
Is my first 3D game, with 2D game it’s worked everything fine:)

Right know I created just the map, I don’t use script right now


Well, you were right about the batch count.

I would start by investigating why the Gfx.PresentFrame is taking 80 ms. Is it related to device overheating? If you target GLES 2 only does it improve? Take a look at this SO question for a pretty good list of things to check: optimization - Unity profiler Device.present - Stack Overflow

Then I would check why the batch count is so high. 100+ batches is an indication that batching just doesn’t work at all. That, and the amount of batched objects in the stats is zero, so something must either be turned off in the settings, or something breaks batching completely.

Also try experimenting with removing parts of the map to see how this affects performance.

1 Like

So I figured out why the batches is so high, I implemented a minimap , I never thinked this can be the problem, right now most of the numbers is decreased, but my fps is around 20, I will search more what can be the problem, I will come back with another porifler screenshot

Use frame debugger to find out whats actually being drawn.

Also, use mobile shaders if you do use standard ones, or implement your own lightweight ones.

1 Like

Here is the new results :slight_smile: the game is running much much better, minimap disabled, some trees deleted, terrain optimized and few 3D models deleated :slight_smile:

Tips for what to pay attention ?

thanks guys


I suggest you experiment with enabling multithreaded rendering and dynamic batching in the settings. See if it improves performance.

Also just in case you missed it, you have to check the static checkbox in the gameobject settings for static batching to work. So if you have any objects that don’t move, make sure they are marked such.

1 Like

A mid-end device, how many tiers can run? In what range I need to stay ?

There you go