Recently I am working on learning Unity because so many of my clients, insist on attempting to make open world games with it. Excuse the bad grass texture, it was made for this test and is a very quickly made asset; I used very little grass on the textures because I wanted to test the alpha sorting.
So my goal is to achieve the same kind of grass density as Unreal, 10500 Meshes, more than 672000 triangles:
So first I used the Add Detail Mesh option, I used Lod3 for this because Unity doesn't Lod for it's detail meshes 5000 Meshes, 320000 triangles:
The fact that it doesn't align the grass to the terrain normal is irritating.
From this image you can see that it covers very well in the distance, because that was what Lod3 was made for. Even with no shadows it hit 62FPS on my mid range PC. I find that Unity developers often aim to get as many players as they can, so mid range is what I am aiming for.
There is lot wrong with this kind of grass, however with some baked shading and proper textures this could work. The problem is that there is bold spots, the worst being near the camera. Culling had to be set higher to gain back some frames. The worst about this is the lack of real control.
I must be doing something wrong, because if I had to think of the worst tool for distributing grass, then Unity's detail mesh is a very strong contender. Does anyone know how this tool is intended to work, because the wiki and tutorials use it the same way I did here?
I knew I could get better coverage by just having a Lod so I turned to the Unity tree details as it does have Lod, 3800 Meshes more than 243200 triangles:
[spoiler] [/spoiler]
This is almost 25% less meshes and covers the level much better. The Lod0, Lod1, Lod2 mesh is 256, 128, 64 triangles. The Frames is 65 FPS, I added real time shadows and used a much more complex shader (although I only made the Albedo for it.).
At first I thought this was a way to fix my grass problem, except some profiling revealed a lot of downsides, because Unity thinks each of these are a threes and creates collisions, reflection spheres and a billboard for each. The funny part is that the grass is culled before the billboard is used.
The Reflections can be set to bake, although it still kills the editor, at least the game is smooth. Collisions is easy to turn off once I realize they existed I can't find where to turn off the billboard.
The billboard should in theory have saved some frames when used, except that at this point the amount of batches where slowing the performance not the vertex count, so culling the grass is a better option.
I apologize if this was a bit long, I can't believe that Unity's terrain tools is this bad. I am hopping that some of the Unity users can shed some light as google has been unable to.
Something I have been considering is abandoning the terrain tools, it appears that the only performance gain is from batching and using static meshes will give me more control and still have batching; although there could maybe be some performance gain from using grass that I am not aware of.