WoLD Archives Search About Contact

World of Level Design

Tutorials to Becoming the Best Level Designer and Game Environment Artist (since 2008)

UE4: How to Create Your First Procedural Auto-Landscape Material

Category: UE4
November 10, 2020

Using Auto-Landscape Materials for large terrains is a must for any open-world environments. It will let you automatically texture landscapes based on the slope (angle) of the terrain.

But how do you create and use one?

In this in-depth tutorial I will show you how to create your own very first Auto-Landscape Material.

Video Tutorial

Step 1: New Material

In Content Browser, click on Add New and choose Material:

Name it. I named mine MAT_FirstAutoMat.

Right away I want to create a Material Instance so I can make adjustments to this Material and see updates in real-time. Inside the Content Browser, Right Click on MAT_FirstAutoMat and choose Create Material Instance, then name it:

We'll get back to the Material Instance later in Step 8.

Step 2: World Aligned Blend

The basis of all Auto-Landscape Materials I create is World Aligned Blend node.

Double click on the Material to open Material Editor.

Inside the Material Editor, Right-Click in the empty space then search to insert World Aligned Blend node.

The two important properties you need to control are Blend Sharpness and Blend Bias.

  • Blend Sharpness: controls the blend sharpness between the two textures
  • Blend Bias: controls the slope or the incline (you'll want to keep this value in the negative range)

Insert two Constant1Vectors. Set default values to start with for each Constant1Vector. I will set Blend Sharpness to 15 and Blend Bias to -5:

Connect first Constant1Vector into Blend Sharpness and second Constant1Vector into Blend Bias:

Next you need a Linear Interpolate (Lerp) node.

Connect Alpha output from World Aligned Blend into Lerp Alpha. Then Lerp output into Base Color of the Material:

This is the fundamental setup for Auto-Landscape Material.

Lerp A and B would take color or texture inputs. Right now we don't have anything plugged into them so Lerp will display Black/White values.

  • A = 0 (black)
  • B = 1 (white)

Before we test lets convert two Constant1Vectors to parameters so we can adjust them through the Material Instance. Right Click on Blend Sharpness and choose Convert to Parameter. Give this parameter a name. Default value will be kept at 15. Repeat for Blend Bias.

Apply, Save and test.

Step 3: First Auto-Landscape Material Test

You need to have a terrain with some hills, valleys and peaks to apply the Material onto. Here is what I have:

For Auto-Landscape Materials you do not need to create Layer Info as you would with regular landscape materials. Simply assign a Material onto the landscape and it will begin to work.

Select the Landscape and go into the Details Panel. Under Landscape Material search for Auto-Landscape Material Instance. We are going to assign the Material Instance rather than the Master Material. This way we can adjust the parameters in real-time without having to save and compile the Material every time.

Once you assign the Material Instance, black/white colors will appear on your terrain. Again these black/white colors come from the Linear Interpolate A and B inputs which are undefined at the moment. So by default Lerp will produce black/white colors.

Open the Material Instance and begin to adjust Blend Sharpness and Blend Bias to see how it affects the distribution of the Auto-Material on the terrain slopes. Remember to keep Blend Bias in the negative range.

I changed Blend Sharpness to 13 and Blend Bias to -4:

The Auto-Landscape Material works!

Step 4: Introducing Terrain Color (Constant3Vectors)

Let's introduce some color into the landscape. Right now we have Lerp default black/white values.

Insert two Constant3Vectors. Connect first Constant3Vector into Lerp A and second Constant3Vector into Lerp B. Change the color of each to whatever you like:

  • Lerp A = Slope Color
  • Lerp B = Flat Color

Right Click on each Constant3Vectors and choose Convert to Parameter:

I named mine Color1 and Color2:

Apply, Save and test:

Solid colors are great but you want to have actual textures.

Step 5: Using Albedo/Diffuse Textures (Constant3Vectors)

Starter Content has good textures you can use or you can use Quixel's Bridge textures.

Bring the Albedo textures into the Material Editor. You can do this by Left Click and Drag from the Content Browser right into the Material Editor. They will be inserted as Texture Sample nodes:

Replace Constant3Vectors with Albedo textures. Connect the first into Lerp A and second into Lerp B. If you want to create parameters for the Albedo textures to change in the Material Instance then Right Click on each Texture Sample and choose Convert to Parameter. Then name each parameter. I named mine Albedo1 and Albedo2.

  • Lerp A = Slope Texture
  • Lerp B = Flat Texture

Apply, Save and test:

If you need to reverse the textures for how they appear on your landscape, go back to Material Editor and swap Texture Samples in Lerp A and B.

Step 6: Adding Normal Maps

Every landscape material should have Normal Maps along with Albedo/Diffuse textures.

Insert Normal Maps that match the Albedo textures into the Material Editor. Again, you can Left Click and Drag the Normal Maps from Content Browser into the Material Editor the same way as you did with Albedo textures.

Insert a Linear Interpolate (Lerp) and connect both Normal Maps into Lerp A and B. Make sure that whatever Albedo texture you have plugged into Lerp A and B matches the Normal Maps Lerp A and B.

We will use the same World Aligned Blend for Normal Map setup.

If you plug the Alpha output from World Aligned Blend Alpha output into Lerp Alpha that contains Normal Maps, it will give you an error:

To fix this you must use the other 2 output options:

  • w/Vertex Normals
  • w/Explicit Normal

The one I use is w/Vertex Normals.

Take w/Vertex Normals output from World Aligned Blend and connect into Normal Map Lerp Alpha. Then connect Lerp output into Normals input of the Material:

Apply, Save and test.

Unfortunately, you will see very noticeable artifacts show up on your terrain:

To fix this, use w/Vertex Normal output for Albedo texture setup:

Important: if you are going to include Normal Maps with your Auto-Landscape Material setup (which will be almost always, unless it is a stylized terrain), you have to use w/Vertex Normal output from World Aligned Blend for both Albedo and Normal Map.

Here are the results after using w/Vertex Normal output for both Lerps:

If you want to create parameters for the Normal Map textures to change in the Material Instance just like we did for the Albedo then Right Click on each Normal Map Texture Sample and Convert to Parameter. Name each parameter, I named mine Normal1 and Normal2:

Step 7: Adding Roughness

Last setup we need is Roughness controls for each texture. Right now the terrain is too shiny and reflective.

Insert another Linear Interpolate and two Constant1Vectors.

Connect first Constant1Vector into Lerp A and second Constant1Vector into Lerp B. Also, Right Click on each Constant1Vector and Convert to Parameter. I named each parameter to Roughness1 and Roughness2 and gave a default value of .9.

Then take the output w/Vertex Normal from World Aligned Blend and connect it into Roughness's Lerp Alpha. Then connect Lerp output into Roughness input of the Material.

This will give a rough or not very shiny appearance to each texture. Most of the terrain textures won't reflect much light and should be matte. You'll be able to adjust this value in the Material Instance if needed.

Apply, Save and test:

Step 8: Material Instance

We already created a Material Instance and assigned it onto the Landscape in Step 1 and 2. So we have parameters to control such as changing Albedo and Normal Map textures, Blend Sharpness, Blend Bias and Roughness controls for each texture.

If you double click on the Material Instance, you will see the properties open up and all the parameters will be available for you to adjust:

Use the Material Instance parameters to adjust how the material appears on the landscape.

Current Material Problems

This Auto-Landscape Material is a start and from which you would build onto but it contains few problems.

  • No texture tiling
  • Lack controls for texture blend
  • No spawning foliage
  • No paintable manual texture layers

I cover how to do all of this and more in the "UE4: Auto-Landscape Material" tutorial course.

Next Tutorial

UE4: 9 Things Every Auto-Landscape Material Must Have.

Complete "UE4: Auto-Landscape Material" Course

Creating the above setup is a starting point for an Auto-Landscape Material. It will give you the fundamental setup but you'll need more.

Auto-Landscape Material needs the following:

  • Automatically spawn foliage on auto-landscape textures
  • Adding auto-textures based on height
  • Ability to paint manual texture layers on top of auto-landscape material for detail or pathways
  • Control tiling near and far away to remove texture repetition
  • Ability to adjust edge intensity and edge mask
  • Ability to adjust Albedo tint and shade (brightness and darkness)
  • Ability to adjust Albedo color changes
  • And be able to problem solve with many of the issues that come up during this process

You can download the complete tutorial course here with all the example files and start texturing your landscapes quickly, effortlessly and automatically.

SUBSCRIBE & GET FREE UE5 PDF GUIDE

Subscribe to receive NEW/UPDATED and FREE "UE5 Beginner's Quick Start Guide" PDF (90 pages).

Subscribe and Get Free UE5 PDF Guide

Visit this page for more info about the guide...


Follow WoLD




UE5 FUNDAMENTALS VOL.1 COURSE


UE5: RETRO OFFICE PROJECT


LEARN THE PREPRODUCTION PROCESS


ABOUT WoLD & ALEXG

About World of Level Design

My name is AlexG. I am self-taught level designer, game environment artist and the creator of World of Level Design.com. I've learned everything I know from personal experimentation and decades of being around various online communities of fellow environment artist and level designers. On World of Level Design you will find tutorials to make you become the best level designer and game environment artist.

Read More »


Home Terms of Use/Trademarks/Disclaimers Privacy Policy Donate About Contact

All content on this website is copyrighted ©2008-2024 World of Level Design LLC. All rights reserved.
Duplication and distribution is illegal and strictly prohibited.

World of Level Design LLC is an independent company. World of Level Design website, its tutorials and products are not endorsed, sponsored or approved by any mentioned companies on this website in any way. All content is based on my own personal experimentation, experience and opinion. World of Level Design™ and 11 Day Level Design™ are trademarks of AlexG.

Template powered by w3.css