Search Unity

UI performance issue in Android

Discussion in 'UGUI & TextMesh Pro' started by mariosgakuto, Oct 8, 2019.

  1. mariosgakuto

    mariosgakuto

    Joined:
    Oct 18, 2015
    Posts:
    14
    Hello,

    I am deep in the development of an AR Android game, where I utlize a lot of world space canvases.
    Interactable objects in my scene generally have a world space canvas each, that is displayed when they are looked at at and show information (imagine items in Borderlands 2). They also billboard to look at the camera.

    Profilling in Android (with Development Build and attached Profiler) gives the below results:

    profilling.JPG

    This is one of the worst frames (it usually isn't that bad) and is probably heavily influenced by the attached profiler. However, it makes me think that it is likely an issue with the multitude of world space UI floating around.

    For the billboarding canvases, I have at worst 5 canvases looking at the camera and billboarding. They each have 2 background images and some text.

    The scene has also a few static world space UI elements that don't billboard or move, but text on them might change.

    Render.TransparentGeometry and Render.OpaqueGeometry are usually the most expensive calls in most frames.

    Now for the real questions: Is there any real performance consideration to take into account when using many world space canvas? I have 1) Disabled RaycastTarget from Image and Text components and 2) Removed GraphicsRaycaster component from all canvases.

    Also, can someone explain the meaning of Canvas.RenderSubBatch and Renderforward.RenderLoopJob?

    Finally, if anyone can see any obvious performance problem with using world space canvases, by all means shed some light! My test device is a Google Nexus 6P so it's not THAT old but the frame drop is insane sometimes. While the game is starting, frame rate is just normal, 28-30 fps. then as the game progresses it massively drops, 8-12fps, especially while the game updates some UI.

    Any help appreciated!
     
  2. livingtarget

    livingtarget

    Joined:
    Apr 21, 2015
    Posts:
    83
    Try and use deep profiling to find exactly the cause as sometimes the issue is something completely different. Just remember deep profiling is a bit slower.

    Secondly make sure to check this out for performance tips: https://create.unity3d.com/Unity-UI-optimization-tips

    Especially step 3:
    If you leave the Event Camera field blank on a World Space Canvas, this does not mean that your Canvas will not receive Events. Instead, it uses the game’s main Camera. To determine which Camera is the main Camera, it accesses the Camera.main property


    Make sure to set the event camera manually or in code.
     
    mariosgakuto likes this.