How can I implement a wave shader for my tree?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Shlopynoobnoob

I saw this Animating thousands of fish but when I tried this:

void vertex() {
    float time = TIME * 1.0;
    float body = (VERTEX.z + 1.0);
    VERTEX.x += cos(time + body) * 0.0003;
}

the whole tree moves, I want the tree to move like this:

https://i.redd.it/af5n2nzeavq51.gif

not like this:

https://i.redd.it/n86qul1navq51.gif

Hi,
have you take the scale of your tree in account?
maybe the sin wave is to large or to small.

klaas | 2020-10-03 17:58