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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Which of these tree animations would be more performance-friendly?

Discussion in 'General Graphics' started by VonDark, Aug 29, 2015.

  1. VonDark

    VonDark

    Joined:
    Aug 14, 2015
    Posts:
    11
    Hello,

    Let's imagine I am animating a tree which has 10 individual leaves which shake up and down in a cycle. Between:

    1- Parenting the leaves to the trunk and animating each leaf's pivot point individually, which results in a whole bunch of objects per tree

    or

    2- Rigging the tree with a basic setup and animating the joints

    which would be more efficient in terms of performance?

    Thank you
     
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    A couple thoughts.
    I think you are asking which would be more optimized for the engine, but how you worded it (efficient in terms of performance) leaves a little room for interpreting that you might be asking which process would be more efficient for you as the developer to create.
    Either way -
    I think if you only have 10 leaves and this is going to be a cycle - setting up the bones (#2) is the best option for you and the engine.

    Though there is the thought that possibly the animation built in Unity could maybe be smaller (more efficient in terms of performance) - I think the bytes in saving would be negligible unless you have a non-culled forest of these trees all animating at the same time, then maybe there would be some performance increase. But at this point culling the trees would result in better performance increase than using built in Unity animation vs. bone based keyframe animation.
    I think. ;)
     
    VonDark likes this.
  3. VonDark

    VonDark

    Joined:
    Aug 14, 2015
    Posts:
    11
    Alright, thank you!