Are these leaves meshes or something else?

Looking at this video (at the 10 second mark) there’s an abundance of tree leaves/ vine leaves that sway in the wind.

Looking closely at the leaves, it looks like they’re a flat sheet, however they bend and shift around to simulate movement from wind. I’m wondering how this is accomplished and if such a feat is possible in Babylon from a performance pov (I suppose probably, with instances)?

My guesses are:

  • it’s a flat mesh and the movement is done with animations
  • (potentially crazy/off-base guess) it’s a texture that’s being bent/distorted somehow (possibly by using a shader?)

Yes, maybe instanced mesh with an animation in a shader. It’s quite easy to do a sine/cosine animation based on time. You can even had variation per instance.

1 Like

I think the most of it could be done with the help of spritesheets - Sprites | Babylon.js Documentation
And, of course, with shaders as well - https://www.babylonjs-playground.com/#4AEW8L#81

4 Likes