♪♪♪
Zak Parrish: All right, here we are inside of a blank
project with the Starter Content enabled. I have opened
up the StarterMap. You will find that
within your Starter Content. You will need to go to File >
Open StarterMap to get to it.
We are going to create our own custom material.
We will start off by making it very basic.
Then as we move forward, we will add some textures to it,
and we will turn it into something practical. After we have made something practical,
we will make something that is just cool.
For starters, we need something
we can work on. In this level, we have several different
objects floating around that are perfect for
showing off a material. I will give you kind of a heads up
just to be completely transparent. I am working on
an early version of the engine. It is kind of a pre-release.
What you see here in the Starter Content might be slightly
different than what I have here. If you end up
seeing a different object, that is okay. You should see something.
No matter what you see, it will work for our purposes.
I am going to select this object, hold down the Alt+Shift keys,
and drag the object to the side.
By holding down Alt, I am making a copy. By holding down
Shift, I am moving the camera with us. So I get a nice, clean slide over here
and I get a brand new surface to work on.
Now, it is time for us to make a material.
Materials are Unreal assets created in the Content Browser. I am going to
move over to the Content Browser in the lower left-hand corner of my view.
If for some reason you don't see it, you can click on the
Content Browser button up in the toolbar and that should bring it back for you,
even if it is floating. It could be anywhere if you have moved it around.
Hopefully, you are close to your default settings and the Content Browser is over here
in the lower left corner.
Click on the Materials folder. There are already several different
Materials that exist inside this folder that we can look at.
Adding materials to a surface is extremely easy. Really all you have to do
is drag-and-drop from the Content Browser, and your material will
automatically be applied. For instance if I take this M_Grass_A here, drag that onto
the ground and let go, we get grass on the surface.
It is very quick and easy. If I drag in this M_Metal_Copper,
we get copper instead. I am going to press CTRL+Z twice,
and get the surface back to where it was. Now, I want to
apply a material to the surface of this sphere thing.
I am not sure what this is, but it does look really cool.
If I grab M_Metal_Copper and drag it onto the object,
it covers up the entire surface. This allows me
to mention the concept of material elements
casually without it becoming too much of a distraction.
For those who have created
3D content in 3DSMax or Maya, you know when you have multiple
materials applied to an object, each different material
you have applied to a single surface creates a separate material element
when you bring that object into UE4.
Here, we have two (2) elements. We have Element 0, which is this
M_Base_Metal you see covering the outside of our surface.
This is a zero based list. We have Element 1, which is the little Unreal Engine trappings
that are kind of around the ouside.
I am going to grab M_Metal_Copper.
Instead of dragging-and-dropping it on the surface like I did before,
I am going to drag M_Metal_Copper into the Details panel right
on top of Element 0, and let go. You will notice it only assigned the material
to that one element, which is extremely useful and very cool looking.
You can see all those nice reflections. With that understood, now we know how to apply
materials; let's take a look at creating our own.
Here in the Materials folder within the Content Browser, I am going to
right-click on a blank space. You will see I have the ability
to create a new Material right here under Basic Assets. Another way to do that
is to click the New Asset button and choose Material.
It does the exact same thing. Do whichever you are comfortable with.
Depending on your settings in the Content Browser, it may be difficult to find a blank area
in here to actually right-click and create a Material.
In those cases, click the New Asset button. This will create
a brand new material that you need to rename. I will call this "MyMaterial",
which is extremely descriptive, as I'm sure you would agree.
Now, we are going to open MyMaterial up in the
Material Editor. Double-click MyMaterial to open the Material Editor.
Here is your crash course on the Material Editor.
At the very top, there is a toolbar
with some common functions. We are going to be using a fair amount
of these as we move forward, but not all of them. Like I said, this is
kind of an introduction. We have the preview window where you can left-click
to drag and rotate around. If you see
a grid in here, you can turn that off with the Grid icon in the upper right-hand corner.
If you like seeing the grid, leave it on. If you don't, then turn it off.
We have the Details panel, which is where we will change all of our
different material properties as we work with the various nodes
and connections that will define this material.
We have our graph area. This is where all of our
nodes are going to be placed. On the right-hand side, we have our
Palette. This is a list of all of the different types of nodes we have access to.
Now, I will be completely honest. Everyone has a different workflow,
but I tend not to use this list very often.
That is primarily because you can get access to the exact same thing by
right-clicking inside the graph and typing out what you want.
However, if you are just getting started and you don't really
know what you have access to, then the Palette becomes very useful.
Another nice feature of the Palette is it shows you the various
hotkeys you have that will allow you to quickly create certain nodes.
For instance if I need a Constant (which is just a node that holds
a single float number), I can hold down the 1 key
and click in the graph, and that will create a Constant node.
There are several of these. For instance if I need to make a Multiply node
to multiply two (2) values together, I can hold down the M key
and click, and the node magically appears.
The Palette gives you quick access to all of those
different hotkeys. Scroll down and you will see each one listed.
The Palette is very useful for that.
Let's go ahead and start making
our new material a little more more interesting. Just a quick heads up if you
haven't done anything to a material yet, and you try to apply it.
I am going to do this now. I am going to slide my Material Editor
out of the way for just a moment. You can see MyMaterial here
in the Content Browser. I am going to drag MyMaterial into the Details panel,
and release the mouse. There you go.
There is a slight discrepancy that you will notice here.
In the preview, we should have a black material. That is
expected because we haven't really done anything to our material. We have left everything
at their default values. However when you apply this within a scene, you will notice you get
this default material with a grid texture applied. This is just
so that it is quick and easy for you to identify materials
that don't have anything going on with them.
If you ever break a reference somehow
or you delete content out of your project that is
in use in your scene, then you will notice this material will apply
anywhere you are missing content. Generally when you see this default material,
that could be a bad thing.
In this case, it just means we have a material where nothing is currently going on.
We are going to manipulate this material,
but we are going to spend most of our time looking at the preview
so we don't have to keep jumping back and forth to the actual scene.
For starters, let's change the color of our material.
Here, you can already see the Base Color input.
This node you see here is our Material node. This is really the highest
level of our material. We are going to plug other nodes into this.
To get a color, we need a Constant 3 Vector node.
Now, that sounds like a long way to say color.
If you are a complete lay person you might think, "don't you just have a color node?"
The answer is not really, and here's why.
If we look in the list in the Palette, we can see there is a Constant3Vector,
which I can drag-and-drop onto the graph.
Alternatively, I can right-click and type,
"3vector". I can create it like that. As you saw earlier,
I can hold down the 3 key and click, and that will create one like so. The reason
it is not just called color is because you may not always be using this node to store
color. A vector 3 is just a number with three (3) elements.
You might use any one of those elements for a lot of different things.
It is kind of a programmer-style term. Let's go ahead and
double-click on the Constant 3 Vector node.
As I double-clicked the node, it brought up the Color Picker.
We are going to slide this over to a brilliant orange. We will make sure the value
gets lifted all the way up, so I have a really bright, intense
somewhat obnoxious shade of orange. We will connect that
right over to Base Color. To connect it, all I am doing is mousing over
the pin, drag off (you see that gives you a wire), plug the wire straight into
Base Color. It is very intuitive. I can reposition this node just by
clicking and dragging on it. You see that wire stays connected.
We have our first connection to the material
taken care of. You can see how Base Color works. We can double-click and choose
any other color we want. You will see that your material updates with the new color.
For now, I am going to leave mine on orange. That is a little too yellow.
Let's push that a little more towards red. There we go. I like that a lot
better. Next, let's take a look at our Metallic value.
As I mentioned in the previous video, Metallic controls how metal-like the surface is.
Most of the time, this is going to be a value of 0 or 1 and
generally nothing in between. Let's hold down the
1 key. If you take a look in the Palette, that is going to create
a Constant. Hold down 1 and click.
As far as I'm concerned, this Constant is just going to hold a number. That means
I don't really care what the preview thumbnail shows, so I am going to collapse
it by clicking on the little white triangle in the upper right-hand corner.
That makes the node nice and tiny, and it doesn't take up a lot of screen space.
With this node selected, I am going over to the left to the Details panel
and set the value to 1.0.
Connect the Constant to the Metallic input.
If you take a look, suddenly our preview
indeed now looks like it is made of metal.
Let's jump back and forth. Let's set the Metallic back to 0.
It looks kind of like plastic. Set the Metallic
to 1.0, and now it looks like metal. We can set it to 0.5
and there is where you get that kind of not quite
realistic, partly metal look.
Or partly metal, partly plastic.
Let's move onto our next input. Specular is a bit
of a different creature. If you are coming to this from UE3,
you may be tempted to apply specular color in here and that is not
how this works. Specular is actually kind of an artist's
tweak for how specular or how shiny a surface is. I am actually going to skip it
and come back to it in just a moment. For now, let's take a look at Roughness.
As I mentioned in the last video, Roughness is how rough the
surface would feel at the near microscopic level.
I guess you could say the macroscopic level. I think that works.
Let's create another constant value. I already have one node that
is a Constant here. I can press CTRL+C and CTRL+V
to make a copy of the Constant node.
Drag off the Constant and plug it into Roughness. We have a Roughness value of 1.0.
As I mentioned earlier, this looks very much like chalk.
You will tend to leave Rougness capped out at a value of around 0.9
or maybe 0.8. You are starting to get just a little bit of that specular highlight
right across the edge of the surface, but it is pretty muted for the most part.
If we change the Roughness to 0, we have a perfectly
reflective material. In this case, you can see it is picking up
the result of a cube map with a little skybox.
A more realistic value might be something like 0.1, so you are getting
just a little bit of blur in your reflection. If you want something like a perfect
mirror, Roughness might be something like 0.5. By the way if you are
interested in making something that looks like a mirror, all you would really need to do
is make sure your Roughness is really low, your Metallic is at 1.0,
and set your Color to white.
You essentially get a mirror. I have had a couple people who are totally new to this say,
"But Zak, a mirror is generally made of glass.
Glass is not a metal, so why are you setting Metallic
to 1.0?" The truth is that all the glass mirrors in your home actually
have a metal backing. In some cases, I think they even use silver to back
the mirror. The glass kind of provides a reflective and protective
coating to keep everything nice and shiny.
Let's go ahead and select our orange color again.
Let that process. There we go. Now we have a nice metallic color.
Let's set the Roughness back to something a little bit more
realistic and kind of rough, about 0.4.
Also, if I set the Metallic to 0,
note the difference in reflection in terms of roughness. If set the
Roughness to 0, with Metallic also set to 0,
you see we are getting perfect reflections, but
it really does look like polished plastic. Compare this with setting Metallic back to 1.0
where you get more of the color of
the surface coming through in the reflections just like in a glass ornament, or something similar.
Set the Metallic back to 0.
If I set the Roughness up to something high like maybe
0.7, you see how things kind of start to look like sort of a
corrugated plastic. Now that allows me
to take just a moment and show off specular.
I am going to change the Specular input to 0.2.
Specular is only going to work on non-metallic surfaces.
The moment your Metallic is set to 1.0, Specular suddenly
ceases to exist and that is important to note.
All this is really going to do is give you an artist's tweak to how
bright to how bright your specular reflections are.
I won't create a node that way. I will show you that one a little bit later.
Let's make another copy of this Constant. I can also press
CTRL+W, and that will duplicate whatever I have selected.
The default value for Specular is 0.5.
We will plug the Constant default value into Specular. Nothing is going to change. Now watch
the preview as I change the Specular value to 1.0. You might have to look very closely.
At 1.0, you can see the specular highlights, particularly the reflections of the clouds.
I am going to change the Roughness
all the way to 0 even though it is kind of unrealistic.
Take a look. Here is the Constant default value with a Specular of 0.5.
You can see those clouds, but they are muted into the surface just a little bit.
Then when I boost Specular all the way to 1.0, you see the clouds
become a lot brighter and easier to see. Conversely, setting Specular to 0
removes my reflection. Again, this is just kind of an artist's tweak.
If you were to put a texture into this, this is a way
to make sure your darker areas on a non-metallic
surface, are not reflecting very brightly.
In our case, we don't really need to worry about tweaking that. The
default value is just fine. I am going to select this Constant node and press Delete.
With that, we have created a very, very simple material.
Let's slide the Material Editor out of the way for now.
Actually, let's bring the Material Editor back. We have already applied the material.
You can see over here in our view, it hasn't updated.
Inside the Material Editor, we have this nice orange, shiny plastic;
but we see nothing in the scene.
Let's make sure we fix that. To fix that, all we need to do is apply our changes.
I am going to show this in the background. In the Material Editor, click
on the Apply button. This will process our Material
and as soon it is done, we can see the update
live in the viewport.
With that, we have created a very, very basic material. You have seen how to make a
material in the Content Browser, how to apply it by dragging-and-dropping it onto a surface,
as well as how to apply it by dragging it into the Details panel.
That is going to wrap things up for this video. Thanks a lot.
♪♪♪