UE5 Shaders Explained: The Secret Behind Every Material (Part 1)

In this tutorial, we’re going to take a look at how to create materials and shaders in Unreal Engine 5, starting with the absolute basics and gradually building up to something a little more advanced.

We’ll begin by creating a simple material and exploring the fundamental properties that control how a surface looks. From there, we’ll move on to creating a PBR material using texture maps, before finally looking at how we can use an ORM texture to combine our Ambient Occlusion, Roughness and Metallic information into a single texture.

The idea is to give you a good understanding of how materials work in Unreal Engine, what the different texture maps do, and how they all come together to create realistic-looking surfaces.

Whether you’re completely new to materials or just looking to better understand the PBR workflow, this tutorial should give you a solid foundation to start building your own shaders in UE5.

Basic Shader

Let’s start by creating our first material. This is going to be a very simple one, but it will give us a good foundation for understanding how materials and shaders work in Unreal Engine 5.

In the Content Browser, right-click and create a new Material and rename it appropriately.

Once you’ve created it, double-click the material to open it in the Material Editor.

You should now see the material graph, along with the main Material Output node. This is where we’ll start building our shader.

1. Setting Up the Base Color

Let’s begin with something straightforward: the base color.

In Unreal Engine, you can hold down the 3 key and left-click anywhere in the material graph to create a Constant3Vector node.

This node gives us three values: Red, Green, and Blue (RGB). Together, these values define the color of our material.

Connect the output of the Constant3Vector node to the Base Color input on the main Material Output node.

You can then select the Constant3Vector and use the Details panel to choose whatever color you’d like.

For now, let’s just pick a simple color so we can easily see the material when we apply it to an object. [A6663D]

That’s our first material property set up!

2. Understanding Parameters

Before we go any further, there’s something important I want to introduce: Parameters.

Right now, we’re using a Constant3Vector, which means the color is hardcoded directly into our material.

That’s perfectly fine, but what if we want to change the color without having to open the Material Editor every time?

This is where parameters come in.

Right-click on the Constant3Vector node and select Convert to Parameter.

You’ll notice that the node changes into a Vector Parameter.

We can now give it a name, such as BaseColor.

The benefit of doing this is that we can expose this value outside the material itself. Later, when we create a Material Instance, we’ll be able to adjust the color directly through its Details panel without having to modify the original material graph.

This is going to be particularly useful as we start building more complex materials.

3. Setting Up Metallic

Next, let’s look at the Metallic property.

Hold down the 1 key and left-click in the graph to create a Constant node.

A Constant node gives us a single numerical value, which is exactly what we need here.

Connect this node to the Metallic input on the Material Output.

For now, let’s leave the value at 0.

Metallic controls whether a material behaves like a metal or a non-metallic surface.

  • 0 means the material is non-metallic, like wood, plastic, or rubber.
  • 1 means the material is fully metallic, like polished steel or gold.

You can use values between 0 and 1, but for most everyday materials, you’ll generally want to stick close to one of those two extremes.

We’ll keep ours at zero for now.

4. Setting Up Specular

Next up is Specular.

Specular controls the intensity of the reflections on non-metallic surfaces.

Let’s keep things simple here. We’ll use the default value of 0.5.

This is a good starting point for most materials, so there’s no need to overcomplicate things at this stage.

5. Setting Up Roughness

Finally, let’s add Roughness.

Again, hold down the 1 key and left-click to create another Constant node.

Connect this to the Roughness input on the Material Output.

Roughness is particularly important because it controls how sharp or blurry the reflections appear on the surface.

For example:

  • 0 gives you a perfectly smooth surface with sharp reflections.
  • 1 gives you a completely rough surface with very blurred reflections.

Think about the difference between a polished piece of metal and a rough piece of concrete. The polished metal has much sharper reflections, while the concrete scatters light across its surface.

That’s essentially what we’re controlling with roughness.

For now, choose a value that makes sense for the material you’re creating.

6. Our Basic Material Is Complete!

And that’s it! We’ve just created a very basic material in Unreal Engine 5.

We now have the fundamental properties that make up a large portion of the materials you’ll create:

  • Base Color: Defines the surface’s color.
  • Metallic: Determines whether the surface behaves like a metal.
  • Specular: Controls specular reflectance on non-metallic surfaces.
  • Roughness: Controls how sharp or blurred reflections appear.

Remember that Parameter we made earlier? We can now right-click on the Material and make a Material Instance.

When we open the Material Instance we can now use these Parameters to make change in real time.

At this stage, many beginners will build their materials using these properties, perhaps adding a normal map to introduce additional surface detail.

And honestly, that’s a perfectly good place to start.

There’s obviously a lot more we can do with materials and shaders in Unreal Engine, but I want you to understand these fundamentals before we start introducing more complicated concepts.

Think of this as our starting point. We’ll build on these properties as we explore more interesting shader techniques later in the tutorial.

PBR Shader

Now that we’ve had a look at the basic material properties in Unreal Engine, let’s take things a step further and look at how we can use PBR textures to create a more realistic material.

PBR stands for Physically Based Rendering. Essentially, it’s a workflow that uses different texture maps to describe how a surface should look and how it should interact with light.

Rather than manually choosing a color and setting values for metallic and roughness, we can use textures to provide all of that information for us.

For this example, we’re going to use a basic PBR texture set. Ideally, this will include the following maps:

  • Base Color: Defines the actual color information of the material.
  • Normal: Adds surface detail by influencing how light interacts with the surface.
  • Roughness: Controls how smooth or rough the surface appears.
  • Metallic: Defines which areas of the material behave like metal.
  • Ambient Occlusion: Adds subtle shading to areas where light is naturally less accessible.

You don’t necessarily need all of these maps for every material, but this is a good starting point for understanding how a typical PBR material is constructed.

1. Creating Our Material

Let’s start by creating a new material in the Content Browser.

Right-click, select Material, and name it appropriately.

Double-click it to open the Material Editor.

We’ll use the main Material Output node as the foundation for our shader. This is where we’ll connect all of our texture information.

2. Importing Our PBR Textures

Before we start connecting anything, we need to bring our textures into Unreal Engine.

Find a PBR texture set you’d like to work with. You can get these from various sources, including Quixel Megascans, Poly Haven, or other texture libraries.

For this example, let’s assume we’re working with a set of textures that contains Base Color, Normal, Roughness, and Ambient Occlusion maps.

Import these textures into your Content Browser.

Once they’re imported, open your material graph and drag each texture into the graph.

Each texture will create its own Texture Sample node, allowing us to access its pixel information inside the material.

Now we’re ready to start connecting everything.

3. Connecting the Base Color

Let’s start with the Base Color texture.

This is probably the easiest one to understand because it contains the actual color information for our surface.

Take the RGB output from the Texture Sample node and connect it to the Base Color input on the Material Output node.

And that’s it!

We’ve now told Unreal Engine what color our surface should be using the information stored in that texture.

4. Connecting the Normal Map

Next, let’s add our Normal map.

Normal maps are particularly useful because they allow us to add the appearance of surface detail without having to increase the actual geometric complexity of our model.

For example, imagine we’re creating a brick wall. Rather than modeling every little indentation and imperfection, we can use a normal map to simulate how light interacts with those details.

Take the Normal Map’s RGB output and connect it to the Normal input on the Material Output node.

One important thing to remember is that normal maps need to be imported with the correct texture settings. Unreal Engine generally recognizes normal maps automatically, but it’s worth checking that the texture’s compression setting is set to Normalmap.

This ensures the texture is interpreted correctly.

5. Connecting the Roughness Map

Now let’s move on to Roughness.

As we discussed earlier, roughness determines how smooth or rough the surface appears when light interacts with it.

The difference here is that instead of using one constant value across the entire material, we’re using a texture to control roughness across the surface.

Take the Roughness Map’s RGB output and connect it to the Roughness input on the Material Output node.

This means different areas of the texture can have different roughness values.

For example, some areas might be polished and reflective, while others might be rough and matte.

This gives us a much more interesting and realistic surface.

6. Connecting Ambient Occlusion

Finally, let’s look at Ambient Occlusion, often shortened to AO.

Ambient Occlusion helps simulate the subtle darkening that occurs in areas where light has difficulty reaching, such as crevices, cracks, and areas where surfaces meet.

Take the AO Map’s RGB output and connect it to the Ambient Occlusion input on the Material Output node.

This gives Unreal Engine additional information about where those darker areas should appear.

It’s worth mentioning that ambient occlusion isn’t a replacement for proper lighting or shadows. It’s simply another piece of information that helps add depth to the appearance of our material.

7. Applying and Testing Our Material

And that’s pretty much it!

We’ve now built our first basic PBR material using texture maps.

Before we finish, let’s save the material and apply it to a mesh in our scene.

You should now be able to see how all of these different textures work together to create a much more detailed surface.

The important thing to understand is that each texture is responsible for a different aspect of the material:

  • Base Color tells Unreal Engine what color the surface should be.
  • Normal tells it how the surface should respond to lighting at a more detailed level.
  • Roughness controls the appearance of reflections.
  • Metallic determines the metallic properties of the surface.
  • Ambient Occlusion provides additional shading information in crevices and contact areas.

When combined, these maps give us a much more convincing material than simply using a flat color and a few constant values.

And this is really the foundation of working with PBR materials in Unreal Engine 5.

Once you understand how these texture maps work and how they connect to the material output, you’ll have a much better understanding of how to build more complex materials.

We’ll use these fundamentals as we start exploring more interesting shader techniques.

PBR Shader using ORM

Now that we’ve got an understanding of the basic material properties in Unreal Engine, let’s take a look at how we can use PBR textures to create a more realistic material.

For this example, we’re going to use something called an ORM texture map.

If you’ve followed my previous tutorial on creating ORM texture maps in Affinity Photo, you’ll already be familiar with how these work. But if you haven’t, don’t worry. I’ll explain what they are as we go along.

ORM stands for Ambient Occlusion, Roughness and Metallic. Rather than having three separate texture maps for these properties, we can combine them into a single texture using the Red, Green and Blue channels.

This is useful because it means we’re storing multiple pieces of material information in one texture, which can help reduce the number of texture samples required by our material.

1. Creating Our Basic Material

Let’s start by creating a new material in the Content Browser.

Right-click, select Material, and name it appropriately.

Double-click the material to open it up in the Material Editor.

We’ll use this as the foundation for our basic PBR material.

Before we start connecting anything, let’s take a look at the textures we’re going to need.

For this example, we’ll be using three main texture maps:

  • Base Color: Provides the actual color information for our material.
  • Normal: Adds surface detail by changing how light interacts with the surface.
  • ORM: Contains our Ambient Occlusion, Roughness and Metallic information.

You can download these textures from a PBR texture library or use a texture set you’ve created yourself.

If you’ve followed my previous Affinity Photo tutorial, you should already have an ORM texture ready to go.

2. Importing Our Textures

Let’s start by importing our textures into Unreal Engine.

Find your Base Color, Normal and ORM textures and drag them into the Content Browser.

Once they’re imported, we’ll want to check a couple of settings before using them.

First, let’s open our Base Color texture.

By default, Unreal Engine will generally import this with sRGB enabled, which is what we want for a standard Base Color texture.

Next, let’s open our Normal map.

Normal maps need to use the appropriate Normalmap compression setting. Unreal Engine will often recognize these automatically, but it’s worth checking.

Finally, let’s open our ORM texture.

This is an important one.

Because our ORM texture isn’t storing actual color information, we need to make sure that sRGB is disabled.

You may see an error but this is easily fixed by changing the Sample Type in the Details Panel to Linear Color.  

This is important because we want Unreal Engine to read the RGB values as raw data rather than applying color-space conversion.

3. Connecting Our Base Color

Let’s start with the Base Color.

Take the RGB output from this node and connect it to the Base Color input on the main Material Output node.

And that’s our Base Color set up.

This texture contains the actual color information that will be displayed on our material.

4. Connecting Our Normal Map

Next, let’s add our Normal map.

Take the RGB output and connect it to the Normal input on the Material Output node.

As we discussed earlier, a Normal map gives us the appearance of additional surface detail without needing to add more geometry to our model.

This is particularly useful for things like bricks, wood grain, scratches and other small surface imperfections.

So now we have our Base Color and Normal information connected, let’s move on to the interesting part: our ORM texture.

5. Understanding the ORM Texture

Before we connect anything, let’s take a moment to understand how the ORM texture actually works.

Remember, we’re combining three separate grayscale textures into one RGB texture.

Each color channel contains a different material property.

The layout we’re using is:

  • Red channel: Ambient Occlusion.
  • Green channel: Roughness.
  • Blue channel: Metallic.

So, even though we’re looking at what appears to be a single RGB texture, we’re actually storing three completely different sets of information inside it.

The important thing to understand is that Unreal Engine allows us to access these individual channels separately.

And that’s exactly what we’re going to do.

You’ll notice that the Texture Sample node gives us several outputs, including RGB and individual Red, Green and Blue channels.

Rather than using the combined RGB output, we’re going to use those individual channels to connect our material properties.

6. Connecting Ambient Occlusion

Let’s start with Ambient Occlusion.

Remember, this information is stored in the Red channel of our ORM texture.

Take the Red output from the ORM Texture Sample node and connect it to the Ambient Occlusion input on the Material Output node.

That’s it!

We’ve now told Unreal Engine where to find our Ambient Occlusion information.

This helps provide additional shading information in areas such as crevices, cracks and places where surfaces meet.

7. Connecting Roughness

Next, let’s connect Roughness.

Our Roughness information is stored in the Green channel.

Take the Green output from our ORM texture and connect it to the Roughness input on the Material Output node.

This tells Unreal Engine how rough or smooth different parts of our surface should appear.

For example, some areas might be relatively smooth and reflective, while others might have a much rougher appearance.

Because we’re using a texture, we can control all of this across the surface rather than relying on one constant value.

8. Connecting Metallic

Finally, let’s connect our Metallic information.

This is stored in the Blue channel of our ORM texture.

Take the Blue output and connect it to the Metallic input on the Material Output node.

This tells Unreal Engine which areas of our material should behave like metal.

A value of zero represents a non-metallic surface, while a value of one represents a fully metallic surface.

Again, because we’re using a texture, we can have different metallic values across the surface.

And that’s all three of our ORM channels connected!

9. Applying and Testing Our Material

Now that we’ve connected everything, let’s save our material and apply it to a mesh in our scene.

You should now be able to see how all of these different texture maps work together to create a much more detailed material.

If we look at our material graph, you’ll notice that we’re only using three Texture Sample nodes:

  • Base Color.
  • Normal.
  • ORM.

And yet, we’re able to control five different material properties.

That’s the real advantage of using an ORM texture.

Instead of sampling Ambient Occlusion, Roughness and Metallic separately, we’re extracting all three from a single texture using its individual color channels.

This is a fairly common workflow in game development because it helps us organize our material textures and reduce the number of texture samples we’re using.

10. Wrapping Things Up

And there we have it! We’ve just created a basic PBR material in Unreal Engine 5 using an ORM texture.

We’ve taken our Base Color and Normal maps, combined them with our ORM texture, and connected everything to the appropriate inputs on the Material Output node.

The important thing to remember is how the ORM channels are organized:

  • Red = Ambient Occlusion.
  • Green = Roughness.
  • Blue = Metallic.

Once you understand that, working with ORM textures becomes pretty straightforward.

Of course, there’s a lot more we can do with materials in Unreal Engine, but this is a really good starting point.

In the next part of the tutorial, we’ll start building on these fundamentals and look at some more interesting ways we can work with materials and shaders.

But for now, we’ve got everything we need to create a basic PBR material using an ORM texture!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.