uGUI Text draw calls

Hi,

I’ve got the following UI :

I’m optimizing draw calls.

And as you can see, 15 draw calls. High for what i’m displaying. ( Already Spritepacked, only one font. )

I investigated, and i think the uGUI text are causing me troubles.

Here is the same view without the text :

From 15 to 3 draw calls.

In the cell widget ( prefab ), deleting the text GO and making a brand new one fixed the issue.

In every other label, even if i make a brand new one, the frame debugger stops on it and ALWAYS use one draw call to draw ONE label.

Looks like the text rendering is done exaclty in the hierarchy’s order, without any optimization.

I can’t find what’s the problem about my texts.

Any idea?

Alex.

From my understanding, you need to consider 3 facts here

  • The UI is rendered in hierarchical order
  • dynamic text is written to a texture with appropriate size
  • for batching to work, material and texture atlas hehe to be the same

so what I think you’d need to do is ordering your visuals. batches sprites first, texts last