Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Absurd vertices on android but not on the editor

Discussion in 'Editor & General Support' started by xandelee, Jun 18, 2020.

  1. xandelee

    xandelee

    Joined:
    Sep 12, 2013
    Posts:
    29
    Hello fellow unity community members.

    I am profiling my Android game on the editor and it gives me 8k tris and 16k vertices on the same scene and camera angle but when i profile it on android it is giving me 190k tris and 161k verts running on android mobile and causing extreme lag/fps drop.
    I'm searching for the problem for days when i've come across that
    I'm rendering about 1000 perfect squares, and they are giving me this absurd reading and lag only on the device.
    I'm using universal render pipeline unity version and everything is being SRP batched as i see on the frame debugger, all using same URP lit material and even when i mark them as static are not being batched as static or dynamic, only SRP.
    All of them are marked as gpu instancing and using the same material
    I've also checked the articles about optimization.
    Unity version 2019.3.14f1 and also 2019.4.0f1

    Below:
    Print of the frame debugger srp bathching
    Print of how the blocks look
    Print of the game i'm rendering on screen
    Print of the vertices on the editor
    Print of the problematic vertices on the mobile


    frame DEBU SRP.png TERRAIN BOXES.png
    Game renderer.png PC VERTICES.png MOBILE VERTICES.png
    What could be causing this?
     
    Last edited: Jun 18, 2020
  2. xandelee

    xandelee

    Joined:
    Sep 12, 2013
    Posts:
    29
    I've also disabled scripts and debugged the objects amount at android runtime to make sure that any objects werent beeing instantiated or modified, this must be a bug from unity side.

    It seems that the srp batcher besides showing that is batching on the android frame profiling is not working, its like no bathching it's being done hence the high vertices, still don't know why.
    I found that out by disabling srp bathcer on editor player.

    Edit: Reason is SRP batcher doesnt work on android don't know why.
     
    Last edited: Jun 19, 2020
  3. tobermanar

    tobermanar

    Joined:
    Aug 17, 2016
    Posts:
    9
    I'm very curious about this too. I have a similar problem with Unity 2019.3.9f1.

    From editor : 76 draw calls 2k tris and 5.1k verts
    From android : 220 draw calls 52.2k tris and 108.5k verts

    It's not only the SRP batcher because in editor even without it I'm far from 52k and 110k.

    From editor without SRP batcher : 73 draw calls 15.8k tris and 30k verts

    Edit : My project is in VR (Oculus Quest) and the main problem comes from the double rendering (each eye). Surprisingly, the mesh are not rendered by pack but individually wich change the draw calls from 76 to 220.
     
    Last edited: Sep 3, 2020
  4. xandelee

    xandelee

    Joined:
    Sep 12, 2013
    Posts:
    29
    The problem in my case was not the vertices but too many draw calls due to too many objects even tough they were extremely simple square meshes.
    By reducing the draw calls via optimizations the problem got away and it runs perfectly on older devices.
     
    Last edited: Oct 5, 2020