5
\$\begingroup\$

In terms of performance when it comes to animation what takes up more processing power: Whole character models or models that are pieced together? (1 object vs multiple objects).

I also wonder if animating multiple objects allows us to get a better overall animation quality instead of working with one object (especially if we deal with action packed scenes).

\$\endgroup\$
  • 2
    \$\begingroup\$ Generally speaking: one object is going to be faster. There's some overhead accounting for the transforms (and other components) of multiple objects, particularly if the transform hierarchies are very deep (each transform having to be updated when its parent updates). Similarly, a single mesh renders faster than two meshes, or four, even when the total number of vertices are the same. \$\endgroup\$ – Draco18s May 2 '17 at 17:42
  • \$\begingroup\$ @Draco18s Thank you for shedding the light on that one! \$\endgroup\$ – user100614 May 2 '17 at 17:43
  • \$\begingroup\$ I don't know specifically but I'd agree with user100614. I'd imagine there are a huge amount of variables that need to be initialized and populated for each object, so combining them shold be faster. That said you can try both approaches and profile them, just search for Unity profiling. \$\endgroup\$ – Absinthe May 2 '17 at 18:35
2
\$\begingroup\$

Combining several objects or animations into one will require slightly less computations (avoiding duplicated initializations, updates, etc), and will therefore have a slightly better performance.
Regarding quality, whatever solution you use, you are able to produce the same level of quality (at the expense of slightly worse performance for example if you use several separate objects).
One final aspect I think you should consider is the maintainability of your solution. If splitting your big object in several small ones makes your iteration time much faster, you should choose this option in the first place (and worry about performance only if it really appears necessary later on).

Update:

I realized you might mean you are interested in specifically comparing these cases:
- Using a skinned model with bone animation data created in an external tool
(versus)
- Using separate rigid models and animating then relatively to each other at run-time procedurally

As noted in the comments, depending on the complexity of your model and on the number of instances you will create, the answer will vary. Try to profile both solutions in your specific scene to find which one performs better.

Regarding quality, it also depends on the kind of model you are talking about, and on the visual style of your game.
If you aim for realistic motion-capture based character animation, I think it will be a lot of work to reproduce it procedurally, and you might prefer the "skinned model" solution.
If you are talking about animated environment models (a "merry-go-round" would be a good example), it should be easy to simulate as separate models.

\$\endgroup\$
  • 1
    \$\begingroup\$ Bear in mind that since this is specifically an animated model, it's likely using a skinned mesh renderer, which is slightly heavier than a regular mesh renderer and is not eligible for dynamic batching. So, it's conceivable that if you had very many copies of these, you might hit a trade-off point where the savings of batching many rigidly animated objects outweighs the cost of splitting them out from a combined/skinned form. \$\endgroup\$ – DMGregory May 3 '17 at 9:51
  • \$\begingroup\$ @DMGregory Thanks for calling my attention over the fact that user100614 was talking about animated models, I updated my answer accordingly. \$\endgroup\$ – wip May 3 '17 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.