Creating a mirror material

Now that we've created one of the simplest materials, let's get a little more complex by creating a mirror material while learning about some of the other properties the Material Editor has in the process!

Getting ready

Before we start working within the Unreal Editor, we will need to have a project to work with:

  1. First, open up the Unreal Editor by clicking on the Launch button from the Unreal Engine Launcher.
  2. Start a new project from the Project Browser window by selecting the New Project tab. Select First person and make sure that With Starter Content is selected and give the project a Name (Cookbook_Chapter7). Once you are done, click on Create Project.
  3. You should see a level similar to this:
    Getting ready

How to do it…

To start creating a mirror material, we will perform similar steps to what we've done before:

  1. Go in and create another material in the Content Browser tab by going into the Materials folder and right-clicking and selecting Material.
  2. Rename the material to Mirror Material and double-click on it to enter into Material Editor.
  3. Just like before, we want to give a color to our mirror. To do this, right-click to the left of the Base Color value and create Constant3Vector and give it a value of 1,1,1 (also known as white).
  4. Next, we will want to modify the Metallic property, which will modify our material to be more metallic and shiny. Create a constant value by right-clicking and searching for Constant and set the value to 1.

    Tip

    Alternatively, you can also press and hold the 1 key and then click on the material graph to create a single scalar constant value.

    How to do it…

    Notice how it makes the item much more shiny just as metals are in real life. When we set this value to 1, it means that it is a full metal object; we use 0 for non-metal objects and increase the number for more metallic things.

  5. Next, we will modify Roughness; this will modify the material in such a way that it will look more rugged or shiny depending on what we set it to, and it just so happens that when things are shiny, they are reflective, so we will set Roughness to 0.
    How to do it…

    From here, you get to see a skybox being reflected in the background that is representative of what you'd see if you applied this material; everything around it will be reflective like a mirror. The higher the value is for roughness, the less reflective it will become.

  6. With this, click on the Apply button and close the Editor.
  7. Jump into the Example_Map level in the Maps folder and apply the newly created Mirror Material to some of the surfaces by dragging and dropping them onto the scene.
    How to do it…

    Applying the mirror effect

With this, we now have a new material that we can work with, with a really cool effect while also seeing how the Roughness and Metallic properties work!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.168.2