I’ve been working for a couple of weeks now on trying to get a field of grass running in UE4. I’ve been through all the tutorials and read all the forum posts I can find on the topic, but am finding it a frustrating task.
Because I’m developing a VR game, I’ve discounted billboard grass entirely since this never seemed to look good in stereo vision. Instead I have geometry for all my grass, with multiple blades of a small number of quads per instance at 4 LODs. I also have geometry flowers in the grass that use Opacity Mask for the petals, so even though my grass blades can be Opaque, I need a method to suit my flowers too. And because of the VR requirement, I have twice the scene-rendering hit, so my LOD and culling strategy for the grass has to be pretty good.
The main issue I have is how to cull the grass in the distance nicely. I can set the Landscape folliage cull to start at 4000 and end at 5000, but this culls the entire block of grass and not the instances. We are told to use PerInstanceFadeAmount to fade our models over this distance, which is great. However, currently you cannot use Transparent as a Blend Model for grass, which means you have no Opacity to plug the value into.
One workaround is to multiply it with your Alpha mask and plug it into Opacity Mask, but this means that you get a sudden cull point per instance and not a nice gradual fade. It looks a lot nicer than a whole block of grass appearing from nowhere, however. This is currently my best solution.
I came up with an interesting concept of using PerInstanceFadeAmount to lower each vertex in the grass so that the grass faded back into the ground in the distance, but depending on the terrain slope this looked a little bit like the grass was sprouting magically out of the ground before you. And while this sort of worked with the grass (fading into the landscape texture), it was not so great at successfully fading a bright yellow flower in that grass. Because what would be awesome is actually fading the flower or grass in with opacity, if that were possible.
I’ve also spent many, many hours frustratingly fiddling with Subsurface, because there are the odd forum posts that mention it as a means to get both Opacity Masking for petals, and Opacity for fading the model out. I must not understand Subsurface because I could not get this to work at all, and nothing I tried made the instance at all transparent.
Can anyone share any tips on getting PerInstanceFadeAmount to actually fade grass instances?