Tips & Tricks — Simulating Trees and Plants with Houdini Vellum
A few months ago I came across two nuclear explosion test videos that were conducted back in 1955 in Nevada Desert. I decided to try to replicate two of the shots in the videos in 3d. First one is the one where a house blows up with the explosion (01:30 minute of the video), the other is the trees that swoosh around with the shockwave. (0:17 second of the second video).
Both of my renders got a lot of attention and comments on social media. However, I especially got a lot of personal messages asking me about the trees. A lot of artists wanted to do windy tree simulations but apparently they were not very happy with their results and asked for my help. I tried to reply to them in detail as much as I can. But now, after getting so many requests I decided to make it into a longer, written tutorial kind of article.
It all started with downloading a tree asset from Polyhaven.com. There are a couple of tree models there but beware that you can’t just download and import them. The annoying thing is they were done in Blender with geometry nodes so you have to open the tree inside Blender first. In Blender select the leaves, go to Object, then to Apply and select “Make Instances Real”. After that select the branches and remove the geometry nodes modifier from it. Now you can select the whole mesh and export it.
Now Polyhaven model or not once your tree is in Houdini, all I did was to convert the tree body (trunk and branches) to wires with a convert line SOP. It is a good idea to make the converted lines a little less detailed for vellum sim but not mandatory. To do this a Fuse SOP after the convert line gets the job done. After that I make a group for the points very close to the ground to pin them. Now go right into the vellum constraints by choosing “String” as the constraint type. Don’t forget to put the pin group into the Pin to Animation section. Now plug the constraints to a vellum solver. Play it and see your tree bending and falling down. If that is the case for you which most of the time should be, the trick is to first increase the bend stiffness in the string constraints. If that doesn’t help then go to the solver and increase constraint iterations. When I say increase I really mean it. Don’t be afraid to go as high as 400 or 500 here. Don’t worry it won’t be as slow as you imagine. If that also doesn’t help, try to increase the substeps to 2 or 3. In case things are not working out for you, try to increase Velocity Damping a bit. Add your forces inside the solver and you are good to go. One last trick might be to make the pin constraints area bigger to stabilize things more. Once you have the look you wanted, put down a point deform and bring your geo back. Set your materials and you are ready.
I got asked if I used wire solver for the body but as you can see I didn’t. I used to use wire solver for this effect before but not anymore because I find vellum to be more reliable.
You might be asking yourself, what if my tree have big leaves? How would just animating the branches be enough? And you are right that is not enough. So in that case what I did was to again do the same thing above for the branches and trunk. Use the point deform to bring the mesh. Now isolate the leaves from the original mesh and use them in another vellum solver. Set them as cloth constraints and pin them to the deformed body mesh you just did. Or use an attach to geometry constraint to attach the cloth leaves to the deforming tree body. You can even make the attach constraints break by a threshold in case you want leaves to fly around with a strong wind. Merge your body geo and leaves and that’s it. Similar to the body if your leaves keep moving a lot or jittering increase the constraint iterations a lot. This time go as high as 1000 or even 1500 iterations. I advise you to disable collisions here if your tree isn’t very close up. It will save a tremendous amount of time and would be very difficult to see collisions for trees that are far. (Did you notice leaves going inside each other on my render? Hopefully not)
Last Resorts
Let’s say you tried everything above and your tree or plant still can’t stand still or act accordingly. Then your first try should be to increase the substeps. In my experiments I went as high as 7 or 8. Yes it becomes pretty slow but when nothing works brute force solved most issues for me.
Let’s say things are still not working for you. This should probably mean there is something wrong in the setup or there is unexpected collisions or attribute that is breaking everything. But if there is no time and you need to get this to work you can try to disable gravity to prevent your tree from collapsing. Let’s assume you have a car that goes through and breaks some trees, but you can’t keep the trees stable. So just make the gravity zero until the car hits and as soon as the car collides increase it to a regular value. I know this is a disgusting, hacky, cheap method but sometimes to get things done quick you need to cheat and get dirty. You can also try to increase drag for a lot until a certain frame to keep things stable.
Another cheesy idea might be to get rid of collisions. I had a case where a character was running around a few bushes and had to collide with him. However, after trying for a long time I never managed to get the collisions to work properly. Something was definitely wrong with my plant geos or character or velocities or something else but I didn’t have time to go deep and investigate. So I ended up adding fake pop forces inside the vellum solver. A sudden keyframe animated pop force can give you the effect of collisions and a realistic movement.
That’s it! If you were expecting a complex setup with crazy VEX or millions of VOPs I am sorry but that is not the case. I always like going simple and fast with setups. And I enjoy it a lot once the simple setup works fast, is easy to understand and gets the job done quickly. I used this same trick on multiple feature movies and it worked perfectly.
If you make any vegetation with this method give me a shout. Maybe you can even share it so me and everyone else can enjoy watching it. I am always willing to hear any other opinions or additions on this setup so feel free to write them in the comments.