Search Unity

Unity UI Problem with optimizing UI elements

Discussion in 'UGUI & TextMesh Pro' started by ONS49, Dec 25, 2018.

  1. ONS49

    ONS49

    Joined:
    Mar 13, 2017
    Posts:
    8
    Hi, my application mainly consists of a large number of UI images located on the scroll view.
    When the sceen image is static, the FPS is stable high (~160). All that takes time is just an event system (~1ms).

    But when I move the scroll view, each frame of the UI motion consumes 20 ms of time, which is described in Profiler as UGUI.Rendering.UpdateBathes. This leads to drop in FPS to 60.

    In addition, I am a little confused by the number of triangles and vertices on the scene. One square UI Image without a sprite has more than 10 vertices, instead of 4. In addition, every UI elements are drawn every frame, even those there are not visible on the screen. Is this a feature of the UI or am I missing some kind of settings?

    Advise ways to optimize the application and point out my mistakes.

    Thanks in advance and sorry for my English!

     
  2. You seriously should watch this presentation about how to make performant UI (the video is timestamped to 23:38 in case it does not start there, although the beginning of the presentation is interesting as well):
     
    ONS49 and Peter77 like this.
  3. ONS49

    ONS49

    Joined:
    Mar 13, 2017
    Posts:
    8
    I watched this video from the beginning. And when the guy turned to the description of UI, I was like ..

    As it turned out, I even intuitively used some tricks with optimization correctly, but now I got an idea of why everything is going that way.
    At the moment, I solved my task pretty fast.
    Thanks a lot for the very quick reply!
     
    Lurking-Ninja likes this.