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

Performance hit even when gameobject is disabled

Discussion in 'UGUI & TextMesh Pro' started by silviu-georgian77, Mar 23, 2016.

  1. silviu-georgian77

    silviu-georgian77

    Joined:
    Jan 17, 2016
    Posts:
    12
    Hello
    We are working on a project that has a pretty complex UI menu. The problem is that we are facing very low FPS, even though all the UI that is not used is disabled.
    We have also tried the following test scenario:
    - launch scene after completely removing all UI elements -> FPS was 55-60
    - launch scene with all UI elements in the scene, but they were all deactivated -> FPS 15-25

    Note: all the tests were made on Android devices; also, there is no funny code that runs in an Update function

    Does anyone see a solution?
    Thanks!
     
  2. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    212
    I am making a heavy menu game to.

    Then to improve FPS I have noticed with profiler on that you must desactive animator when possible. To have quick transition between menu you must let menu active. Only disable if require calculation (script and so on). Image out of screen will not be rendered but you can set sprite to null if dynamically assigned.

    Scrollrect is the worse. I have huge spike with it. I will try to add canvas on it to avoid unity recalculation each tick we move it. And avoid auto layout component in it.

    You must limit your set pass calls to 200. Simplify if you can, avoid mask if you can (mask = 2 draw calls).

    If you have many text use bitmap font and be carefull if you use dynamic font with UI text. Dynamic font have caused huge spike when switch menu page in our game because unity recompute texture font atlas with different font size. (3 seconde between menus). I now use bitmap font and only dynamic for little texte that need dynamic (very great feature but at perf cost)

    Use profiler to see what eat FPS.
     
  3. silviu-georgian77

    silviu-georgian77

    Joined:
    Jan 17, 2016
    Posts:
    12
    Thank you for you tips and tricks. I will try them out and post the results here.
    Cheers