Unreal Engine 5 & 4 · How to use

Landscape Auto Material

A complete guide — from first setup to automatic grass, water caustics, optimization and advanced parameters.

On this page

Setup

  1. Add the Landscape Auto Material package to your project.
  2. Duplicate the master material instance Landscape_Automaterial_Inst from Content/LandscapeAutoMaterial/Materials/LandscapeAutoMaterial.
  3. Apply your copy of the instance to the Landscape actor in your level.
  4. Set up the GlobalScale parameter in the material instance to suit your landscape size.
  5. If you want to use additional weighted-blended layers, paint the whole landscape with the Auto layer first. Nothing appears to happen, but this is required for proper weighted-blend behaviour.
  6. Done!

Texture preferences

You can enable or disable the various texture inputs (albedo, roughness, height-mask, etc.) and link the texture references you want.

Attention: switching boolean parameters in the master material shader starts a compilation. It is strongly recommended to switch boolean parameters in an empty scene to avoid excessive shader recompilation.

Common parameters

The 01 Planar group holds the basic parameters that are shared by every other material layer — the common starting point for tuning a layer.

Types of landscape layers

All basic materials are weight-blended layers. Only overlay layers — such as coloring, caustics and the foliage-eraser layers — are non-weight-blended.

So if you paint a weight-blended layer on top of a non-weight-blended layer, the non-weight-blended layer still exists. To clear a non-weight-blended layer you have to erase its painting using click + shift erase painting.

Automatic grass meshes

By default, auto-grass meshes are generated on the Planar material layer. See Advanced parameters if you want to generate auto-grass on a different additional layer.

Attention: changes to auto-grass parameters in the master material instance do not update automatically in the viewport. After changing parameters, modify any GrassType object in the scene — for example, check and uncheck the Grid checkbox. This is due to a UE4 limitation: parameters linked with LandscapeGrassOutput aren't visible in the material instance, so there is a workaround built into the material structure.

You can set up auto-grass meshes in these GrassType objects:

  • Default grass (black in splat mask) — /Game/LandscapeAutoMaterial/Meshes/Grass/Grass_01
  • Small formations (blue in splat mask) — /Meshes/Grass/Grass_02
  • Medium formations (yellow in splat mask) — /Meshes/Bushes/Bushes_01
  • Big formations (red in splat mask) — /Meshes/Stones/Stones_01
  • Splatmask/Textures/Generic/SplatterMask_D

Currently you can't set up grass-output actors directly in the master material instance, because UE4 doesn't implement that. Instead, modify a copy of the master material and set up different Landscape Grass Types in the Grass Output node.

Water caustics

A non-weight-blended overlay layer that imitates water caustics projected onto the landscape.

Optimization

Use these schemes to boost your FPS:

  1. Turn off Tessellation in the master material (it hits performance on huge landscapes): .../LandscapeAutoMaterial/Landscape_Automaterial_M.
  2. Set the LODDistance Factor in landscape preferences — e.g. 2.5 with Square-Root LOD Falloff in a fly-by scene.
  3. Turn cast-shadows off for all 3rd-LOD grass meshes.
  4. Tweak grass LOD distances (the Screen Size parameter) to trade quality against performance. You can also disable 2nd-LOD shadows and raise the 1st-LOD distance.
  5. Set a lower grass density in the Grass Type settings for grass and bushes.
  6. Set Start and End cull distances for grass more efficiently.
  7. Disable unused additional layers in the master material instance: 00 SETUP \ Layer_N_Enabled = false.
  8. Decrease the auto-grass density multiplier: 00 SETUP \ Planar_Foliage_Generation_Density = 0.5 (default 1).

Advanced parameters & limitations

Extra customization of blending and tessellation parameters. All parameters are sorted into groups in the master material instance Landscape_Automaterial_Inst.

  • Texture limits. On SM5 (PC, consoles) you can use up to 128 textures in a landscape material; on SM3 the maximum is 16. You can pack channels from several textures into one to reduce samplers. On a Mac (non-SM5) reduce the used textures to 16 by turning off some material layers in Landscape_Automaterial_Inst — disable Layer1_Enabled, Layer2_Enabled, Layer3_Enabled and Slopes_Use_HeightVariation, and the shader will compile successfully.
  • Dynamic light. Landscape grass output (auto-generated grass) is available only with a Dynamic Light setup (like Epic's Kite Demo). To force dynamic light, turn off Allow static lighting in project settings.
  • Grass collision. UE4 Landscape Output can't generate collision for grass meshes for performance reasons. Work around it by placing unique collision for large geometry by hand.
Watch

Video walkthrough

Get Landscape Auto Material

Everything you need to paint beautiful terrain, fast.