Material Instances in UE4 are extensions of your main, master material that allow to expand its functionality and flexibility of using that material.
Let's say you wanted to make some changes to the material such as updating color, roughness or changing a diffuse texture. Instead of creating an entire separate material you would create a Material Instance and change the parameters within it to update those properties.
With Material Instances, you do not have to recreate entire material from scratch. Just create a Material Instance.
Main benefits of using Material Instances are:
Working with Material Instances on landscapes or any other asset in UE4 is pretty much a necessity. Here is how to get started.
Material Instance requires you to have a Material so you can create a Material Instance from.
See this tutorial for how to create a 2-texture landscape material.
In the Content Browser, Right-Click on the Material and choose Create Material Instance:
UE4 will automatically add a postfix of _INST to the name. But you can rename it if you wish. I usually just keep the postfix UE4 gives me.
Material Instance will not have any properties to change yet because we haven't set them up.
You have to create parameters inside the Material. These parameters will then be exposed to change in the Material Instance Editor.
Open the Material Editor by Double-Clicking on the Material:
If you Right-Click on most Material Expressions you'll see an option to Convert to Parameter:
Note: not all Material Expressions can be converted to a Parameter.
Converting a node (material expression) to a parameter will expose it inside the Material Instance Editor so you can make adjustments.
The Roughness controls are Constant1Vectors:
Right-Click on the Constant1Vector and choose Convert to Parameter:
Name it. This name is what will appear in the Material Instance:
Select the Parameter and in Details panel give a Default Value. I will keep mine at .9. I also assigned this Parameter to a Group and named it Roughness:
Repeat for the second Roughness Constant1Vector. Name it and Group it to Roughness:
Select both Roughness Parameters and in Details panel assign them to a Group called Roughness. Grouping Parameters will help to keep them organized inside the Material Instance:
Quicker way to creating a Parameter is to Hold S and Left Click. This will insert a Scalar Parameter. It is the same thing as converting a Constant1Vector to a Parameter.
Right-Click on the Color Texture Sample and choose Convert to Parameter:
Name it and Group it and do the same to the Dirt texture:
Also Convert the Normal Maps to Parameters and give another name:
This will allow you to change Color and Normal Map textures through the Material Instance. You have to do this to both to Color and Normal Map because when you change the color texture it has to match the correct normal map.
You can't convert LandscapeCoords expression to a parameter so we have to do few things to set this up.
Insert a Divide node and create a Scalar Parameter and name it:
Give a Default Value and Group it:
Connect LandscapeCoords into Divide A and Scalar Parameter into Divide B, then Divide output into UV input of the texture that you want to change tiling to. Do this for Grass and Dirt Tiling:
Make sure you connect the same Divide Output to the Color and Normal Map Texture Sample. So both Color and Normal Map texture tiling get updated at the same time with one Parameter:
You can also use Multiply instead of Divide, both will work. Only difference is the value have to use to control tiling. With Multiply you have to lower the number below 1 and into fractions to decrease texture tiling. With Divide you increase the number above 1 to decrease texture tiling. The one you use is up to you and how you want to change texture tiling. I like using Divide with LandscapeCoords node.
Click Apply and Save.
Double click on the Material Instance to open Material Instance Editor then enable the Parameters you want to change:
Change Roughness, textures (color and normal) and texture tiling:
Remember when changing the color texture to something else, also change the Normal Map to match:
If you don't see any changes on your landscape, you need to assign the Material Instance onto the landscape.
Select the Material Instance inside the Content Browser:
Select the Landscape in perspective viewport and go to Details panel and update the Landscape Material with Material Instance by clicking on the arrow Use Selected Asset from Content Browser:
You know have a very powerful tool to use with all your Materials.
Learn EVERYTHING you need to know for how to create/sculpt landscapes and create/paint landscape materials entirely in UE4 without any external software with "UE4 Fundamentals Vol.2: Landscape Essentials".
Home Terms of Use/Trademarks/Disclaimers Privacy Policy Donate About Contact
All content on this website is copyrighted ©2008-2024 World of Level Design LLC. All rights reserved.
Duplication and distribution is illegal and strictly prohibited.
World of Level Design LLC is an independent company. World of Level Design website, its tutorials and products are not endorsed, sponsored or approved by any mentioned companies on this website in any way. All content is based on my own personal experimentation, experience and opinion. World of Level Design™ and 11 Day Level Design™ are trademarks of AlexG.
Template powered by w3.css