SimpleGrassWind

Has anyone been able to use that material function?

See: https://docs.unrealengine/latest/KOR/Engine/Rendering/Materials/Functions/Reference/WorldPositionOffset/index.html

I think I didn’t quite get the setup right.

What are you doing with the result of this node? Plugging it into the World Position Offset just results in an error:

“Arithmetic between types float3 and float are undefined”

hm possibly it just outputs a varying ‘wind strength’ float…
Set up a vector something like (5,5,0) maybe and multiply it by the output.
Just a guess :wink:

You referring to the wind node? It outputs the raw data of the wind directional source in the level, the first three components of the vector indicate direction, the 4th indicates strength I believe.

You can’t simply plug it in to world position offset, you need to perform some kind of math operations on that information to get desired results.

EDIT: My mistake didn’t realise there was a pre-built function, I’m fairly sure you need to use the scalar value as a mask from top to bottom to get good results. Haven’t tried this yet

Okay, seems I made a little mistake… For windweight I was using a TextureObject to mask out the part of my foliage that was allowed to move. Putting in a scalar value it works. The result can be plugged into WPO directly.

Now there’s a different error: If I get to close to my object it disappears ^^

Going to look into this further… However, if anyone has a working example, feel free to post here :wink:

For me the simple grass wind node is working perfectly:

Yeah, that works fine. What doesn’t work for me is the WindWeight. In the doc it says you can use a greyscale map, maybe it just doesn’t mean what I think it means.

What I basically wanna do is mask out an area where the wind is applied, since I got an texture atlas where the trunk is included. Means your setup will give a jitter in the trunk, too. Doesn’t look to realistic :wink:

Next thing I tried was taking the result of the SimpleGrassWind and multiplying it against an alpha mask -> doesn’t work. But, if you do the same using tesselation and using World Displacement instead of World Offset it works.

The system works fine if your using single leafs as a texture, but for my case I guess I have to find another solution to make it look more real.

You could paint vertex colours in maya and then multiply simplegrasswind with vertexcolor and plug that into your worldpostitionoffset. If you make your trunk black and your leaves red then use the red channel in vertexcolour it would work, I think.

I was struggling with it as well and I discovered a very simple solution.
Instead of messing around with tesselation or vertex color, you can make a simple black and white mask (I used png and RGB) and multiply the simplegrass output with the mask and plugging the result into the worldpositionoffset.

For clarity sake here is my solution:
Simplegrass - A input of multiply Output - Material
Windmask - B input of Multiply