Multi-layered terrain material with Nanite in Unreal Engine 5

Good day, friends. In this article, I want to show you how to create a multi-layered landscape using Nanite and Tesselation technology in Unreal Engine 5.5 (it may be different in other versions)
To make it convenient for you, always create separate folders for the entire project for each task.
What is Nanite?
- Nanite is a virtual geometry technology in Unreal Engine 5 that allows you to render scenes with billions of polygons in real time, while minimizing project performance, unlike without using nanite technology.
What is Tesselation?
- Tessellation is an automated process of adding new convex polygons to a polygonal grid in order to increase the detail of the grid.
- The first thing you need to do to make our material work is to enable the use of nanite on the landscape, create your landscape, then select it in the column, enable the use of nanite in the settings, click create nanite data
Landscape material using Nanite
- You can make textures yourself in programs like Adobe Substance 3D or Adobe Photoshop, but there is also a wonderful texture site like Polyhaven. This site has a huge texture database like Quixel Bridge.
After we have found the necessary textures, we double-click into the material diagram, where we will connect our nodes. First, select our material bar, and select use material attributes in the sidebar.
- Next, from the browser content: (Ctrl space) pull out all our textures into the material scheme: Base texture, Roughness Texture, Normals Texture, Mixing Texture, if you don't have a mixing texture, you can search for it in other textures (Which channel is ABCD, etc.) the mixing texture is usually black and white. We arrange the textures as we want in any order - this does not play a key role.
- Important for the mixing texture, be sure to enable multiplication (Multiply *) mixing is connected via the blue channel in A. A parameter is created in B so that the mixing scale can be controlled. The parameter is created by pressing the S key and clicking on an empty area.
All our textures are connected via makematerialattributes, because we are making a multi-layered material, which means we will not be able to combine all the materials into one column, so we need makematerialattributes. As a result, see the screenshot at the top how everything should be connected. To avoid glare from light sources, you need to create the speculator parameter and set it to zero.
How do I mix landscape textures with each other?
- To start mixing all the textures together, you need to call a special node called Landscape Layerblend, in which in the Layers section you need to create as many layers as you have materials for the landscape, and name them by their proper names so as not to confuse which pin is responsible for which material, and connect the appropriate materials to all pins. As a result, you should get as shown in the screenshot above.
- The Landscaping node needs to connect the attributes of the material to the node.
How to remove texture repetition?
- In order not to burden the project too much, you may want to use textures of lower resolution, then on a large landscape, they will kind of repeat themselves, which looks pretty stupid, and makes your game an outright dump. Let's create nodes to control the scale of textures, create three nodes (Multiply *) in the first (Multiply *) in A, connect the AppendVector node in B, connect the parameter: we call it Scale, for example.
Tilling Textures in Unreal Engine 5
In the other two (Multiply *), for channel B, we create a parameter, one will be UTilling, the second Vtill is connected strictly to channel B. For channel A, we create ComponentMask. In the first, we select the letter R. in the second, we create the TextureCoordinate node, and connect ComponentMask to all nodes
The whole mixture is connected from the first (Multiply *) to UVs textures - the result should be as shown in the screenshot above.
Why is my landscape black? Landscape material data
When you transfer the created material to the landscape, the weight of the landscape will turn black, do not worry, This is because the Unreal Engine does not understand which layer of material it needs to apply to the landscape, to do this, in the landscape coloring section, create data on coloring by height. (Side menu)