Unreal Engine Landscape Paint Layers
Landscape paint layers are a major component you need to focus on when you are trying to create a level with near realism. In this article I will describe how to create and populate landscape paint layers.
Going straight,
How to create?
- Each landscape layer is created inside the Lanscape material you wish to assign to your landscape. For this, create a material by Right Click -> Material from the Create Basic Asset section.
2. Then you can rename your material and give it a name you prefer.
3. Double click and open the material.
4. In the material event graph, Rightclick-> Type LandscapeLayerCoords and press enter. This will take the coordinates of the landscape you create and map the material layers you will create.
5. Right click -> Type LayerBlend. And select The shown
6. Now you will get the layer list material expression where you will see an array of elements to be added on your wish! There you can decide which layers your landscape should contain.
Let’s say you need to create landscape layers as below
- Grass
- Stones
- Mud
- Trees
Then you will need 4 layers. (In an array that’ll be 0,1,2,3)
7. Click on the + mark in details panel, add your layers and name them
8. Then you have to assign each layer with a material which matches the layer. For an example, a grass texture matching to Grass layer. For this you’ll need a Texture sample.Right click-> Type Texture
9. Sample and press enterYou will receive a texture sample which is empty, where you can assign with a texture material. To get materials you can download textures from Quixel Megascans (https://quixel.com/megascans/) which has many high quality texture samples. When downloading textures, make sure they contain the layers such as Normals, Albedo, Displacement, Roughness etc. These are the color variations of same texture which you can use to make the texture look more realistic when applied.
Let’s first select the Albedo, which contains RGB texture. Then you can duplicate and select normals etc, according to your preference.
10. Make two more copies of the Layer blend
11. Now let’s repeat this for all the other layer textures
12. Now it’s just a matter of connecting. Connext landscapecoords to each textureUVs. Connect RGB of texture samples to Layer bend. Connect layer blend output to Material’s input as below.
Here, the texture with sample picture needs to be attached to base color, Normals to normals and Roughness texture nodes’s Layer blend to Roughness. Set 0 value parameter to Metallic and Specular to prevent glossy unnatural landscape materials. Save your material
13. Apply the landscape material to your landscape. Go to Landscape, Paint tab and you’ll see your layers.
14. But still the landscape will be blacked out. This is because we still haven’t created Landscape Layer Info. For this, click on + sign in front of your layers and select Weight_Blended layer. Select the path to create layer info, give the Layer info a name and click on OK.
Then you’ll be ab;e to see landscape layers.
What are landscape masks?
A landscape mask or a custom landscape layer is an image you can use to display the different layers. These layers have to be created monochrome, or black and white. The Whites represent the areas which the layer has to applied and blacks represent the areas to be prevented by the layer.
The landscape mask has to be in the same resolution as the landscape. You can get the landscape resolution when you select Landscape from world outliner and g to details panel’s Information tab.
I have created a set of sample masks for testing out the created texture.
Let’s try applying them to our landscape
Steps:
- Right click on the layer you need to import Mask to and select import from file
2. Select the mask and Click on open.Then the mask will be applied.
Adding mesh assets to layers.
The meshes such as grass plants to grass areas can be added from the material itself. For this,
Right click on content browser, select foliage->Landscape Grass Type. Open the created asset and click on + to add assets as much as you like in any density you want. Save the asset.
Go to your landscape material and right click->Landscape Gras Output.
Right click->Type Landscape Layer Wight and enter. Give it the same name as paint layer name. In Grass Type’s details panel, select the grass type you created earlier. Save material.
Then you’ll see a nice grassland in the landscape. You can use your creative thinking to get near realistic landscapes.
Below is a very simple landscape created with different materials.
Tips: When you try to rename an already exsisting landscape layer in UE 4.26 and down versions they will be replicated instead of renaming, which will cause to create a new layer in renamed name and the original layer to prevail. This was fixed in UE 4.27