M⁴ Documentation

  1. Home
  2. Docs
  3. M⁴ Documentation
  4. 🌿 Procedural Foliage Spawning
  5. Landscape Grass Type System

Landscape Grass Type System

M4 uses a feature called Landscape Grass Type to handle it’s Procedural Foliage Spawning. This is an insanely fast feature which allows you to spawn foliage onto the terrain at runtime. It’s already set up to work fully with the materials, all you have to do is swap out or add meshes to the mix to get different foliage to spawn on the different layers.

This system is capable of spawning foliage on the Grass texturing (Flatland A) and Dirt texturing (Flatland B) of the Landscape’s Flatlands, as well, it can spawn different foliage for Paint Layers, the Beach and even the wet area of the Beach, while automatically ignoring slopes in the process. It’s set up for every Biome too, so feel free to experiment.




Go to the “M4/Foliage/ProceduralPlacers/Island” folder in the Content Browser. In there you’ll find four files – these correspond to different parts of the Flatlands. Below are the file names with a description of each.



Island_FlatlandA – This is used to spawn foliage on the Auto grass layer that you see on the Island’s texturing.

Island_FlatlandB – This is used to spawn foliage on the Auto dirt layer of the Island’s texturing.

Island_FlatlandRandom – This is used to spawn foliage in a random noise pattern across the Island’s flat areas. (Generally used for weeds)

Island_EdgeOfSlope – This is used to spawn foliage around the edge of slope regions, can also be used to spawn foliage on the slopes themselves.

Note: these files were called something else in older versions of the project (pre V1.58), to see this doc in its older state, with the old file names, click here.



Once you open one of these files, you’ll see a list of numbers that can be expanded, from there you can change things like Density, Mesh, Scaling, Rotation, etc.

The other folders in the “M4/Foliage/ProceduralSpawners” folder are for each of the Biomes and there’s a set for the Paint Layers and Beach area too. They will spawn foliage for their specific layer and they’re all set up in a similar way.


Adjusting Foliage Masking

Mask settings that control where the foliage for each layer spawns, can be found in the Landscape’s Material Instance under the Group called “Procedural Foliage (Landscape Grasstype)”.

In general, the default settings found here are fine to just leave as default, they’re only there if you’d like to customize them to your specific need. Things like control over the spawning slope detection, masking contrast (for the layers), etc. can be found here. As well there are toggles to turn the Landscape Grass Type System on/off completely for each Biome/Preset.

Landscape Grass Type Limitations:

Because Landscape Grass Type spawns grass and foliage at Runtime and is meant to do this as fast as possible, collision does not work with any Landscape Grass Type System in Unreal Engine 4 or 5. You shouldn’t try to spawn Trees or Large rocks, for example, using this system as it’s meant for smaller foliage – like grass, little rocks, flowers, sea shells, etc. because these do not require collision.

If you’d like to spawn larger object procedurally it’s best to either paint them on using the foliage painter or use a “Procedural Foliage Volume”, this will allow you to have collision on these objects.

How can we help?