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

Is it possible to "Batch" an animation?

Discussion in 'Getting Started' started by Sparticus, Apr 14, 2021.

  1. Sparticus

    Sparticus

    Joined:
    Mar 15, 2014
    Posts:
    149
    Hey all,

    In blender I created a 3d model and added a very basic animation to it (it's a bird where the wings flap).

    In my Unity game I might have this bird 10 times in the background. Currently I am seeing that even though all these birds are the same 3d model and all use the exact same material, they are not batched together. I see my "batches" go up by 10 when they are on the screen (and I see this in the frame inspector).

    Is there a way to make these all get drawn in 1 draw call/batch? Or is that not possible because it is an animation?

    Thanks!
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Correct. For meshes to batch they must be static, which means no animation (and no moving around, either).
     
  3. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Unity does have dynamic batching for moving objects, but there are specific criteria for it. I didn't see mention of animations as being a disqualifier, but unless your birbs are really low-poly, I'm not sure it matters.

    Adding 10 draw calls isn't disastrous, but it's definitely something to be aware of. If you need massive flocks of birds, you may want to look into leveraging DOTS/ECS, though that's not a small step to make.
     
    JoeStrout likes this.
  4. Sparticus

    Sparticus

    Joined:
    Mar 15, 2014
    Posts:
    149
    Cool, thanks guys for the info!
     
    Schneider21 likes this.