How to Add a Wind Effect to an Existing Material?

I have an existing material for a tree’s leaf. However, I want to add a wind effect to the leaf. Can I simply write a vertex shader for this existing material and integrate it, or do I have to create a new fragment shader and mimic the attributes of the existing material?

@Leonidas You’ve done some work like this for your projects?

Hi @Ertugrul_Cetin,

Yes, unless you have a very specific not to, use shader chunks and override transform.js to add your own time based animations (e.g. sin/cos based):

That way your material will continue supporting lighting/shadows and all other material properties.

We’ve done something similar in most of our demos that feature vegetation wind:


Thank you! Will have a look into this