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. Dismiss Notice

How many bones?

Discussion in 'General Discussion' started by Redz0ne, Oct 17, 2013.

  1. Redz0ne

    Redz0ne

    Joined:
    Oct 19, 2010
    Posts:
    332
    Couldn't find this... Has anyone ever reached an upper limit in terms of bones on a mesh and/or in a scene?

    ... Or is it essentially one of those "no limit but more bones means more work for the CPU" things?
     
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    1,863
    More bones equals more work and memory. Each vertex can only be influenced by up to four bones maximum.
     
    BrandyStarbrite likes this.
  3. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,614
    What Halley said. Though I suspect there may also be a limit of 256 bones for a single skin. I've not checked though.
     
  4. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    There are lots of limits on bones. For instance, on most hardware, the shader themselves have a limit to the amount of sheer data that can be sent, and it's quite low, like 2k-4k, etc... Which means, when you combine code, vertex, and fragment data, we used to truncate at like 60 bones, which meant breaking the model into pieces. On mobile, I assume that is even lower.

    As for the number of bones influencing each vert, 2-4 should be all you need.

    Gigi
     
  5. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    From Unity's own documentation :

    Use as Few Bones as Possible
    A bone hierarchy in a typical desktop game uses somewhere between fifteen and sixty bones. The fewer bones you use, the better the performance will be. You can achieve very good quality on desktop platforms and fairly good quality on mobile platforms with about thirty bones. Ideally, keep the number below thirty for mobile devices and don't go too far above thirty for desktop games.

    http://docs.unity3d.com/Documentation/Manual/ModelingOptimizedCharacters.html
     
  6. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    1,863
    Just a reminder, the standard Mecanim humanoid rig can register 30 bones just in two hands, and that's ignoring the metacarpals inside the meat of the hand that many designers use (e.g., Blender Rigify meta-rig).

    It depends on how you use them too. You may devote more bones to a "hero" character, because they really can make for a more lively figure. But there's a reason NPCs are second-class models in any game you play. If you have one character on-screen, you might afford to be bone-happy. If you plan to have RTS armies like Lord of the Rings swarming over the screen, you're gonna have to make them Minecraft-simple.

    My 2012 Nexus 7 can draw Hatsune Miku with about 50 bones (many of them ragdoll), but FPS suffers. My 2013 Nexus keeps up with Miku just fine.
     
    BrandyStarbrite likes this.
  7. ChaosWWW

    ChaosWWW

    Joined:
    Nov 25, 2009
    Posts:
    470
    I think this is pretty old in regard to modern desktop games specifically. As mentioned earlier, 30 bones is a sane amount for just the fingers (3 per finger), so don't try to go for 30 for a whole character! Especially for main characters, you can go very high and not worry too much at all. If you want some proof, take a look at this: http://www.youtube.com/watch?v=myZcUvU8YWc&t=13m37s . The limits are only going to get higher with next gen around the corner, so don't think too much about hard limits but at the same time keep an eye on your profiler.
     
  8. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,614
    Bear in mind that Unity's skinning is done on the CPU (except if you turn it on under D3D11) so shader limits aren't relevant here.
     
  9. Redz0ne

    Redz0ne

    Joined:
    Oct 19, 2010
    Posts:
    332
    I know this is a bit of a necro post by posting here but thanks to the discussion.

    The reason I asked is that I wanted to see how far I can push it with a facial rig... Since I've been able to hammer out a process for stretchy bones that work and preserve the hierarchy I've been getting some tests in. So far for a face I've got about 159 bones (though half of them are dummy objects and about 40 are nubs that don't have skinning data on them, they're still in the hierarchy nontheless)

    And yeah I have to wonder about the 30 bones suggestion... I can gather that there will be limits but hands alone can soak up all of those if you're using humanoid rigs.

    And that number gets even higher if you have bones that are in there for volume preservation, "twist" bones, "stretch" and "whip" bones, muscle-bones... Quite a lot.

    It might be, however, that the manual is suggesting the lower numbers more for performance reasons... So, a suggestion that's a bit more conservative so that users aren't pushing the limits right out of the gate and then running to the support department because they've over-taxed the engine and their computer.
     
    Last edited: Aug 6, 2014
    hopeful likes this.
  10. BrainMelter

    BrainMelter

    Joined:
    Nov 20, 2012
    Posts:
    572
    Skinning and animation are pretty big cpu hits on a mobile device. It can easily be your main performance bottleneck if you have lots of bones.

    A couple things to keep in mind:

    1. In the 'Rig' tab in the mesh importer, there is an 'Optimize Game Object' option, which helps a lot with animation performance.
    2. Lots of separate meshes are quite a bit more expensive than a combined mesh.
     
  11. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,068
    Wow!
    You know after reading this. Now it has me thinking. :cool:
    I wonder how many bones, were used for fighting game characters, like in the Sega, Virtua Fighter games?
    Especially the latest Virtua Fighter game VF 5?
    Or even Soul Calibur.

    It would be really cool to have info on stuff like this, as some sort of reference or estimate.
    And, it would help alot of Indie Game Devs using Unity or other game engine too. :D
     
  12. BrainMelter

    BrainMelter

    Joined:
    Nov 20, 2012
    Posts:
    572
    The best way to know is to measure it, using Unity Pro's profiler or Benchy.
     
  13. JDuaneJ

    JDuaneJ

    Joined:
    Jul 26, 2014
    Posts:
    29
    Can someone confirm a nice bone count for a humanoid rig for iOS and iPad 2,3 and 4? 30 bones is waaaaaay too small and 159 seems more accurate. My character needs full facial animation. Still would love to know an example before I rig my character with 160 bones for iOS. lol
     
    theANMATOR2b likes this.
  14. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,614
    Can you not use blend shapes rather than bones?
     
    lmbarns and ippdev like this.
  15. Mambo4

    Mambo4

    Joined:
    Jan 17, 2011
    Posts:
    14
    We have a character that seems to work with 128 bones, but another that broke at 168 bones. (Unity 5.2.4)
     
  16. soonzzz

    soonzzz

    Joined:
    Mar 3, 2016
    Posts:
    6
    I wish to use Character Creator + iClone for creating Animated Character for use in Unity3D for Game Development. These Character have roughly 155 Bones and 40,000 Polygons. Is it suitable for Mobile Game Development ?
     
    Last edited: Jul 17, 2016
  17. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,029
    You might be able to display the character and its animations. If you're lucky and on a high end mobile device. Otherwise, you most likely won't be able to do anything with it. Would need to be be really optimised. For example, on Sketchfab viewerso, where a model was around 20k tris and around 120 bones, it could only display the rig and animations, not the skinned mesh...on a Samsung Galaxy S7...
     
    soonzzz likes this.
  18. soonzzz

    soonzzz

    Joined:
    Mar 3, 2016
    Posts:
    6
    Has anyone used a G5 GameBone for Rigging and Skinning in Blender which was Exported and Animated in iClone and Sent to Unity ?
     
  19. james_cg

    james_cg

    Joined:
    Nov 13, 2019
    Posts:
    15
    Is 256 also the max limitation for gpu skin?
    And, what would happen if my bone count exceeds 256? Will it cause gpu skin fail or cpu skin fail?