Trees swaying.

Hello! I was experimenting with foliage materials and managed to get pretty good results for my grass shader: Grass shader v2 - YouTube

I figured the way to get pretty good looking “wind” effect w/o actually using that silly-looking “simple grass wind”.
Here’s what I did, if you’re interested: I only added simple grass wind to make slight movements to the grass when the main “wind” is “calming down”.

The thing is, though… I can’t find a way to make realistic trees swaying effect. I can use my “wind” to make tree foliage to move nicely, but I really want to see my trees sway in the wind as well.
Is there any way how I could do that w/e making trees in speedtree? I already have my meshes… I tried to use vertex colour, but can’t setup the proper material so it would look right.

1 Like

Probably vertex paint is the most viable and performance-friendly solution…

You can see how it can be done on Pivot Painter examples level in Content Examples project. You can use the same material function for your trees.
The example level has some nice swaying trees, they are vertex-painted by the script, but if you don’t have Pivot Painter (plugin for 3dsMax), then you can just paint your tree vertices (vertex color) in your 3D app by hand.

The other way is to rig your trees and make them skeletal meshes, then make a wind swaying animation and play it when needed, with desired speed. But this solution will have more performance impact, because skeletal meshes with animations are heavier than static meshes.

Good luck with your foliage! :slight_smile:

Thanks for the answer.
Yes, I tried to do vertex colour, but the end result was really weird. Atleast with the way I made my material. It wasn’t “swaying”, but instead the tree was just dangling around like worm.
I’ll check out the content example, though. I was unaware that there was trees example there. Thank you for your advice.

Hello! I’d be grateful if you could accept the answer, if it helped. Thanks!