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. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

Meshskinning performance

Discussion in 'Unity 5 Pre-order Beta' started by Carpe-Denius, Dec 29, 2014.

  1. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    What performance can I expect for meshskinning?
    I tested 60 animated characters (UMA). Regardless of complexity (6000 tris vs. 28000 tris) or gpu-skinning enabled/disabled, every character takes about 1ms for MeshSkinning.Prepare

    I have seen videos with several hundred actors, how do they do that? Vertex count doesn't seem to have any Impact at all.
     
  2. p87

    p87

    Joined:
    Jun 6, 2013
    Posts:
    318
  3. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    That's a good keyword. About 160 [...].
    The strange thing is, only preparing takes so long. The actual skinning takes 0.5ms for all (at least the profiler is telling me that) and I had a test earlier in december with 150 meshes at 22 fps, now it runs at 3fps.
    But I will look into the rig, maybe I can bake the mesh and remove every GameObject which is only used for deformation.
     
  4. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    That's probably UMA being the bottleneck there...

    Do you have a test scene that runs 22fps before and 3fps after? If so, Unity's crack squad, the QA team really want it now :) make a repro and submit via bug reporter tool.
     
    Last edited: Dec 30, 2014
  5. DanSuperGP

    DanSuperGP

    Joined:
    Apr 7, 2013
    Posts:
    408
    160 joints? That's a crazy high number.

    (wow, that looks like a drug joke, it wasn't meant to be)
     
    hippocoder likes this.
  6. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    160 joints is indeed crazy high :D :D :D :D
     
    DanSuperGP and p87 like this.
  7. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    That's not all ;)
    I found the problem (but not the source): SkinnedMeshRenderer.bones.Length is somehow at 10047 after mesh merging, even if the rig has "only" 160 gameobjects.

    So it's definitely not a problem in unity.
     
    Last edited: Dec 30, 2014
  8. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    What!? That's nasty, please report it in the main UMA thread.
     
  9. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    I guess the real question is which mesh combiner did you use? Legacy or Default?

    Also be aware that with 60 UMA characters you need to make sure to reduce atlas quality otherwise the textures atlasses will kill your gpu memory, and when the gpu starts swapping memory on the agp then you'll be in a world of hurt... 1 ms per char would be very good if that's the case.
     
  10. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    Default (and I bought your power tools after the keyword "bones" fell, but I didn't get them to work at all for the moment, transforms get NaN or infinity as position, even when I just use the default high poly slots)
    Atlassing is not the main problem now, I only use 500mb of textures at the moment.
    With a custom shirt with the same rig as the standard uma mesh I get 10047 bones (103 different transforms, all of them several times)

    But 10000 bones would explain why preparing takes a ms per frame per character, but skinning is super fast.
    I tried using my shirt as a seperate SMR with shared bones and shared animator, that takes preparing down to 2 ms for 60 characters, but I guess that should be discussed in the UMA thread
     
  11. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    One thing that's interesting to me is if the shirt also produces the same amount of bones on Unity 4.6.

    I might have to take a look at that shirt to reproduce your problem.
     
  12. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    I posted in the UMA-thread, a standard clothing item from the UMA asset will get almost the same amount of bones. I haven't used U4 in a year, but I will download it later and test i there.
     
  13. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hi there!
    Please let me know if the problem is happening both at Unity 4 and 5.
    Considering the amount of bones per avatar, this video is old but explain the concept and why ~150 bones are being used.

    It would be worth testing if the same problem is happening when using legacy combiner, to identify if the problem is related to the SkinnedMeshCombiner or something else.
    Thanks a lot for the feedback