How to the Layered Lit shader to mix Texture Maps in Unity HDRP

In this article, I will show you how to mix two texture maps in Unity HDRP.

In my project, I want to mix dirt and cobblestone materials on a plane to add another layer of realism to the material.

The first step is to create the new material to use as our dual material. Go to your project tab and click the “+” button then click “Material. Name your new material (I’m calling mine Light_Dirt_Stone_mat).

Next, change the Shader to “LayeredLit” by clicking the shader button and selecting “HRDP” > “LayeredLit”.

What you will notice under the surface inputs is that you’re able to change the “Layer Count” between 2 and 4. I will only use 2 textures in this example.

Under the “Layer List” add in your layer materials. I am using the stone material as my main and the dirt layer as my next layer.

Next, add a new “Plane” into your Hierarchy by clicking the “+” button and selecting “3D Object” > “Plane” and apply your Light_Dirt_Stone_mat material to it.

The first thing to notice is our main texture is not the most prominent texture at this point, this is because we need to add a layer mask texture, this set where the second texture should render over the top of our main.

Download a texture to use as your mask or alternatively create a random noise texture in Photoshop as I’ll demonstrate below.

Create a new 256 by 256 texture.

Use the paint bucket to colour your canvas black then press “ctrl” + “a” to select everything.

Go to “Filter” > “Noise” > “Add Noise”. This will open up a window where you can adjust your Noise Level. Adjust the amount to something you’re comfortable with, set the “Distribution” to “Gaussian” and check the “Monochromatic” checkbox. I set my noise to 200% as I am going to use tiling to adjust the texture in Unity.

Export this as a png by clicking “File” > “Export” > “Quick Export as PNG” and save it to your Unity Project.

In Unity, go to your material and under “Surface Inputs” add your noise texture to the “Layer Mask” input and adjust your tiling and offset to get your desired effect.

After adjusting the texture slightly this is the final result.

That’s all for now.

--

--

--

Unity developer with a love of learning all things programming.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Journey into the tech space as UI/UX Designer with Kanispace— Part I

Top 5 Instagram Influencers For Architecture Students

Clean Water & Sanitation

Problem of On-Demand App Abandonment and How to Fix It?

Station-ary: Giving Transit Context to Smart City Kiosks

Wescover Connect: Bringing Creators Together

About Us - Sergio Mannino Studio

Try it all before you decide

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Luke Duckett

Luke Duckett

Unity developer with a love of learning all things programming.

More from Medium

How to Win the Race Using Director

Upgrading Player Movement (New Unity Input System)

An overview of the Unity Hub editor

Indy Pro ’22: IWTV