In this tutorial, learn how to create a master material and material instances in Unreal Engine 5.
I’m M. Tolga Arslan, an architect from Turkey. In this tutorial, I’ll show you how to create a master material and material instances in Unreal Engine 5. Our master material will let us change map intensities to adjust height, normal, and roughness power. We’ll use Unreal Engine’s Recommended Asset Naming Conventions to keep everything organized. Let’s get started!
Login to your Poly account and download the assets you want.
Image 1: The Poly homepage.
Extract them from the .zip file and change their names. I downloaded paving stone and wood shingle materials from my library.
Image 2: Downloaded assets without name changes.
Let’s make them conform to Unreal Engine’s naming standard! (If you want, you can pass this section.)
For all textures, we will use the prefix T_. For ambient occlusion maps, the suffix _AO. For normal maps, the suffix _N. For height maps, the suffix _H. For diffuse or color maps, the suffix _D. For metalness maps, the suffix _M. And for roughness maps, the suffix _R.
Image 3: Asset names that have been changed based on Unreal Engine’s Recommended Asset Naming Conventions.
Note: You can use Bulk Rename Utility to change names easily. It’s free to use for personal projects.
Open Unreal Engine 5 and create a blank project based on your need. I will continue with the Film/Video Live Event section’s blank project. You can select any project type. That will not change the material setup at all.
Image 4: Unreal Engine 5’s Create A Project menu
In Unreal Engine, master materials are the parents of material instances. We are using master materials to adjust different materials using the same controllers. There are plenty of master material types, but we will create a basic one that let us adjust PBR map intensities. Before creating a master material, let’s create a few folders.
Right-click on the content browser, create a new folder, and name it “Materials.” Open that Materials folder and create another folder named “Textures.” Select all the textures that we prepared before, and drag them into the Textures folder.
Image 5: Right-click on the content browser to create a new folder.
Image 6: Drag and drop your textures into the Textures folder.
After uploading is completed, return to the Materials folder. Right-click on the content browser to create a material.
Name it “M_MasterMaterial.”
Image 7: Return to the Materials folder and create a material. Name it “M_MasterMaterial.”
Double-click on M_MasterMaterial. That will open the node-based material-setup window. We will create our basic master material here.
Image 8: M_MasterMaterial’s material graph.
On the empty screen, right-click and search for TextureSample. You can also use a shortcut: press T on the keyboard and click on the empty area. This will automatically create the TextureSample node.
Image 9: Creating a TextureSample node.
Right-click on the TextureSample node, select Convert To Parameter, and name it “Diffuse Map.” That will help us to change our texture image for other materials. Select the DiffuseMap node and copy it five times using the Ctrl-D keyboard shortcut, and change the names to “Normal Map,” “Height Map,” “Roughness Map,” “Metallic Map,” and “AO Map.”
Image 10: Copy the DiffuseMap mode five times.
To keep your material parameters organized, you can also define a group for each map type if you want. Select every material you created and give them a group name. We will use groups to organize other parameters we’ll create — for instance, “Normal Intensity.”
Image 11: Use groups to organize parameters.
Create two Multiply nodes and two Append nodes by right-clicking and using the search function. Then connect them as shown in the image below.
To create a Normal Intensity parameter, search for the ScalarParameter node and name it “Normal Intensity.” Don’t forget the add it to the Normal group we made earlier.
Image 12: The Normal Map controller setup.
For the Roughness Map controller setup, create two ScalarParameter nodes and name them “Roughness Min” and “Roughness Max.” You can define a default value using the menu on the left. After that, connect the nodes via the Lerp node as shown in the image below. Don’t forget to add the created parameters to the Roughness group.
Image 13: The Roughness Map controller setup.
Image 14: Parameter groups.
Create a Multiply node, a ScalarParameter node, and a VertexNormalWS node, and connect them as in the image below for the Height Map setup.
Image 15: The Height Map controller setup.
Are you tired? It’s almost finished. Create a Multiply node and a ScalarParameter node, and connect them as in the image below for both maps.
Image 16: The AO Map and Metallic Map controller setup.
That’s all. Let's connect the customized nodes to the material.
Image 17: Connecting customized PBR maps to the Master Material node.
Note: If you connect nodes incorrectly, you can Alt-click on the line to disconnect them.
Did you see the error messages? We will clear them by putting a default image on each map’s texture parameters.
Let's start with Diffuse Map: click on the Diffuse Map Parameter; then in the section on the left, scroll down and find Material Expression Texture Base.
Image 18: Fixing the error by selecting correct texture images.
Select a suitable texture map. In our example, we’re selecting T_PavingStones_D. Make a similar selection for each map parameter. If you don’t have a Metallic texture, don’t worry: simply select the Roughness texture. We will adjust the power of Metallic Map to 0 later.
Image 19: The finished MasterMaterial preview.
And you’re finished. You created a customizable master material! You can find other examples on the internet. Save everything using the Ctrl-S keyboard shortcut and close M_MasterMaterial Graph Editor.
Right-click on the content browser and create a Material Instance. Name it “MI_Pavement_1.”
Image 20: Create a Material Instance.
Double-click on the created Material Instance to open the Asset window. In the righthand section, select our master material as the parent.
Image 21: Select the master material as the parent.
That will automatically update the settings section based on the master material. Here are all of our parameters, organized and ready to use.
Image 22: An adjustable Material Instance preview.
First, let’s change the metallic value to 0. To do that, activate metallic power and change its value to 0; otherwise, it will work at the default value, which is 1.
Image 23: Changing the metallic value to 0
Let’s adjust the parameters and find a good visualization for our material!
Image 24: Adjusting controllers.
Note: The basic sphere doesn’t have enough verticals to show the correct surface displacement. It will be better to test on the actual scene.
We were using PavingStones’s texture files as the master material’s default textures. Because of that, we didn’t waste time selecting textures for each map channel.
Let’s create a second material instance and change the textures for WoodShingles. Close MI_Pavement_1’s Asset window. Select MI_Pavement_1 and press Ctrl-D. That will create a copy. Rename it “MI_WoodShingles.” Open it and change the texture maps as in the image below.
Image 25: Creating the second material.
Following these steps, we created a customizable master material and our material instances in Unreal Engine 5.
There are unlimited possibilities when creating a master material. You can create interesting adjustment scenarios for your materials like aging, blending, deforming, stylizing, and so on.
Note: Create a material, open it, copy the following text in a .txt file, and paste it into the empty material graph. It will automatically create all nodes for you 🙂 If you want to share your graph with people, copy your nodes and paste them in a .txt file. This is a little-known trick 😎