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:
2 Likes
Thank you! Will have a look into this
@Leonidas @Ertugrul_Cetin I am also looking at this exact feature. I would like to sway tree leaves or shrubs using vertex shaders. Were either of you successful? Are there any example scenes I can try?