Search Unity

Feedback [Cloth] Cloth.enable = true very expensive

Discussion in 'Physics' started by AndrewRH, Aug 16, 2019.

  1. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,585
    I'm sure the cloth component has A LOT of data structures etc to set up when it is enabled, but it would great if there was an option added to skip some of this setup, or to just disable cloth updates and then enable them again.

    Often is it useful to disable and then enable the cloth for performance, but currently doing so will produce a large frame spike and dropped frames. As it is not possible to do this on another thread, the main thread blocks.

    This issue is reported here, please vote for it:
    https://issuetracker.unity3d.com/issues/enabling-cloth-component-stutters-the-editor

    Thanks,
     
  2. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,585
    *bump* :)
     
  3. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,585
    *bump* ;)
     
  4. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    76
    AndrewRH likes this.
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,460
  6. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,585
  7. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,460
    Best post a bug, because even in the best case, the docs are incredibly vague and for something to cost more perf being disabled is absurd.

    Current issues I've found:
    • UI is crap. It hasn't worked in the past and currently it isn't working very well at all
    • Buggy as hell, forces don't work
    • Docs completely and utterly suck
    ... And that's not even touching on your issue.

    So if Unity's analytics show cloth isn't used much then the reason for this won't be because people don't want to use it, it's because they can't. And so Unity probably makes a terrible assumption here.

    It's a shame because probably, it could be used well. I want to use it but in it's current state I can't even though I want to. It doesn't even show paintable verts and the tooling / UI is gibberish, and forces have no effect (as of 2019.2).
     
  8. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,585
    Agreed. However, the actual cloth engine is actually quite good! We did a bunch of tests comparting different systems and although the Unity Cloth (NvCloth) isn't the fastest or using the GPU, it's very stable and still quite good performance.

    Yeah - the tooling needs a lot of improvement. We're heavily using Unity cloth on a project currently so we're writing some scripts and tools to help us. Perhaps we'll release them soon :)
     
  9. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,585
    But yeah, we might post the bug issue that SetEnabledFading doesn't cause cloth processing to stop :)
     
  10. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,460
    And forces aren't working at all for me (applied in code and in the component itself)
     
  11. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,585
    I'm still on 2018.4.8...i think it's working in that version.
     
  12. teutonicus

    teutonicus

    Joined:
    Jul 4, 2012
    Posts:
    41
    (from 2019.3b2 release notes)
    Did a quick test on a clothified plane in 2019.3b2 and forces do appear to be working again. Have to check it out on our working project when I get a chance though :)
     
    hippocoder likes this.
  13. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,460
    Yep! thanks, working in 2019.3 b2 here!