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.
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.
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.
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.
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.
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!
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:
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.
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.
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.
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:
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:
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:
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.
This Auto-Landscape Material is a start and from which you would build onto but it contains few problems.
I cover how to do all of this and more in the "UE4: Auto-Landscape Material" tutorial 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:
You can download the complete tutorial course here with all the example files and start texturing your landscapes quickly, effortlessly and automatically.
All content on this website is copyrighted ©2008-2023 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