Author Topic: Enabling and Disabling UIPanel causes drawcalls to go down [3.0.4]  (Read 3592 times)

oddurmagg

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
After upgrading to 3.0.4, It seems the number of draw calls goes up a lot. After trying to figure out what was causing that, I noticed that if I enable and disable the uipanel gameobject the number of draw calls go down(from 25 to 1). 

The panel has about 110 widgets on it all using the same atlas and all have the same depth (1).

I tested writing a small script that disables and enables the uipanel on start and that seems to remedy the problem. Not the most graceful way of doing it but it works.

This definitely smells like a bug.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Enabling and Disabling UIPanel causes drawcalls to go down [3.0.4]
« Reply #1 on: November 04, 2013, 12:01:02 PM »
When that happens, have you checked your UIPanel to see which widgets end up where? Using one panel and one atlas should certainly only result in one draw call -- and that's how it works in all my tests as well as in the provided examples.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Enabling and Disabling UIPanel causes drawcalls to go down [3.0.4]
« Reply #2 on: November 04, 2013, 06:10:14 PM »
Sounds like maybe it makes a bunch of drawcalls if it's confused about multiple materials being there. Try using my depth tool or the UIpanel's overview to see what the actual draw calls are.