Search Unity

Drawcalls go up with the latest version of Unity 4.6 (4.6.4p2)

Discussion in 'UGUI & TextMesh Pro' started by geff, Apr 14, 2015.

  1. geff

    geff

    Joined:
    Mar 3, 2013
    Posts:
    28
    Hi,

    I've just release a game on Steam with Unity 4.6.2f1, drawcalls where acceptable.

    I'm working on the mobile version of this game.
    So I upgraded to the latest version of Unity 4.6 : Unity 4.6.4p2 and drawcalls exploded.

    I show you a representative part of my problem :

    I have 1 Camera, 1 Canvas

    I Render only that :

    upload_2015-4-14_17-17-45.png

    My Hierarchy :

    upload_2015-4-14_17-18-26.png

    Cases contains only that :

    upload_2015-4-14_17-20-57.png

    Leds contains only that :

    upload_2015-4-14_17-21-20.png


    Unity 4.6.2f1 : 4 Drawcalls

    Unity 4.6.4p2 : 40 Drawcalls

    If I set led's Source Image to None, drawcalls go down to 4 but I have glitch (which I don't have in 4.6.2f1)
    There are problems with overlapped images on the latest version.

    With the new version, I have drawcall problem everywhere in the game now, but i need the new version for the iOS build (il2cpp).

    On my example I have shown you, I'll change the background image to avoid Case objects.

    Do you have tips, advices or clear explanations why my drawcalls goes up in 2 months updates?

    #geff
     
    MrEsquire likes this.
  2. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    I'd log that as a bug using the Unity bug reporter in the editor. There weren't any significant changes in the UI source for this, so it must be an editor regression issue. Thoughts @phil-Unity @Aras
     
  3. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    Just one after thought. Might the above control not be easier to update to use a single image for the Cells/cases (tiled image maybe) with a background slider (set in to stepped mode) for the LED's to achieve the same effect.
     
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    does mobile platform have draw call batching enabled in player settings?
     
  5. geff

    geff

    Joined:
    Mar 3, 2013
    Posts:
    28
    Indeed, to avoid drawcalls, I deleted the "Cases" and painted a black square on my texture

    Static and Dynamic batching are checked.

    I have another example :

    1 Canvas, 1 Camera

    I render only that :

    upload_2015-4-15_11-59-20.png

    It's a popup with a scrollrect.

    Hierarchy :

    upload_2015-4-15_12-0-49.png

    Unity 4.6.2f1 : 21 draw calls

    Unity 4.6.4p2 : 77 draw calls

    If I disable Text component on TechnologyBar > Name I get :

    Unity 4.6.2f1 : 19 draw calls

    Unity 4.6.4p2 : 60 draw calls

     
    MrEsquire likes this.
  6. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    File a bug as this would possibly be a regression :)
     
    SimonDarksideJ likes this.
  7. paradizIsCool

    paradizIsCool

    Joined:
    Jul 10, 2014
    Posts:
    178
    Have you news about this case ? (what about 4.6.4p4)
    Have you tried to remove scrollrect in your last example ?
     
    MrEsquire likes this.
  8. mh114

    mh114

    Joined:
    Nov 17, 2013
    Posts:
    295
    Seems to be broken still in 4.6.4p4. Did you file a bug, @geff?
     
  9. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    Just confirmed this myself on 4.6.4p4. UI batching completely broken. We were stuck using 4.6.3f1 for months because InputField was broken on Android ever since until 4.6.4p4, and now that we were finally able to update, there's this blocker.

    I guess it's back to 4.6.3f1 again. I hope they'd fix this soon, but the way it's been with UI fixes and 4.6 lately, I'm not expecting much. I reported a bug from 4.6.4, but since this doesn't happen in Unity 5, I guess the reports are pretty much ignored.
     
  10. paradizIsCool

    paradizIsCool

    Joined:
    Jul 10, 2014
    Posts:
    178
    I've tested too, same results, between 200 and 300% more draw calls
     
  11. geff

    geff

    Joined:
    Mar 3, 2013
    Posts:
    28
  12. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    Reported a bug too. Not fixed in 4.6.5f1, but I guess it's basically the same as 4.6.4p4.

    There's now been a blocker level UI bug in every patch/release since 4.6.3 (InputField not working on Android, disabled UI items blocking raycasts, UI image draw calls not batching). I really hope they're working on this, since I got a deadline coming up and I'm getting a bit worried with the way things have been going lately.

    Any word on this @Tim C @phil-Unity @runevision ?
     
    ortin, mh114, SimonDarksideJ and 2 others like this.
  13. intacto

    intacto

    Joined:
    Sep 26, 2012
    Posts:
    7
    We have the absolute same problem with 4.6.5. I hope it will get fixed before we release our update in two weeks.
     
  14. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    So, not fixed in 4.6.5p1. But apparently something's been done, since now UI objects are no longer visible in scene view...
     
  15. mh114

    mh114

    Joined:
    Nov 17, 2013
    Posts:
    295
    5.0.1p4 also has the invisible UI objects in scene view, yeah!
     
  16. mh114

    mh114

    Joined:
    Nov 17, 2013
    Posts:
    295
    So the invisible UI objects will be fixed (at least for 5.x, hopefully 4.6.x too). How about the badly broken UI batching? Can you poke the relevant folks, @superpig?
     
  17. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,659
    Has anyone confirmed whether the issue is or isn't present in the latest 5.1 beta release? It'd help me to know whether this is a "already fixed but needs backporting" vs a "nobody has fixed it anywhere yet" situation.
     
  18. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    AFAIK the broken batching only happens in 4.6, not in 5, so I would guess it's a "they only broke in 4.6 and never fixed it anywhere" situation.

    Edit: Actually nope, this does happen in 5.1.0b6 at least in some way!
     
    Last edited: May 12, 2015
    MrEsquire likes this.
  19. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    Here's some screenshots from 5.1.0b6. I just have a panel with gridlayout, containing panels with an image on top. I've duplicated the inner panel multiple times in these screenshots.

    Batches 3, saved by batching 0

    drawcalls_1.jpg

    Batches 9, saved by batching 0

    drawcalls_2.jpg

    Batches 9 (doesn't increase after this), saved by batching 0

    drawcalls_3.jpg

    Edit: I also reported a bug with 5.1.0b6, case 696334.
     
    Last edited: May 12, 2015
    dbds, superpig and mh114 like this.
  20. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    Soooooo, this is still not fixed in 4.6.5p2.
     
  21. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Yep still waiting, whats annoying me is when it comes to mobile performance its all hush hush with Unity and topic is ignored, just keep releasing updates and all and hope for the best. Someone needs to dig deeper and find cause of these issues and fix as these not simple bugs. Where is QA?
     
    dbds likes this.
  22. dbds

    dbds

    Joined:
    Aug 3, 2014
    Posts:
    3
    still waiting!!!!!!!
     
    imandic likes this.
  23. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Im still waiting day I see performance increase for UI for mobile devices.
     
  24. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    @geff Can you test with Unity 4.6.5p2 and 4.6.5 final
     
  25. DWilliams

    DWilliams

    Joined:
    Jan 12, 2015
    Posts:
    63
    I've been doing some testing on different Unity versions with a very UI heavy project to try and see which versions are affected and this is what I have so far.

    4.6.1 f1 - 92-94 draw calls
    4.6.3 f1 - 92-94 draw calls
    4.6.3 p2 - 92-94 draw calls
    4.6.4 f1 - 92-94 draw calls

    4.6.4 p1 - 237-239 draw calls
    4.6.4 p2 - 237-239 draw calls
    4.6.5 p2 - 237-239 draw calls

    5.0.1 f1 - 92-94 draw calls

    Not sure if this issue has shown up in higher versions of 5 or not, I may do some more downloading of different versions to test further.

    UPDATE:
    Just to be thorough I tested all versions from 5.0.1f1 to 5.0.2p2 and none of those versions have the increased draw calls.
     
    Last edited: May 27, 2015
  26. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    The bug is there in the latest Unity 5 versions too, I tested it today on 5.1.0f2.
     
    Sebrofjr, MrEsquire and mh114 like this.
  27. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    @iivo_k Do you have a bug #? You reported above that you submitted one.
     
  28. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    696334 is the latest one.

    Edit: here's a pic from 5.1.0f2, it's a better repro than the one included in the bug report, since this one increases draw calls with every copied element, while the bug report repro increased them up to 11 if I remember correctly. Anyway, the key seems to be lots of nested images.

    UnityDrawcalls.png
     
    Last edited: May 28, 2015
    phil-Unity likes this.
  29. paradizIsCool

    paradizIsCool

    Joined:
    Jul 10, 2014
    Posts:
    178
    Do you care about unity 4.6? superpig and you wake up when we talk about unity 5.
     
    dbds and MrEsquire like this.
  30. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    So we are discussing if this is something we are going to fix. Its due to how we are batching things together with our new algorithm. The algorithm is a lot faster so time spent generating the batches is reduced but at the cost of more draw calls. I will get back to you when i have a answer.

    If we determine its something we are going to fix it will go back to 4.6 as well.
     
  31. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    Well I sure hope you decide to fix this! Draw calls still do matter on mobile. It's not good at all the way it is now, at least give us an option or something?
     
    mh114, ortin, dbds and 2 others like this.
  32. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    +1
     
  33. dbds

    dbds

    Joined:
    Aug 3, 2014
    Posts:
    3
    +1
     
  34. sheng319

    sheng319

    Joined:
    Jun 23, 2014
    Posts:
    34
    ++++++++1
     
  35. sheng319

    sheng319

    Joined:
    Jun 23, 2014
    Posts:
    34
    I have another problem. See videos.

    #Normal on 4.6.2p1


    #Problem on 4.6.5p4, draw call increased, and title disappeared!


    Although ugui on 4.6.2p1 has no problem, but released on 4.6.2p1 to iOS/IL2CPP have other problems (ex: socket issue), and these known problems have been fixed in the new version. But ugui on new version always have big problems. This situation is very awkward. Hope you guys can fix it soon.
     
    dbds likes this.
  36. ortin

    ortin

    Joined:
    Jan 13, 2013
    Posts:
    221
    Not sure that faster batching algorithm helps if draw calls go from 80 to 600 (my UI example).
     
    paradizIsCool likes this.
  37. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    Could i get some more example projects? I have improved the case for one that i have but would like to check out other examples. Either file them as bugs and PM/ post a bug number or pm me a download link
     
  38. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    I just reported 701620.

    UIDrawCalls.jpg

    I exported the scene as a unitypackage and attached it here too.

    Edit: also sent PM.
     

    Attached Files:

    dbds likes this.
  39. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
  40. geff

    geff

    Joined:
    Mar 3, 2013
    Posts:
    28
    I Phil, i reported case #689600
     
  41. sheng319

    sheng319

    Joined:
    Jun 23, 2014
    Posts:
    34
    See case 701881.
    Thenks.
     
  42. dbds

    dbds

    Joined:
    Aug 3, 2014
    Posts:
    3
    4.6.6 still broken.
     
    MrEsquire likes this.
  43. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I didnt expect it to be fixed, I think 4.6.6 was all the patches combined, but you do sometimes always wish for the best, I guess we got wait till another patch release..
     
    dbds likes this.
  44. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    Yea the issue is harder than it should be as we dont want to just revert and end up with the long batch process but we also want to lower dc. That being said i've unfortunatly got pull to fix some stuff for 5.2 which was deemed higher priority once those are fixed i'll be getting back to this.
     
    paradizIsCool and geff like this.
  45. sheng319

    sheng319

    Joined:
    Jun 23, 2014
    Posts:
    34

    Our games develop by UGUI and publish to the market. We received large amounts of complain about “unexpectedly quit” on Android5.0 and socket connect problem on IOS. User doesn’t understand those problem causes by Unity4.6 old version bug. They blame for our company can’t fix their problem. This is serious issue because of our user is getting lose quickly in our game. Your feedback let me wait for unity5.2 bug fix done then you will start to fix our problem. Do you really think our users are waiting on that time????

    To be Honest we don’t care about your algorithm for lower dc. We just care about UGUI work properly. I tried to get ver.4.6.2 ugui .dll to ver.4.6.6 but didn’t work. Our company faces big challenge about this issue. We can’t wait for long. Please give me old algorithm of UGUI and hot fix to ver.4.6.6 for me.
     
  46. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Was about to ask about unexpected number of draw calls then spotted this thread.

    For the record this is what I'm getting on 4.6.6p1:

    5 draw calls for this where all images packed in same atlas.

    Screen Shot 2015-06-11 at 09.26.47.png

    Screen Shot 2015-06-11 at 09.26.55.png

    Take away text and it's still 3 draw calls.

    Screen Shot 2015-06-11 at 09.27.33.png

    Obviously this is just a small portion of my UI but the problem is the same all over it.
     
  47. BenouKat

    BenouKat

    Joined:
    Feb 29, 2012
    Posts:
    222
  48. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    Watch for the fix in the next patch of both 4.6 and 5.1
     
    iivo_k, idurvesh, T2Unity and 3 others like this.
  49. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    ? seriouly ?
     
  50. BenouKat

    BenouKat

    Joined:
    Feb 29, 2012
    Posts:
    222
    Is the 5.1.1 the patch you talk about ? Because I don't see any issue related to UI in the patch note.

    Or this will be next patch ?