Complex tree animation

Hello there, what is the “best” or recommended workflow for tree animation (trunk + branches, or leaves in wind). (I use 3ds max). Thank for your time - answer.

I don’t have a ton of experience working in Max, but this tutorial demonstrates a decent workflow for a pre-rendered asset:

You’d animate a bend modifier for the trunk, then use a noise modifier to animate the leaf vertices.

For more of a game asset, my best guess is to use a skeleton to animate clusters of branches and the trunk, and morph targets for animating the leaf meshes (similar to how the noise modifier is used here, but more deterministic of an effect?), but @PatrickRyan would probably have some better suggestions.

@Johny_Mickey, the best method for animation for foliage in the wind us by creating procedural vertex displacement. Unless you want to simulate heavy wind, you should be ok animating just the leaf cluster quads.

I am making the assumption that you are creating real-time trees like one of these examples. If that is true, you can add a custom shader with vertex displacement based on a looping data set like cosine of time added to the position of the quad vertex in world space. You will need to limit the motion to the ends of the quad rather than the whole thing because you don’t want your quads moving away from the branch.

To achieve this you can use vertex color on the quads to limit motion. For example, fill the vertices you want to move with Red and the ones you don’t want to move with black. If you want to limit movement on some of the vertices use a value between 0 and 1 in red, the darker the value the less the movement. Then the key is to multiply the red channel of the vertex color with the displacement.

As you can see, you can go really deep on this using R, G, and B to represent movement in world X, Y, and Z and really have control over how each quad moves. You could then pass a variable into the shader as a multiplier on the displacement and control that variable in your code to change the intenisty of the movement simulating wind speeds varying.

I don’t have an example of this type of system in Babylon, but it may be useful for our next release demos. Let me know if you have more questions.