Search Unity

How to cull IK cpu usage completly?

Discussion in 'Animation' started by mensaoliang, Sep 25, 2018.

  1. mensaoliang

    mensaoliang

    Joined:
    Jul 10, 2017
    Posts:
    9
    I am working on Animator performance stuff in an android mobile game. Although we don't have any IK functions in our game, I still found that Animators.IKJob takes about 10% cpu time away from Animators.Update:
    upload_2018-9-25_18-5-28.png

    upload_2018-9-25_18-4-0.png
    So how to ensure that all IK related stuff is remove correctly? The place I found is a checkbox in animator:
    upload_2018-9-25_18-4-36.png

    By the way, are there any general suggestions about improving animation performance?
    upload_2018-9-25_18-8-0.png

    upload_2018-9-25_18-8-49.png
     
  2. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Hi, this profiler tag was renamed in 2018.3 to IKAndTwistBoneJob.

    It was badly named and not representing the actual work load. So even if you don't have any IK enable this step need to be run to realign twist bone for humanoid.

    Humanoid rig are heavier than a Generic rig. If you don't want to use IK and your animation was made on the same rig than your character then there is no need to use the humanoid rig.

    The Humanoid rig is useful when you want to reuse a bank of motion on any character with different proportion and topology
     
    mandisaw, go3000 and mensaoliang like this.
  3. mensaoliang

    mensaoliang

    Joined:
    Jul 10, 2017
    Posts:
    9
    Thanks a lot, I will try to remove Humanoid rigs.
     
  4. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    You might be interested in trying my Animancer plugin. Aside from giving a totally different workflow which I find to be much better than the regular AnimatorController system, I've also been doing some performance tests in preparation for the release of v2.0. Here's what I've found:
    • Instantiation speed is roughly 10% slower than Mecanim.
    • But sustained performance is better so the average frame rate ends up being 3-5% higher. This was tested by counting the frames rendered over 30 seconds with 250 models periodically playing and transitioning between a bunch of animations in a chaotic pattern (but always the same pattern or it would be a useless test) to try to simulate a real game.
    • One thing that also helps the performance is the ability to play animations dynamically without creating their states beforehand. At the start the Animancer frame rate is a bit higher because it only has a couple of states on each object, but as it runs through the sequence and creates more states for animations each model hasn't played before the frame rate drops down towards Mecanim.
    • This would have a more significant effect in situations where each model won't necessarily need to create every state in the end. For example, if you leave the level, enemies you haven't killed will never have needed to create states for their die animations. Or if you don't use a particular skill, it's state won't have been created.