I've been recreating low poly trees from WoW in SpedTree, and I assumed that SpeedTree would use bones for the wind animations. But it actually only uses vertex animations for the wind. The engine only uses bones for animation, so I need a way to create wind animations with them.
The tree is made up of 4 different frond billboards that use an atlas, with around 3 or 4 small individual branches that are there for aesthetics. The bulk of the triangles are used for the billboards, scattered throughout the model with different scale, position, and rotation values
The only way I can think of doing this, is to create bones for the billboards. One for every vertex in each unique billboard, with the average number of vertexes being 6. So 4 * 6 = 24 bones. Then weight them 1:1 with the vertex for the first instance of each billboard type, and bind them to the XYZ pos & rotation of each vertex. Set a keyframe for every frame in the animation, and there we go.
Not quite so simple though. The wind anims SpeedTree makes don't just move straight up and down, or side to side. So I need to apply some math to emulate rotation and depth movement by just scaling the bone. Otherwise I'll need to use a large number of bones...
Attached is a screenshot of the tree. Can't find a way to attach a video of the animation.
Is there a proper way to go about this? Ideally there'd be some software that exports wind animation via bones, but failing that, a script for whatever 3D software can do it. But I don't even know if my idea would work in practice, so it's a bit of a mess.
Replies
Usually games use a vertex shader for wind animations, with vertex color to control the weights for various animation effects. Some use a combination of skinning (bones) for larger motions of the trunk and large branches, combined with noise in a vertex shader for leaves.
What engine are you trying to import the tree into? WoW?
Some neat diagrams and explanations of how they did the tree animation in Horizon Zero Dawn at Guerrilla Games.
https://ubm-twvideo01.s3.amazonaws.com/o1/vault/gdc2018/presentations/gilbert_sanders_between_tech_and.pdf
The important thing is that the reason why they use vertex animation and not bones is because it would be bad for performance to have that many bones on a single mesh.