Layering Materials In Unity
Using the HDRP Layered Lit Shader
Another great way to add detail to our materials in Unity’s High Definition Rendering Pipeline (HDRP), is by using Layered Shaders.
The Layered Lit Shader allows us to stack up to four Lit materials to create blends, allowing for an easy method of realism. The Main Layer acts as a normal Lit Material in that it can control the likes of the albedo, normal, and height maps. From here, we can layer our other materials on top.
Using our cobblestone we created previously for our displacement examples, lets layer this with a dirt texture. Since we want to use our cobblestone material as the main layer, we actually need to create a new material to handle the Layered element. Creating a new material and selecting the appropriate shader, results in a window looking like the following.
Placing in our two materials, will now result with Layer 1 being over top of the Main layer. To start blending them, we need to apply a Layer Mask, this could be our Height Map from our Main layer, or we could make a copy and edit it to have more contrast. Either way, we can now start adjusting different map settings for each material to find a blend we like.
Of course, for extra added effect, we can apply Tessellation using a LayeredLitTessellation shader. Ultimately, we can very easily make various different blends using only a select few materials!