Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Yet another clarification about bones performance

Discussion in 'iOS and tvOS' started by n0mad, Sep 2, 2009.

  1. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    Hello,

    sorry, bones are coming back :roll:
    But I just need a small clarification that would be iPhone specific, as I don't think this would mean that much of performance loss on PC/Mac.

    So, basically, as bones are converted to transforms in Unity : that should mean we could have hundreds of them in a scene, considering they would be bound to quads only ?

    I know Zombieville and SpriteManager are abusing of it, for the sake of cool graphics, but I never saw an iPhone scene running smoothly (~40 fps) with something like 120 bones ?

    In short, 120 bones on 120 quads would be the same as 1 bone on a 28800 tris mesh ?
     
  2. MikaMobile

    MikaMobile

    Joined:
    Jan 29, 2009
    Posts:
    845
    Just to clarify, 120 bones each controlling 1 quad each is still only 120 quads, or 240 triangles. So no, that's nothing like 1 bone controlling a 28800 triangle object. :) Also, polygons are really irrelevent to figure out how costly your skinning is - its all about your vertex count.

    As for how many quads you can have animating on screen at a time? Quite a lot, particularly with unity 1.5. Our current project is another 2d game, but it pushes the envelope quite a bit further than Zombieville did technology wise. At the moment we have around 50-60 quads skinned to bones on screen at a time being animated simultaneously, and many more that are static. So far the framerate is pretty solid, staying around or above 30fps on an iPhone 3G, and positively screaming on an iTouch.

    Also, bones that are sitting around not moving aren't costing you anything. Zombieville had a lot of quads attached to bones floating around off screen until needed - they have no performance impact until they're actually doing stuff, even if there are dozens or hundreds.
     
  3. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    Ah, that's perfect explanation. Thanks PirateNinja.

    (your next project sounds cool, will there be a WIP thread or site about it someday ?)
     
  4. MikaMobile

    MikaMobile

    Joined:
    Jan 29, 2009
    Posts:
    845
    Yeah, its actually really far along, we just don't want to spill the beans until we're extremely close to being done. All the Zombieville clones have made us paranoid :p

    I'd say its about 4-5 weeks from submission based on the rate we've been going.
     
  5. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    I dig ya ...

    Now I can understand why one must be a multi-billionaire enterprise not to fear revealing interesting WIPs (*looks at Blizzard with their one year early WIP expositions*).

    Well, good luck for the last lane ;)
     
  6. noocell

    noocell

    Joined:
    Mar 23, 2009
    Posts:
    104
    Does this also apply to, lets say, 200 bones which are used to, just statically, bend a rectangle-shaped mesh that is always on-screen?

    I don't like the idea of 200 bones to just smoothly bend a rectangle shape, but I want to use a texture offset animation on it and can't think of other proper ways to keep this functionality. If only Unity supported vertex deformers...
     
  7. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Why not use the Mesh class?

    --Eric
     
  8. noocell

    noocell

    Joined:
    Mar 23, 2009
    Posts:
    104
    Hm, what could I do with it? Would this allow a rectangle-dimensions texture being properly offset-scrolled along a bended plane?
     
  9. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You can set the vertices of a mesh to whatever you want using the Mesh class.

    --Eric