- Landscape Materials
- Setting up materials to work with Landscape terrains
- Layer Weights and Ordering
- Landscape Specific Material Nodes
- Landscape Layer Blend Node
- Blending Layers
- Landscape Layer Coords Node
- Landscape Layer Switch Node
- Landscape Layer Weight Node
- Landscape Visibility Mask Node
- Landscape Layer Blend Types
- Landscape Layer Blend Technical Information
- Tessellation and Displacement
- Mobile Landscape Materials
- Using Layer Blending
- Using Landscape Layer Weight Nodes
- Using Landscape Layer Blend Nodes
- Creating Landscape Hole Materials
- Assigning Materials to Landscapes
- Assigning a Landscape Hole Material to a Landscape
Setting up materials to work with Landscape terrains
Choose your operating system:
Although any random Material can be used with a Landscape Actor, the Material system inside Unreal Engine 4 (UE4) provides some Landscape-specific material nodes that can help improve the textures for your Landscape. In this document, we explain how these material nodes function, and how you can use them in your Landscape materials.
You modify Materials for use with Landscapes the same way you modify other Materials, in the Material Editor .
Layer Weights and Ordering
Landscapes use weight blending rather than alpha blending, so the blend factors for all layers at any location will add up to 1.0. Alpha blending is useful because it does not depend on order, so you can paint any layer at any time. Additionally, when you use alpha blending the alpha layer weight is increased, while other existing layer weights are decreased.
However, the disadvantage to using alpha blending is that when one layer is painted to 100%, the weight value for all other layers will be 0%. This is shown when using the Paint tool to remove a layer that is already at 100%. Because the other layers are at 0%, the tool has nothing available to replace the 100% layer you are removing, so it appears as if the layer was not changed.
Landscape Specific Material Nodes
Inside of the Material Editor, there are six specific nodes that can be used with the Landscape system. You can find all these nodes in the Palette menu, under the Landscape category.
Landscape Layer Blend Node
The LandscapeLayerBlend node enables you to blend together multiple Textures or Material networks so that they can be used as Landscape layers. The LandscapeLayerBlend uses an array to store information about the Landscape layers. To add layers to this array, select the plus sign icon.
When you add multiple layers to the LandscapeLayerBlend node, the Layer Names populate in the LandscapeLayerBlend node.
The list of layers the node contains. You can add layers by clicking the plus icon (
These are what additional layers look like when they are collapsed.
The unique name that you give the layer. The Layer Name corresponds to the layer name used in Paint mode in the Landscape tool window.
Either LB_AlphaBlend, LB_HeightBlend, or LB_WeightBlend. See Landscape Layer Blend Types on this page.
This is the weight value for the layer to preview the blending in the Material Editor.
Const Layer Input
This is for supplying a numeric value as a color to use in case you do not want to use a texture. This is mainly used for debugging a layer if there is an issue.
Const Height Input
This is for supplying a numeric value as a height in case you do not want to use a texture.
The following table details the Layer Blend node inputs and outputs.
Each layer adds an input for the layer to blend together. This input is only available after layers are added and named in the Details panel.
This is where you supply a height map to blend with. This input is only visible on layers that have their Blend Type property set to LB_HeightBlend.
The result of the layers blended together.
When using certain combinations of layer blend modes you could end up with black spots all over your Landscape where different layers meet. This problem is especially prevalent when using the LB_HeightBlend mode for multiple Landscape layers. LB_HeightBlend works by modulating the blend factor, or weight, for the layer using the specified height value. When you have multiple layers painted on an area and they all are set to LB_HeightBlend, it is possible that all the layers painted in a particular area will simultaneously have a 0 height value, so the desired blend factor for each layer becomes 0.
Because there is no implicit or explicit ordering, the result will be black spots because no layers will have any contribution to that area. The situation is worse when you are blending a Normal map, because it results in a Normal value of (0,0,0) which is not valid and will cause rendering problems with the lighting. The solution to this problem is to use LB_AlphaBlend for one of the layers like in the example below.
In the left image, all layers are LB_HeightBlend, causing some areas to be black. On the right, the red «1» layer has been changed to use LB_AlphaBlend, which solves the problem.
Below is an example of the properties of the Landscape Layer Blend node for all the layers being blended together. Make sure to note how the Soil layer has its blend mode set to LB_AlphaBlend while the other layers have theirs set to LB_HeightBlend. This is to stop the issue mentioned above (having black spots where layers meet) from happening.
If you need to delete a layer, click the drop-down arrow to the right of the layer’s element number to open the menu, and select Delete.
Landscape Layer Coords Node
The LandscapeLayerCoords node generates UV coordinates that can be used to map Material networks to Landscape terrains.
The ELandscapeCoordMappingType that specifies the orientation to use when mapping the Material (or network) to the Landscape.
The mapping place to use on the terrain. The CustomUVType outputs the UV coordinates to map the Material to the Landscape based on the given property values.
Applies uniform scaling to the UV coordinates.
Applies the rotation, in degrees, to the UV coordinates.
Mapping Pan [U]
Applies the offset in the [U] direction to the UV coordinates.
Mapping Pan [V]
Applies the offset in the [V] direction to the UV coordinates.
Outputs the UV coordinates to map the material to the Landscape based on the given property values.
Landscape Layer Switch Node
The LandscapeLayerSwitch node allows you to exclude some Material operations when a particular layer is not contributing to a region of the Landscape. This allows you to optimize your Material by removing calculations that are not necessary when a particular layer’s weight is zero.
The unique name that you give to the parameter.
If checked, uses a preview.
When the layer specified in the node’s properties is in use by the current region of the Landscape.
When the layer is not used by the current region of the Landscape and has a weight of zero.
Either the LayerUsed or LayerNotUsed inputs, depending on whether or not the layer contributes to the particular region of the Landscape.
Landscape Layer Weight Node
The LandscapeLayerWeight expression allows Material networks to be blended based on the weight for the associated layer obtained from the Landscape the Material.The weight for this layer is used as the alpha value for blending the two input networks.
The unique name that you give to the parameter.
The weight to use for preview purposes in the Material Editor.
You can specify a base color here that you would like for your Landscape to have
The network to blend this layer with. This is generally the result of any previous layer blending, but can be empty if this is the first layer.
The network to blend together to create this layer.
Outputs the result of the blending between the Base and Layer inputs based on the layer weights of the layers involved.
Landscape Visibility Mask Node
The LandscapeVisibilityMask node removes visible parts of your Landscape, so you can create holes in your landscape to, for example, create caves.
Outputs the visibility mask properties.
Make sure the output is connected to the Opacity Mask slot of your Material and that the Materials Blend Mode is set to Masked. Otherwise the node may not work correctly.
Landscape Layer Blend Types
The Landscape Layer Blend material node has three different blend modes that you can choose from. Each different Layer Blend type is used when you are trying to achieve a different result.
LB Weight Blend
Use if you have layers coming in from an external program, like World Machine, or if you wanted to be able to paint any layer independent of one another without worrying about layer order.
LB Alpha Blend
Use if you want to paint in detail and if you want a defined layer order. For example, painting snow over rock and grass will occlude them, but erasing snow will reveal rock and grass beneath it.
LB Height Blend
This is the same as LB_WeightBlend but also adds detail to the transition between layers based on a height map. This allows, for example, dirt to appear in the gaps between rocks at the layer transition point, instead of just smoothly blending between rock and dirt.
Here is an example of the LB Height Blend in action. As you can see, the dirt to appears in the gaps between rocks at the layer transition point. This way you get a nice transition where layers meet.
Landscape Layer Blend Technical Information
Under the hood, these layer nodes behave like a Static Switch Parameter node, which enables you to switch from using one part of the Material to using another. Each component of the Landscape has its own MaterialInstanceConstant created from the main Landscape Material, which is applied to just that component. If a particular layer is not used on a specific Landscape component, the subtree of nodes connected to the layer will be discarded. This reduces overall Material complexity, enabling the Material applied to the Landscape to contain any number of texture samples as long as the number of samples being used on any individual component never exceeds the maximum set by the shader model specifications (16 for SM 3.0).
This means it is possible to set up a master Material that contains every texture or network used anywhere on the Landscape. This can end up being a very complex collection of networks, while still keeping the final Materials applied to the components of the Landscape within the parameters allowed by the hardware.
Any network of material expressions can be connected to the Layer inputs in place of a simple TextureSample. This makes it possible to do more complex effects such as transitioning from detail textures to larger macro textures depending on the distance the layer is being viewed from.
Tessellation and Displacement
The Tessellation Multipliers and World Displacement channels of the Material can be used in conjunction with Landscape terrains to provide additional detail and deformation when the Landscape is close to the camera. These work exactly as they would with any other standard Material, and the layer blending can be used in conjunction with these just as with the Base Color, Normal, or any other channel. The Landscape will also only render hardware tessellation on the highest level-of-detail(LOD) which will fade out as the Landscape approaches the second LOD. Subsequent LODs will no longer have tessellation enabled, which will significantly improve performance when enabling tessellation for displacement on your Landscape Terrain.
These features are limited for use with DirectX 11 enabled. As such, they should be used as secondary polish effects unless you are targeting DirectX 11 hardware specifically. You can read more about how to enable and use tessellation in your project by reviewing the Tessellation Multiplier page.
In the visualization above, the highest LOD (white) is rendered with tessellation enabled, while the other LODs (colors) are rendered without tessellation.
Mobile Landscape Materials
Mobile landscapes are no longer limited to just three Landscape layers. While three is still an optimized case, any number of layers are supported provided there are sufficient Texture Samplers. The Landscape layer allocation now takes Feature Level Switch material node allowing a single PC or Console Landscape Material to also have a Mobile version. The following image shows how the Landscape used in the PC and Console versions of Fortnite Battle Royale looks when used for mobile devices.
Using Layer Blending
The ability to blend multiple textures and materials networks into paintable Landscape layers is the basis for texturing Landscape terrains. In order to blend layers together, you can use either multiple LandscapeLayerWeight nodes or one to two LandscapeLayerBlend nodes depending on if you are using a Normal Map or not.
Using Landscape Layer Weight Nodes
Setting up and using LandscapeLayerWeight nodes is a quite easy process for which will be outlined below.
All layer names must be unique, so we recommend naming your layers with a descriptive name that indicates what the layer contains. This will help you remember where content is in your layer and help you navigate through layers faster.
In the Material Editor, add a LandscapeLayerWeight node to the Material Graph. By default, it will have the Parameter Name «None.»
In the Details panel, change the Parameter Name to a descriptive name for the layer, for example, «Rock». After you enter a **Parameter Name**it will be updated on the node itself.
Add additional LandscapeLayerWeight nodes, until you have one for each layer that you want your Material to have. In this example, we are going to be using just two LandscapeLayerWeight nodes.
Add and connect Texture Samples, or other material network expressions, to your LandscapeLayerWeight nodes.
Add a LandscapeLayerCoords node, set its UV titling to what you want, and connect it to the Texture Sample nodes.
Drag from each Layer node’s output pin to the Base pin of the next layer node to connect them with a wire (leaving the first layer node’s Base pin unconnected).
Drag from the final Layer node’s output pin to the Base Color input of the Material’s Base node.
When completed, you should have something that looks like the following example using LandscapeLayerWeight nodes:
You can preview the effects of different weights on the Material by changing the Preview Weight properties of the LandscapeLayerWeight nodes.
Using Landscape Layer Blend Nodes
As an alternative to manually blending layers together with the LandscapeLayerWeight node, the LandscapeLayerBlend node blends multiple layers together using either alpha blending or alpha blending with a height-based offset. The height-based offset allows a layer to blend with other layers based on a heightmap input.
In the Material Editor, add a LandscapeLayerBlend node.
In the Details panel, next to Layers, click the plus icon (
Expand the layer to view its properties.
Change the Layer Name to a descriptive name for the layer, for example, «Snow».
Determine whether you want the layer to be alpha blended or height blended, and set the Blend Type accordingly.
Add as many additional layers as you want for your Landscape Material. Rename them and set their Blend Types appropriately.
Connect the LandscapeLayerBlend node’s output to the Base Color input of your Material’s base node.
Add Texture Sample nodes, and connect their main outputs to the Layer inputs of the LandscapeLayerBlend nodes. Alternatively, you can create a more complex material network and connect it to the Landscape Layer Blend Layer input. For any height-blended layers, connect the Texture Sample’s alpha output to the LandscapeLayerBlend’s Height input.
When you are done, your Landscape Material network will look something like this:
You can preview the effects of different weights on the Material by changing the Preview Weight properties of the LandscapeLayerBlend nodes.
Creating Landscape Hole Materials
Creating holes in your Landscape is something that you can do in Manage Mode but only by deleting entire Landscape components at a time. To get around this, you can use a Landscape Hole Material to mask out the visibility and collision of a certain location on your Landscape. This is great if you want to make something like an entrance to a cave in the side of a mountain.
You can use the same Material for your Landscape Material and your Landscape Hole Material, but be aware that Materials that use opacity masks are more costly performance-wise, than Materials that do not. This is why you have the option of creating a separate Landscape Hole Material.
Open the Material Editor, and in the Details panel set the Blend Mode to Masked.
Next, add a LandscapeVisibilityMask node to the Material Graph and connect its output to the Opacity Mask input.
Once the material has been compiled, it is now time to assign it to the Landscape so that it can be used. This can be done in the Landscape Hole Material section in the Details panel.
Now you can set up the rest of your Landscape Material like you normally would and when completed, you should have something that looks similar to this.
You should now be able to mask and unmask the visibility of your terrain, like in the video below.
For information about using the painting tools to create a Landscape hole, see Using Opacity Masking to Create a Hole .
Assigning Materials to Landscapes
After creating a Material for a Landscape, you need to assign the Material to a Landscape Actor in your level to use the Material.
Find the Landscape Material that you want to use in the Content Browser.
Select the Landscape, either in the viewport or in the World Outliner.
In the Level Editor’s Details panel for the Landscape, in the Landscape section, next to Landscape Material, click the Assign arrow (
) to assign the selected Material.
Assigning a Landscape Hole Material to a Landscape
You can assign different Material to act as the Landscape Hole Material, which is a Material with specific opacity settings.
See the section on Landscape Hole Materials for general information on hole materials. For information on opacity masking, see Using Opacity Masking to Create a Hole .
Find the Landscape Hole Material that you want to use in the Content Browser and select it.
Select the Landscape, either in the viewport or in the World Outliner.
Navigate to the Level Editor Details > Landscape > Landscape Hole Material. Select the arrow (