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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

UI, Ordering & Batching - How to get lower draw calls

Discussion in 'Scripting' started by BaterieCZ, Jul 17, 2017.

  1. BaterieCZ

    BaterieCZ

    Joined:
    Aug 1, 2014
    Posts:
    24
    Hi, almost everyone must know about batching.
    I am making 2D game and I need to make it faster now. Big problem is UI system.
    I found that even I use same atlas, batching not work on buttons, sliders and even on all elements what are not in same level (index).

    Is there any way how to batch successfully texts and graphics but leave the nice structure of parents and childs?
    Batching always fail when elements not in same "folder".
    I have now 2 draws for game and 20-50 draws for UI.
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,448
    FyndNorway, Karsnen_2, tarsss and 4 others like this.
  3. BaterieCZ

    BaterieCZ

    Joined:
    Aug 1, 2014
    Posts:
    24
    Thanks,
    I made some progress and lowered Batches from 30-40 to half.

    Problem is still with sliders amd fonts but i think i will make it.

    I have another question: I see that Dynamic Batching incerasing CPU usage. For Android mobile is better to have Dynamic Batching enabled and have low amount of batches or disable it and have lower CPU usage. What is better for FPS and Battery usage.
     
  4. tomerpeledNG

    tomerpeledNG

    Joined:
    Jul 14, 2017
    Posts:
    81
    Hi,

    Did you managed to reduce the batches?

    I'm encountering the same problem, my batches breaks, even-though they shouldn't (because the items in the same hierarchy level)...

    Any tips?
     
  5. Ducat

    Ducat

    Joined:
    Jan 13, 2017
    Posts:
    6
    Try to make their Zs same.
     
    Torulo, JonPQ, MiguelLobo and 2 others like this.