Download

Can someone explain what has to happen in order for a wind shader to work with foliage?

I have a wind shader that I’m happy with. I use it for all of my trees, bushes, flowers, grass, and even fabric. I just make different material instances with different textures and maybe slightly different settings, and everything moves similarly and I think it looks pretty good.

Now I’m trying to load my grass static mesh into the foliage tool, and it’s not working. I can make it work if there’s no movement at all. I can get the motion to look right, but then the mesh has kind of a ghosting effect, where there’s a dark mesh waving in one direction and a light mesh waving in the opposite direction. I think the problem might be with how I use my WorldPosition and Transform nodes, but I’m not sure how they’re supposed to work. You’re supposed to be able to get ObjectWorldPosition by transforming vect(0,0,0,1), but what about just plain WorldPosition?

WorldPosition works the same for regular meshes and instanced meshes (foliage)

getting positional effects working with foliage is a challenge but I’ve worked on such a thing before. if you have troubles post your material setup and I’ll try to have a look, if possible a gif of the problem as well