All works fine but one big problem. The Tut is using a Parameter Collection for a single object position, I’m trying to figure out how I can use multiple object locations?
The pivot point of each blade of grass in these tutorials is not set, so the deformation will be highly inaccurate.
If you notice (or try and replicate the top gif) you’ll see that the shape of the rectangle is maintained throughout the rotation with minimal distortion (math for this is prone to real low floating point errors since its very small, so there is some deformation).
If you were to attempt to fold over regular rectangles without the right code (or the code in this tutorial), the top plane would sheer off and distort differently than the sides.
That is why you need a specifically built mesh and a blender plugin to generate it.
For grass paritcularly, if you have any sort of complex geometry the code will make a large blob of mess that’s easy to notice upon displacement of larger almost completely flat areas.
The tutorials are a great starting point, particularly as they seem to be updated compared to 3 or 4 years ago when they first came out and included some different/wierder approaches (they could still be there, capturing trails from under the landacape is a no-no for many reasons)…
Another addition to this would be to actually cull grass with the RT. You can output into the alpha to make stuff “disappear”.
Which is great for removing grass when a player places buildable objects on the floor, for instance…
You still need a properly created mesh if you want to use vertex normal based displacement;
You do not if you pan normals instead.
All grass does - at a visible distance - when agitated by wind is change color/hue between lighter and darker based on what blades the sun catches.
That’s why panning a world position normal map into it provides a very decent effect at a super low cost (compared to actually moving verticies).
You could also combine the 2 effects, but they usually go off sync, so sticking to 1 or the other tends to provide more realism.
Vertex normals will affect all the grass. Even the engine simple wind and other things like it (a sine on time into vertex normal ws) will affect everything.
Masking it is kind of pointless since that is the effect you really want.
But, you can sphere mask the area of effect just the same.
Doing so could maybe help on limited GFX systems where vertex movement on large amount of instances causes GPU bottlenecks (a switch?). Realistically, you won’t get all that much of an improvement. The vertex calculations are super quick on the gpu…
I found a way to mask the effect using Dot Product and a Lerp. It might not be great but has enough affect for me, also decided to combine the scale and bend …
Probably ok.
Couple tips.
Make float 3 is pointless (extra cost for no reason) just make a float 3 parameter to use. You can manipulate the values individually anyway.
DistanceField gradient requires the project to have the proper settings. Remeber this if you ever move the asset.
Generally after you add, multiply etc. Before you feed the value in to a field that uses normalized values you should clamp the values out so they do not exceed 1.
I think this is applied to your vertex, so this wouldn’t necessarily apply.