Language:
Page Info
Engine Version:

4. Creating Landscape Materials

Choose your OS:

Folder Setup

Now that we have finished sculpting out the Landscape, it is now time to add some Materials to it so that it will better resemble something that we would see in the real world. But before we do this, let us first setup some folders so that the content that we create and migrate has somewhere to be stored. For this section of the tutorial, we are going to be making the following four folders.

If you would like to know more about how to setup folders in Unreal Engine 4, please refer to the following page about Folders .

  1. Landscape

  2. Materials

  3. Resources

  4. Textures

When completed, you should have something that looks like the following.

T_Landscape_Folders.png

Migrating Textures

Now that we have the folders in place, it is time to Migrate some Textures from the Landscape Content Example project so that we have some Textures to work with. If you would like to know more about how to Migrate content from one project to another one, please refer to the following page on how to Migrate Content

When Migrating content between projects, you could possibly end up with additional folders that you do not want. To fix this, select the Textures that you want inside of the Content Browser and then drag them from their current location into the folder that you want them to be placed in. This is purely a house keeping step and will have no impact on the outcome of the tutorial.

You can find the textures located in the following folder located in the Landscapes Content example project.

/Game/ExampleContent/Landscapes/Textures/

The Textures that we will be Migrating over from the Landscape Content Example project are as follows.

  1. T_ForestGround_D

  2. T_ForestGround_N

  3. T_GroundGrass_D

  4. T_GroundGrass_N

  5. T_Noise_N

Once you have the textures migrated over, make sure they are placed in the Textures folder that was created in the steps above. Once that has been completed, it is now time to create our Material for the Landscape.

Creating the Landscape Material

Creating a Material for our Landscape can be done in the following steps.

  1. Navigate to the Materials folder.

  2. Right-click in the Content Browser and select Material from the Basic Assets list.

  3. Name the newly created Material something that will allow you to easily find it like Landscape_Material for example.

If you have not done so already, please check out the Materials pages to gain a more in-depth understanding of how materials work inside of Unreal Engine 4.

Once this has been completed, you should have something that looks like this.

T_Landscape_Create_New_Material.png

With our new Landscape Material created, open up the Material by Double-clicking on it inside of the Content Browser. When you do, you should see something like this come up on the screen.

T_Landscape_Blank_Material.png

Now before we begin laying down nodes in the Material Editor, we first need to make sure that we set this Material up so that it can be used with Landscapes. To do this, navigate to the Usage section in the Details panel and check the Used with Landscape checkmark box. This will enable this Material to be used with Landscapes and save you additional Material compile times.

T_Landscape_Materail_Usage.png

Now with the Used with Landscape Usage flag set, it is now time to start laying down nodes inside of the Material Editor. The first node that you are going to want to lay down is a LandscapeLayerCoords UV node. This node will help to generate UV cords that can be used to map the Material network to the Landscape Terrain.

T_Landscape_UVCords.png

The easiest way to find nodes specific to Landscape is to search for them in the Materials Palette box using Landscape as the key word.

T_Landscape_Material_Search.png

The next Material nodes that we are going to lay down are going to be for the textures for the ground's Base Color and Normal maps. For the snow, we are just going to use a Vector Parameter (V + Left-click) that uses an off White color. To make sure that no Metallic information is used, a Constant (1 + Left-click) of 0 is used and plugged into the Metallic input. Finally, for the Roughness, we set a Scalar Parameter (S + Left-click) so that this value can be tweaked via a Material Instance later on. Finally make sure that you hook up the LandscapeCoords to the UV's of each of the Texture Samples. When completed, you should have something that looks like this.

T_Landscape_Material_00.png

To add the Texture Sample nodes for the various textures, first select the desired texture in the Content Browser and then press T + Left-click in the Material Editor's graph to create the node.

To find more information about these keybindings, please navigate to the Edit > Editor Preferences > Keyboard Shortcuts window and select the Material Editor - Spawn Nodes section.

Number

Texture Name

1

T_ForestGround_D

2

T_Ground_Grass_D

3

T_ForestGround_N

4

T_Ground_Grass_N

5

T_Noise_N

After the Material nodes have been laid down and the LandscapeCoords connected to the textures UVs, it is now time to add and setup the Landscape Layer Blend node. This node is used to blend all of the textures that are used for the Landscape so that they can be painted on the Landscape individually using the Landscape Painting tools. The following table shows what Textures are associated with which Layer Name and what Blend Type they use.

When you first place down a Landscape Layer Blend node, it will be blank like in the image labeled one. To add Layers to it, you need to first select the node in the Material Graph and then in the Details panel, click on the Plus icon that is in-between the word Elements and the Trash Can icon. This icon is highlighted yellow in the image with the number two on it. Depending on home many textures you are using will determine home many Layers you will want to have.

T_Landscape_MLB_Node.png T_Landscape_Adding_Layers_To_MLB_Node.png

Layer Blend Base Color

Texture

Layer Name

Blend Type

Preview Weight

T_ForestGround_D

Soil

LB Weight Blend

1.0

T_Ground_Grass_D

Grass

LB Height Blend

0.0

Snow as a Vector 3

Snow

LB Height Blend

0.0

T_Landscape_Layer_Blend_BC.png

Layer Blend Normal

Texture

Layer Name

Blend Type

Preview Weight

T_ForestGround_N

Soil

LB Weight Blend

1.0

T_Ground_Grass_N

Grass

LB Height Blend

0.0

T_Noise_N

Snow

LB Weight Blend

0.0

T_Landscape_Layer_Blend_N.png

For more in-depth information about using the Landscape Layer Blend node, please read the Terrain Expressions page.

Once the Layer Blend nodes have been set up, it is time to connect the Texture maps to them. When completed, you should have something that looks like the following.

T_Landscape_Material_Final.png

The material connections were colored in Photoshop to help you better understand were everything needed to be connected. Currently there is no way to change the color of lines connecting Material nodes inside of Unreal Engine 4.