Search Unity

Tips for Improving unity UI performance?

Discussion in 'Unity UI (uGUI) & TextMesh Pro' started by Zeit, Mar 22, 2016.

  1. Zeit

    Zeit

    Joined:
    Aug 22, 2014
    Posts:
    17
    Hi!

    I'm making a game on Unity 5.3.3 using UGUI. The issue is that somehow it is running at low fps and there's only UI involved

    The screen in the file attached is running at 35-40 fps on a low resources device ( ARCHOS 50d Helium 4G) and 45-50 in a mid resources device ( Nexus 4) although absolutely nothing is moving. We've tried disabling the dark background and all the background buttons. But the issue seems to be in the amount of toggles in the panel ( Might be wrong though ). All the scenes run at 40-45 because there's not that much content in them, but still this is a huge issue. UI should not have this much impact on performance.

    The only issue I can come up with is that every panel is inside the same canvas, so it has to recalculate something for all when doing a transition. But still that doesnt explain the 35-40 fps then the screen is basically static.

    I've tried making a simple scene with just 2 images. Nothing more. And it ran at 55 fps ( not even touching 60 )

    Any ideas on how to improve this?

    Thanks!
     

    Attached Files:

  2. Mothil

    Mothil

    Joined:
    Jan 14, 2014
    Posts:
    434
    I may be wrong, and I frequently am, but I wanted to ask just in case. How is the canvas rendered? Screen Space Camera, or Screen Space Overlay?

    I read a couple days ago that Screen Space Camera takes a lot more resources than Overlay, so maybe that can help you. It's located under the UI object (GameSettingsPanel in your case) :D
     
  3. Zeit

    Zeit

    Joined:
    Aug 22, 2014
    Posts:
    17
    It is rendered in Overlay mode :/

    I've read that the scroll view has perfomance issues. I'll try to disable it, might get some more fps doing that.

    But still, the 2 images scene not rendering at 60fps is a HUGE issue, i think it's more of a backend problem with the UI implementation...
     

    Attached Files:

    Last edited: Mar 22, 2016
    Mothil likes this.
  4. Zeit

    Zeit

    Joined:
    Aug 22, 2014
    Posts:
    17
    Well, disabling the scroll view didnt change fps count :/
     
  5. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,153
    File a bug as having 2 images performs fine for me so maybe there is some setting thats weird in your project.
     
  6. Zeit

    Zeit

    Joined:
    Aug 22, 2014
    Posts:
    17
    I'll do that!

    Testing more I discovered that openGL version might be an issue. Using OpenGL2 the nexus 4 runs at 40-60fps and Archos Helium at 35-50, but when using OpenGL3 the nexus4 runs at steady 60fps and the Helium at 25-40. I'll look more into that and post here if I find anything
     
  7. Zeit

    Zeit

    Joined:
    Aug 22, 2014
    Posts:
    17
    @phil-Unity I've just reported the bug. Case 784238

    Thanks!
     
  8. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    158
    Hello,

    To improve our game FPS I find that disabling all animator, change layers to not render out of screen object (in scrollview) can help.

    But we need more performance.

    What we do is having UI menu (40 menus pages) in 2 canvas (page and popup) in Screen Space Camera because of Particule systems we need in top.

    On old device FPS is a bit low.

    I try today to have 2 anothers canvas in Screen Overlay mode if we do not need particules. I have not seen better performance.

    To improve quick transition I have activate menu hidden (canvas group alpha = 0). But by doing this if we do not inactive all animator (button and ...) then FPS decrease a lot. If we do not let menu actif then transition can take 1 or 2 secondes. With 40 menu pages we have a lot of game object.

    What is the best technique?

    1/ All menu in one canvas
    2/ 1 Canvas per Menu
    3/ 1 Scene per Menu (making smooth transition seems hard)
     
  9. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    158
    Nobody?

    We have test case 1/
    . On iPhone 6: FPS is good
    . On Android galaxy tab 3, Android One Plus game UI is not smooth. Many slowdown.

    I have try with 2 more canvas with Overlay space that I have added all menu UI page that have not Particules Systems. I did not see difference.

    2/ is not a good solution I think. But I have added Canvas for each scrollview in order to keep repaint only for those I move

    3/ Maybe the better for perfs but what about transition?
     
unityunity