UE4 Intro To Materials - Page 3


Index



Part 2 - Our First Material - Page 3


Diffuse Only Material


  1. Lets go back to UE4. Select the Content Browser and look at the included Textures folder. We will be importing the carpet here. The Supplied folder holds textures I have included in the walk through.
Create new sprite with button

  1. You can drag and drop the T_Office_Carpet_D texture into the **Textures folder in UE4:
Create new sprite with button

  1. It takes a few moments to import.
Create new sprite with button

  1. Double click the texture file you just imported:
Create new sprite with button

  1. Take a look at the newly imported texture. Confirm that the size is 2048 by 2048. Look at the Compression Settings. We will use the default compression but you can try different ones and see the difference in size and resolution. You can also make “Photoshop” like adjustments for some in engine fine tuning but it is probably best to do this in Photoshop unless it is a small adjustment.
Create new sprite with button

  1. Now go back to the Import folder and drag and drop the carpet static mesh into the StaticMeshes folder. The file is called SM_Carpet_1:
Create new sprite with button

  1. Look at your FBX settings. You don’t need a collision volume as it is included in the file. Make sure the others look right to you as this is a simple carpet.
Create new sprite with button

  1. Drag an instance of the carpet and put it in the middle of Room 1:
Create new sprite with button

  1. Now lets create a new material with the tileable texture we just made. Double click the Materials folder and press the Add New button and select Material:
Create new sprite with button

  1. Call the name of the newly created Material M_OfficeCarpet (by right clicking and selecting Rename or press F2):
Create new sprite with button

  1. Double click the new Material and look at the editor. In the top left corner we have a sphere that shows us the Material. In the main area we have a node with various pins that we can plug texture maps into. Lets add a node to add the texture we just created. Right click to the left of the main node and type TextureSample (you don’t have to spell the whole name it will reduce the choices based on what it finds). A shortcut is to left click while holding the T key on the keyboard.
Create new sprite with button

  1. You should have a node called Texture Sample. This node has 5 pins. The top pin on the right has all the channels (Red, Green, Blue and Alpha) and the four pins below have the individual channels (R G B A). In the Details panel we can set up the various settings for the pin but the most important one is assigning a texture:
Create new sprite with button

  1. In the details panel select the menu next to the Texture and start to type T_OfficeCarpet_BC. Then select the texture you just exported from Photoshop:
Create new sprite with button

  1. We can at any time preview what the Material looks like from that point in the Node tree. You right click on the Texture Sample node and select Start Previewing Node:
Create new sprite with button

  1. Drag the top right pin from the Texture Sample node and drag it towards Base Color:
Create new sprite with button

  1. Drag on top the the Base Color pin and if it is compatible you will see a green check mark. Let go of the left mouse button and it should connect the two nodes:
Create new sprite with button

  1. Now right click on the Texture Sample node and select Stop Previewing Node. Now you will see the material on the sphere in the top left corner and it will look the same as it did when previewing the node (which makes sense as that is all we are doing). Now before you can see it in game you need to press the Apply button. It is also good practice to save as this prevents you from losing work if the engine crashes (which it can).
Create new sprite with button

  1. Drag and drop the material on the on the carpet.
Create new sprite with button
  1. Now run the game and walk up to the carpet. Look at it and see if you are happy with the tiling and the seams. Next up we will look at adjusting the scale of the texture if you want to resize it.
Create new sprite with button



<- Previous   Home    Continue ->