Difference between revisions of "JohnnyEnglish tutorial Working with UE4 Materials"

From Custom Map Makers Wiki
Jump to: navigation, search
(Map Material Master)
(Map Material Master)
Line 54: Line 54:
 
*Create a '''Parameter2d''' object and duplicate it 3 times, name these as shown BC, M, R, N
 
*Create a '''Parameter2d''' object and duplicate it 3 times, name these as shown BC, M, R, N
 
*Connect the left side to the multiply, connect the RGB to the appropriate material pin.
 
*Connect the left side to the multiply, connect the RGB to the appropriate material pin.
 +
 +
Save this material master, close the material editor.
 +
 +
==Material Instances==
 +
 +
Right clicking the MM_TrainingRoomsPBRMaster material will give you the option to create a '''Material Instance''', do this.
 +
 +
[[File:Mat05.JPG]]

Revision as of 06:38, 12 August 2021

UE4 includes a very rich material editor, fortunately it's very easy to use and we'll use it now to start making all the materials we're going to need.

For this tutorial I've chosen to use a concrete theme and for the ground, a mix between sand, grass and pavement.

Let's start with a very simple Chrome material.

  • Right click inside the Materials folder, we created this folder earlier in the tutorial but if you missed/skipped that, don't worry simply duplicate this file structure and continue.
  • Create a new Material, name the material M_Chrome, the M_ prefix denotes, in UE4speak, that this object is a material.

Mat01.JPG

  • Double click to open the M_Chrome material to open it, right click in the Material Editor to add a Constant3Vector (Colour)
  • Set the colour to be white using the left side properties.

Mat02.JPG

  • Add a Constant, value of 0 and connect it to the Roughness material pin.
  • Duplicate that constant (Ctrl-W), set it's value to 1 or .8 and connect the pin to the Metallic pin.

Mat03.JPG

Material Instances

There are performance considerations for all elements of UE4 mapping, while the engine is very powerful a game with a rich environment and many player characters will require be required to draw things, calculate things and deal with network traffic on every tick of the engine and when we can reduce the load on what is required, the game will perform better.

So we consider performance when we build the mesh by making it as simple as possible. We consider performance when creating collision, smooth simple collision will improve game performance, textures and other assets will also be optimized for performance.

So it makes sense to take the same approach to materials.

Material Instances are more efficient method of creating materials (FIND REASONS)

Map Material Master

For this tutorial we will make four concrete materials using textures.

For each material we'll use 4 textures to represent:

  • The materials colour/pattern/albedo
  • The roughness or the material
  • The metallic (shininess) properties
  • A Normal map to represent small height changes on the surface of the material

I've included a set of textures with this tutorial, you can download these DOWNLOADLINKFORTEXTURES, unzip these and import them to the tutorial map Textures folder.

Create a new material in your tutorial Materials folder named MM_TrainingRoomsPBRMaster

Mat04.JPG

In the material editor:

  • You will need to add a TextureCoordinate
  • Drag out the pin to a Multiply
  • Drag out the B pin to a ScalarParameter, set it's default value to 1
  • Create a Parameter2d object and duplicate it 3 times, name these as shown BC, M, R, N
  • Connect the left side to the multiply, connect the RGB to the appropriate material pin.

Save this material master, close the material editor.

Material Instances

Right clicking the MM_TrainingRoomsPBRMaster material will give you the option to create a Material Instance, do this.

Mat05.JPG