In this tutorial, we’ll walk through the process of texturing a 3D mesh in Unreal Engine 5 (UE5) using a master material and material instances. This workflow is efficient, flexible, and allows you to create complex visual effects while maintaining a performance-friendly approach. Using material instances is ideal because it enables you to create variations without duplicating the entire material setup.
Step 1: Importing Your 3D Model
- Import the 3D Object:
- Open Unreal Engine 5 and create a new project or open an existing one.
- In the Content Browser, drag-and-drop your mesh into your folder. You can leave everything at default
- I have multiple separated objects but if you have one mesh but need multiple textures, I do have a tutorial showing you how to use multiple textures on one mesh. The link is in the description.
Step 2: Creating the Master Material
- Create a Master Material:
- If your mesh has a Material, you can use it as your Master Material. Otherwise, right-click in the Content Browser and choose Material.
- Name this material something like M_MasterMaterial.
- Open the material by double-clicking it.
- In the material editor, you’ll set up the basic input nodes for your material:
- If you have a material, you should have a Constant 3 Vector which can be plugged into the Base Color. If you do not have this node, you can right-click and search for it in the menu.
- You can change the default material color in the Details Panel.
- In order to change this color in the Material Instance, you need to right-click and ‘Convert to Parameter’. Name the node ‘Color’ so you know what the Parameter is referring to in the Material Instance.
- For the Metallic Map, right-click and add a Scalar Parameter. Rename it to ‘Metallic’ so you know what the Parameter is referring to in the Material Instance.
- For the Roughness Map, duplicate the Scalar Parameter. Rename it to ‘Roughness’ so you know what the Parameter is referring to.
- For the Emissive Map, duplicate the Color Parameter and rename it so you know what the Parameter is referring to in the Material Instance.
- Next, duplicate the Scalar Parameter and Rename it to ‘Emissive Strength’.
- To mix these two parameters and use them for the Material, right-click and search for a Multiply node. Connect the Emissive Color into the A input and the Emissive Strength into the B input. Then, connect the Multiply node to the Emissive Color of the Master Material.
- After setting up all the parameters, save your master material by clicking the Apply and Save buttons.
Step 3: Creating Material Instances
Now, we’ll create material instances based on the master material. This allows us to tweak individual parameters for different objects or situations without duplicating the entire material setup.
- Create a Material Instance:
- In the Content Browser, right-click on the M_MasterMaterial you created and select Create Material Instance.
- Name the instance something like MI_Slate.
- Adjust Material Instance Parameters:
- Double-click on the material instance (MI_Slate) to open it.
- In the instance editor, you’ll see the parameters you defined.
- You can assign different textures to each parameter here. For example, assign a different BaseColor texture, or adjust the Roughness parameter to create a glossy or matte look.
- Save the Material Instance.
- Apply the Material Instance:
- Go back to your 3D model in the scene.
- In the Details panel, locate the Materials section.
- Replace the default material with your new material instance (MI_Slate).
- Create More Instances (Optional):
- If you want to create variations for different models or different sections of your model, you can create more material instances based on the same master material.
- For example, you might create MI_Metal and tweak the BaseColor or Metallic to give it a unique look while still using the same core master material.
Step 4: Testing and Fine-Tuning
- Adjusting Material Instances:
- After applying the material instance to your object, you can easily go back and make adjustments to any of the parameters. For example, changing the BaseColor texture to a different one or tweaking the Roughness for different visual effects.
- Use the Viewport in Unreal to see the material applied in real-time.
- Optimizing for Performance:
- Since you’re using material instances, performance will be optimized because UE5 only needs to load the master material once. You can create different instances with unique parameters, which is more efficient than creating multiple materials for each variation.
- Avoid using overly complex shaders in the master material if your target platform is lower-end hardware (e.g., mobile or VR).
Conclusion
By using a master material and multiple material instances in Unreal Engine 5, you can efficiently create a variety of looks for your models without overwhelming the system with redundant materials. This setup gives you flexibility and performance optimization, which is essential for both development and runtime in Unreal Engine.