Hi,
I see two main ways to render lots of static meshes on a landscape. One way is I can use Grass Layers on the landscape material, and the other is to use a procedural foliage spawner.
Each way takes a static mesh and seems to use the same rendering technique of instancing. But the procedural foliage spawner offers finer tune control compared to using Grass Layers.
Is there a reason then to use Grass Layers? Is there a difference in the way items are rendered? Or is it just two different tools to accomplish same task?
Hi,
Is there a reason then to use Grass
Layers?
Procedural Foliage Spawner uses HISMCs, so each instance has its own location, rotation and transform (which means you have fine control over placement of each instance). But that also means you need to have all this data somewhere in memory and on the disk. I don’t know the exact numbers, but if you assume that each entry in the location/rotation/scale is 32 bit float, you get 9 times 32 bit, so 36 byte per instance. If you have 100 grass instances per square meter and the landscape would be 1009x1009 meters, then that would result in 3.6 gigabytes, so in this case using procedural foliage spawner would be a bad idea.
Grass Layer has its data in textures each the same size as the landscape (so if you landscape would be 1009x1009 meters/vertices, then the textures would have that same size). It doesn’t offer you fine grade control over placement but you have the placement data inside that single texture, so you can fill your landscape with grass without the need of crazy amounts of memory/disk space.
So if you need fine grade control over placement (and don’t use it for millions of instances), then procedural foliage spawner / foliage painter is fine. If you need to fill large amounts of area, then landscape grass layer would be the better choice (you can ofc then go over it by hand and add instances with the foliage painter in specific locations).
Fantastic answer, thank you!