Transcripts
1. 1. Introduction to Materials in Unreal Engine 5: Welcome to introduction to
materials in real Engine five. It is my pleasure to have you here with me in this course. We are going to learn
a lot of things here. Materials represent 70% of the visual quality
of your games maybe, and we're going to learn a
lot of things about them. We're going to create a rock master material, and with that, we're going to apply all
the basic principles such as the basic
node operations, how to blend different
colors, normal map changing, creating functions,
vertex color, height contrast, work
aligned textures. We're going to work
on a slope mask. And by the end of this course, you will have a rock
master material that you can use in
your projects and also apply all the most
important notes of materials. You're going to learn them here. So by the end of this session, you will be very confident to create your own
materials in the future, and you will have a very,
very good understanding on how to work with materials
inside and real engine five. So let's get started.
2. What are Materials?: Alright, so before we go
into creating materials, we need to understand what are materials and why it's
important for you to learn it. Materials are
basically the painting that you have in your surface. Like, it can come, like in many different
shapes or forms, such as just a solid color
or maybe a brick material, ceramic material
or glass material. Grass, metallic materials,
materials with lights, even water can be
considered a material. So basically, everything that you see in the world
has a material. Even this thing has a material. It's called the MI Proc grid. And everything you see in the world no matter what,
we'll have a material. That's why it's really important for you to learn
how to create those because just like my old
boss said at UBISov, she told me, You know what? Materials pretty
much will impact 70% of the visual
quality of your game. And you know, it can be a little bit
tricky at the beginning, but it's a very, very fun topic. So what we're going to
learn here is how to create those different types of materials that you can
use in your projects. We're going to go and create
a master material later on so you can apply everything
that we learn in this course. And obviously, you will have a good understanding on
everything that you see here, any kind of material you want to create, you will be able to. So with that set, let's start explaining what are materials and what is
physically based render.
3. Creating your first Material: So in order to create
a new material, we just need to press control space to open
the content drawer, right click, and you will see that you can create
a material here. Now, you have another tab here where you can just
create a material, material incense or material
parameter collection. We're going to take a
look at those later on. But for now, we're just
going to go into material. So with that, we're going to
just call it, put it an A. It's always a good idea to
just call it like underscore, and let's just put it like
my test my first material. It's always a good idea to put M underscore so that you know, which type of acid
you're working with. And just like that, we're
going to double click on this. And what you will see here, I'm going to make
this window bigger. What you will see here
is that at the right, you have the outputs. And here you will put all the inputs here that
go for your material. So our material looks
like this at the moment. Like the base color
is like that, the specular value is like
that, the roughness like that. We're going to take a
look at all those later. But for now, if you want
to preview your material, you just need to go to plus, go to shapes, and let's
just put a sphere here so we can take a look
at how it looks like. So let's apply our material. By applying a material,
it's very easy. You can just drag and drop
this one, and there you go. That's your first material. Now, if we want to
change the base color, you can go to the palette
here on the right. If you don't see it, it should
be here on Window palette. There you go. There are
multiple ways to access this. You can also right
click or you can tap to access those in
different categories. So obviously, we're
going to go and create the most important notes first so you can get
familiar with materials. And we're going to go for a
constant three vector here. You will see that you have
the hot keys here, one, two, and three and four for constant
one, two or three vector. So you can just
drag and drop here. And if you want to create, use a shortcut, hold the
number and then click. For example, I just
hold three and click. If I want a constant one vector, I will just hold it like that. Constant two vector,
I'm going to going for it like that and
constant three like that. So you may be thinking, why do we need constant one, two, or three? When
do we need those? Well, basically, color
is based on RGB values. If we open up some of those
textures, you will see here, for example, like this one, you will see that every
channel has a value. The red channel has a value, the green channel has a value, and the blue channel
has a value. And when you combine
all of those channels, you get the final color. So if you want to put a color here to use
all the three values, you can just drag this
here to the base color, and you can click here on the left where you can change
the color let's just put it something like kind of
like orange color, right? Now, nothing will happen here
because we haven't apply. So if we apply this, you will see that our material
has already changed. Now, you will notice
that you can also put single values here, for example, this one,
which is pitch black. You can also apply it here. And by the way, if you
want to drag a note, just drag here and
just like that. Okay. So obviously for color, you're going to use
constant tree values, but there will be
some cases where we want one vector only
or two vectors. For now, we're just going
to work on the color. So just like that, you have just created
your first material. It doesn't have anything
fancy here. Alright. So what we're going to do now is to talk about
physically based render. We're going to do that
in the next video.
4. Understanding PBR: Alright, so we create our first material and
now what we can do. Well, a material it's basically composed of a lot of
these outputs here. You can see here that we have metallic, specular
value, roughness. We have normal map,
we have tangent, we have or position offset, ambient clusion a
bunch of those. Different inputs will give you a different look, obviously. So the base color is
pretty self explanatory. It's the color that you will have in your
material, right? So in our case, is this
orange color, right? So we're going to go
here and actually, let me delete those with
just drag here and delete. And if you want to create
something here with metallic, you can just go to the palette
or just type constant, and you're going to go
for the constant here. Alternatively, you
can also press one and hold a one key and press it. It's going to be very useful for you to remember those hot keys. For now, I'm just
going to show you, and later on, I will
just use the hot keys. Or just going to put
it here on zero. All right, so we're going
to see what's going on, and I'm going to drag
this thing here. I'm going to close this for now. And you will see
that nothing has happened because obviously my material here is
already has a zero value. Well, what happens
if I put one here? If I put one and hit the ply, you will see that now my surface looks a
little bit different. And the reason is we're
using a metallic value here. Metalness is a very specific in output here because
you either want zero or one to be
physically accurate. That doesn't mean that
you cannot go for 0.5, for example,
something like this, let me show you
how it looks like. It doesn't mean that you
cannot go for these values. This is only a tool. You can use it however you want. But if you want the most
physically accurate value, you want to go for a value of either zero or
either one, right? So either for metallic, go for zero or one. Let's go ahead and see what
the roughness value does. We're not going to touch
the specular value here. Usually I recommend you
to leave it at 0.5, because it already
roughness and metallic will already do pretty much all the heavy lifting for you. So we're going to hold
one and click again and we left click here and drag this node here. And heat apply. And what you will notice here is that we have kind of like a mirror type of material,
isn't that really cool. So what happens
here, the roughness, I don't know if you
have touched, like, a really rough
surface like a rock. It's like, it starts like your
finger is hurting, right? But when you touch
like marble or glass, especially when it's
like a clean glass, they just clean it. You finger can just go there. It's just a very smooth surface. So obviously, the left
value that roughness has the more
reflective it will be. It's kind of like the surface
of this one has bumps here, and the more bumps you have, it's very microscopic
view of the surface. The light will hit
here and then it will bump into different
directions and then go out. So the reflection is lost. But when you have a really
smooth surface like this, like very little roughness, basically, the light
will come here, the reflection will go and go out and you will see
the reflection here. That's basically what
this roughness value is. So let me show you how it
looks a value of roughness zero and metallic
zero. It, apply. And you will notice that we
have a very smooth surface. So it feels like you
can almost touch, it's like one of those balls
that kids like to play with, like you know, like for babies, like, very, very plastic, no harm no harm at all. It's kind of like this very
smooth surface, right? As I increase the value, let's just say like 0.5, you will see that it has, like, a different value here. Now, it sees like it's
more rough, right? And if you increase
the value even more, to one, for example,
and hit Apply, you will notice that it
pretty much is very, very rough, no light, no reflection at all
coming through here. So obviously, the shorter the value, the
smaller the value, the less roughness it will
have and the higher the value, the more roughness it will have and you won't see
the reflections. Metallic is just pretty
straightforward. Is this a metal surface or not? If it's metal, we can just go
here and put it like that. And you can play with this a little bit, like, for example, a value of 0.6 on
roughness, like, a very rough metal, no reflection at all, probably a little bit
of rust here and there. So basically, these
three values, the color, the metalness value, which is only zero
and one, again, you can always change
the value if you want, but I highly recommend you
to leave at zero or one. And the value of 0.6 here, which is the roughness,
roughness pretty much, all these three will determine
the view of your material. Obviously, we
haven't talked about normal maps or emissive colors. We're going to talk a little
bit about that later. But for now, this is a very, very important concept to grasp. And if you already
understand this, you pretty much know almost
pretty much everything about PBR, which is the physically
based render. That is the industry standard
for rendering this type of services in real
time applications.
5. Using Textures: So so far, we have been using single values here to take a look at what you
can do with materials. But if you want to create a different look like these ones, obviously, you need
to use textures. So how to use the textures here. We're going to open up the
content dryer control space, and I'm using the
started content. You can go to At then
feature a content pack, go to content and click on
Star content at the project. And you will see a
folder like this. It has a bunch of assets. You also have some
textures here. So what I want to do is to basically grab one
of these textures, control space, and I can just
drag and drop this here. And what you will
notice is that I can just click here the RGB, which is going to be the red, the green, and the blue. Notice that here
on the white value here is the same one as this. So we're going to
just drag this here. And when we apply, what will happen is that our base color
will be different. You will see that we have a texture now instead
of a solid color. And basically, it
will give you some, you know, more information about what's the
color of the surface. Obviously, base colors
are really flat. You shouldn't put any
shadows here if you want to have the
best look, okay? So you notice that there
is also an Alpha here. That's the height map. So we're not going to use the
height map at all. Let's talk about that later. But for now, you can toggle
these values here on the texture editor
and you can take a look at those textures, how they look in their
individual channel. So what else we can do? Well, we can obviously disconnect
the metallic. You can just click Alt and click to disconnect
and leave it on zero. And the roughness, we're going
to use probably this one. So how do you use this one? Because roughness only ask you a value of just make it bigger so you
can understand better. A value of a single vector. And here we have a tree vector. We have red, green, and blue. So if you take a look at
each individual channel, like the red here, you will notice that this is
the roughness channel. How do I know that there
isn't any shadow information? It's only black and white. And to be honest, this
could also be the metallic, but let's be honest here. I don't think any kind of metallic surface
will look like that. If you go to the green one, this is the ambient occlusion.
How do I know that? This looks a little bit
like D. If you notice, like if you painting and
you add the shadows here, you notice that there
is some shadows here, whereas the red channel only
has very, very flat values. And the blue channel is
just the same value here. You can use either the red
and the blue for this. So now that we know
this information, instead of dragging from here, we can actually drag
from the red channel, put it on the
roughness, heat, apply. And you will see that now our surface looks a
little bit better. It looks a little bit weird because we don't
have the normal map, and it's a good time to
talk about normal maps. So what are normal maps? Let me just connect
the normal map so you can see what it does. I'm going to drag
the normal map here. I'm just going to place
it just right here. Let me delete those so that
we don't really need it. Apply. You will see now our
brick looks like a brick, right? What happened here? Well, normal maps are used when we have a
lot of detail here. So let me just open this up so you can take
a look better. Just like this. So
what are normal maps? Actually, I'm just going to
make it bigger like this. Normal maps are basically information that you see
from different angles. If you go for the red channel, you will see that the
shadows come here means the light goes from
this direction here. Is the light from
this direction, and the green one is the light from this
direction, right? So normal maps here are
useful because basically, you can see that here in my
in my texture properties, you were using world normal map, and the compression settings
is set as normal map, right? So what it does is basically
add all those values, like if it was model, but actually all the
details are in the texture. So when the light hits, it will treat it as, Okay, this is a rough surface. Like, I'm going to treat it like it's like a little bit of
a bump here and there, and this one is like inside, so I have a little
bit more information about the surface quality, not only the color of
it or the reflection, but also, you know,
the physical property. Like when you touch it, like, can you feel like
the roughness of it, like, the bumps and everything. Basically, it's pretty
much bump map, right? So that's what the
normal map does. And when you put it
here, obviously, it's going to make our
texture look really nice. If I disconnect this
with Alt and heat apply, you will see that
something's missing here. It looks very flat, and the reason is we don't
have any light information. So as soon as you put
the normal map, Bam. I just looks really, really nice, especially
when you put some lights. Let me hold and click so
you can see some lights. You will see that the normal map is working wonderfully here, even though our
geometry is just like, let me just go for this. Our geometry is
just really flat. We don't have any geometry
here in this mesh. The normal map is
doing the work for us. If we disconnect this, you will see that Oh, actually, there is no bump here. It's like it's kind of
like faking detail. For your measures. So it's very, very useful. It's not only for faking detail, but also for making your
surface look much more natural. So with that, we pretty much cover almost everything here. The green one is going to
be the ambient occlusion, but to be honest,
you're not going to see much of a detail here. Here, I just going to be
a little bit of cluted, but that's pretty much it. With that, you have all the
basics for your PVR material, which is the base color, the roughness, and oclusion I'm going to put it as optional. If you have it, you can just
connect it and that's it, and then use the normal map. The metallic obviously will need another texture if your
surface is metallic or not. But with that, you know pretty much about what physically
base render is about. And with that
knowledge, we can go on and add more complex
stuffing to this.
6. Multiply and Lerp Nodes: Alright, so now that you
know the basics of PVR, let's add more complexity
to our first material here. So what do you want to do is
to basically, for example, one of the most common
operations that you can do with materials is actually
changing the color. So how do you go about that? Well, there are multiple ways. I'm going to show you
a couple of those. The first one is the multiply. By right click, type multiply, you will see that I
have multiply here, I can just hit here. Now, this is such a
common aberration that if you do that very often, you also can press and click so you can add the
multiply here very easily. Just hold the M
and click and you have multiple multiply nodes. So what does it does? What does it do? Basically
connect this here. Okay. And multiply, basically,
it is what it is, right? You know, if you multiply
by a bigger value, it will just basically add
more into your material. So what you can do here is actually go for a
constant tree vector, hold tree and click. And go here. And now you will
see what happens when I hit apply is that my
texture now is black. And the reason is we are
multiplying everything by zero. So what happens here is
you have your RGB values. So, for example, like, I don't know, like 0.7, 0.2, 0.3, and then you
multiply by this value here. If it's zero, obviously, the result is going
to be zero, right? But if it's like zero point I don't know, if it's like 1.2, and then this value, it's going to be like 0.6, and basically everything
will change here. The easiest way to understand
this is like a tint. So we can go here
and actually put something like orange apply. And then what will
happen here is that everything here will be multiplied by
the orange color, so everything will
have a tint of orange. Now obviously, this will
apply to everything, right? So what else can you do? Well, you can use the larp node. Let's take a look
at the larp node. If I hold L, you can call Linea interpolate. Also a very useful note. You can press L to do that. So what will happen here? So basically, you need an
Alpha and two colors, right? So let me show you what I mean. If you remember our mask here, I have I believe it's
not in this one. It's here on the Alpha value. You will see that I
have an Alpha here where I have the white values here and the black values there. So what I can do here is
connect the Alpha here. And let's just say
for these values, we're going to go for B. B is going to be the it values. So B is going to be the
ones here, everything here. This is going to be B and A is going to be the black ones. So maybe we can
put, for example, put another constant here
and let's put something like blue and connect
this and click here. And this is exactly
what you can imagine. What's happening here is that we are using the larp node to say, Hey, in every black
value that you see here, apply the blue tint. And in every white value
that you see here, apply the orange
multiply by the texture. You can see here
that in this case, these ones are a little bit in a gray spot because this
value is not totally white. So you kind of in between the original color and this are maybe mix between the blue and the orange and you get
something like this. But you can see how the
larp node can help you a lot to change the
look of this, right? So what else you can
do? Well, for example, you can change the roughness. We can go for for
multiple Again, you can just right click here
and go for multiply node, and you can just go here. And for example, you want
to make it really rough. So you can multiply
by two, for example. Press one to put
the constant here, just like this, put
it here, hit Apply. All right. So now everything
will be very rough, right? However, if I put
zero, for example, I will multiply all
the values for zero, and what it will do is basically make
everything really shiny. Like, it doesn't look like
a brick at all, right? It's just very, very
smooth surface. So Again, multiply arp
note, very, very useful. Okay, you can use those
very, very often, pretty much for everything, one of the two most
important notes in the material editor. You can already see
how we're using those here by multiplying this to tint our original texture and
then using this color to just add another tint into
other areas that we have. Obviously, these masks are
really important as well. When working with materials, you need to create
your own mask. Most of the time the the
textures that you will download will come with several masks that you can work with,
and you can use those. So make sure to use these
notes to your advantage. They are really,
really important. Let's take a look
at another node that is also very useful.
7. Add and Clamp Nodes: So let's talk about
other important nodes that you will use very often, and that is the at node. The add node, it's pretty
much very self explanatory. You can just right click
and add. Click here. And let's take a look
at what it does. Let's just go ahead and put another constant
value by pressing one. But if you add by zero, like multiply when you multiply any value by zero,
it becomes zero. But if you add by
zero, nothing happens, right, because we are not
adding any value here. Everything stays the same. So what we can do, for example, let me just put a value
like five or maybe ten so that you can see
what's going on here. So you will see that everything starts becoming really white. And if I put a value
of like 1,000, I can just click Apply. Notice that it will
always be clamped here. Like, it always be one. Like, obviously, when you add
these values, for example, for example, you have the red, green, and blue, and 0.5, 0.3, whatever, and zero, if you add plus one, or you will have like 1.5, 1.3, and you have one. So basically, one, one, one equals white and this is in a new version of real before it didn't
used to have that. So what can happen here is
that you can use a clamp. So a clamp is really
important, as well. A clamp will make sure that
all your values are 0-1. And that's great, because
we can just go here. And anything below zero will
automatically become zero, and anything above one will
have maximum value of one. Now, you don't see
much difference here, but let me show you
what could happen when we actually add this
into the emissive color. We haven't talked
about emissive. We're going to talk
about it later. But for now, just so that
you can see what's going on. It's like, let me just delete this clamp and put it
here on the base color. Hit apply, you can already see in the preview how it
looks like, right? Like, everything has
a missive value, and obviously the values are so high that you are actually
meeting light from here. So this is where the clamp
becomes really useful. You can go for clamp
and go for here. You can obviously change
these values if you want. Go for the missive and take a look at what
will happen here. Now, our missive doesn't
have a value above one. Everything is at
maximum value of one. So this is very useful when you don't want
to break values, the clamp node and the at node. So if you want I don't know if you have seen some materials
that says brightness. Well, basically, this is
brightness and this is tint. So using these nodes here, it's going to be really, really useful for you.
8. Material Instances: Alright, so now
that we have this, let's delete this because
we don't really want to use it and connect it
to the base color. We're going to talk about
material instances. So what happens here is if I duplicate this by holding Alt, let me just click here, you will see that everything
has the same value, right? So what can happen is that you also want
to test some values, and, you know, going
back and forth, like we have been doing like going here to change the value, to see there, how it
looks like in the level, you can use a preview
as well to do that. But materialistances are
such an important aspect of working with materials
that we're going to learn how to use them.
So it's very easy. Just go for your material. If you don't know where
your material is, click on the treaty mesh that is using your material and go
here to the details panel, click here Bros to my asset and you will see
that your asset is here. What you can do is right click and create material instance. And I will call it I
my first material. So what I will do is to actually drag this and put it here. Let's just delete those.
We don't really need it. And what we can do is to
actually create parameters. So to put it simple, let's just right click
and compare to parameter. And this will be my tint color. Okay, it apply. And notice that
nothing has happened. So when we double click on this, you will see that I'm
actually in another window, and you will see that I
have my parameter groups here and I have my tin color. The value that you see here, it's going to be
the default value that you have in your material. So, for example, if
this value is white, the default value of my
material will be white. So right now, I haven't
I have this change, but if I go to the
default value, you will see that
I have white here. So what you can do is actually
just try here like this. You can just change any color. So, for example, I want
something like green, and what you will see is that everything
will update here. So you can do this
for everything. You can even right click on this texture and convert it to parameter and call it
my base color texture. You can do the
same here. Call it my mask texture and right click, convert it to parameter,
normal texture. I can do the same
for everything. I don't I don't
really want this. I'm just going to click
here and multiply this. I'm going to right click and
call it roughness, multiply. I'm going to leave
it at one for now. And just like that, we have create parameters for
our material insense. So now when we go here, you will see that you have
global texture parameters, roughness multiplies. So if I decrease this value, you will see it
becomes less rough. And if I increase it, it
becomes really rough like this. You almost don't
have any reflection if you put a value like that. You can put a value of one here. In these cases, it's
a good idea to put a clamp so that you can just
write drag here, type clamp. Just so that you don't
have values over one to not break the
physically based render. So we can just go for here, and you can just play with
a roughness at this point. And you can also
change the textures. For example, you want
another texture. We can just go back here and maybe we want to use this one here, maybe this one. And this one doesn't
have a mask, unfortunately, so it's going
to look a little bit weird. So and maybe we can just
go for I don't know, maybe this one and this
one, we can use this one. I don't know. And you will
see that we can also put the tin color to white and notice that my
material has changed. Now, what you can do is to actually create multiple
material instances. You can actually
create an instance of an instance so
that you can have, when you change the parent, all the childs will be updated, or you can just right
click and duplicate. For example, this is
another material, and this one will be, for example, this
one is like orange. And you will have
different materials here. Now, material instances are pretty much 99% of the materials that you have in your level will be instances. And the reason is when you have a good network
of materials, you don't necessarily need to create everything by scratch. You only want to
create instances, change the parameters, and
you're really good to go. In fact, that's one of
our main project here is going to be creating a
master material for a rock. So we're going to be using material
instances quite often. So these are material
instances, very, very useful. You're going to use them a
lot during game development. So with that, we're going
to go to the next lesson.
9. How to import textures from Fab: Alright, so before we move into adding our master material, we need to use Quilbridge. And QuickL Bridge is
basically the toolset that we have in unreal
integrated that we can use to grab some materials and
textures and some assets. So you can just go
to the Green plus icon, go to QuixLbridge. Now, Quicklbridge has been
updated, unfortunately. So normally, if you already
have something downloaded, you can just go to Local. Go here, for example. Let's just go for I don't
know, for this one. And we'll click on at you can just choose
any texture you want. There are a bunch of textures
that you can use here, go to home and you can
just find whatever here, you can just go for
rock and whatever. And here you can just, for
example, click on this one. And notice that I cannot
really download from this. Now we need to
download it from Fab. So if you click on this one, then you're going to go here. And how you download this? Well, you go for
materials and textures, and let's find this, for example, this rock cliff
here could be a good one, and we're going to download. We agree. And we're going to download that K. K is
what we need here. So we're going to
click on Download. I'm just showing you
this step because probably you're going to
encounter these same issue. So I'm going to wait
for this to download, so I can show you
how you can use them. Just wait a second. And there you go. Open
the folder, right click, and I will extrat the content.
And double click here. And you will notice
that I have a bunch of assets here that I can use. So if you want to import
them into unreal, you can just go here to the
contre drawer, control space, and we're going to create
a new folder he called textures and we're going
to import it here. It's going to be very
easy. We're going to grab the ambien occlusion, the base color, displacement,
normal and roughness. That's all we need for now. We're not going to use
anything else, I think, and we're just going to drag it and drag and drop it here. Now for the ambient occlusion, you need to make sure that
SRGB is off, of course. Then for the base color, you're going to
leave it as it is. You don't need to
change anything here. We're going to do the same for displacement and roughness, going to turn off RGB and the same one
for displacement RGB. Normal just need
to make sure that the normal map is
just like this. Now, if you have some textures from Bridge, download it here. Fortunately, for
me, I have some. It will be very easy. You can just click on any one of those. For example, this
one, click on AD and then it will create a new
folder with your new textures. So now that we have this, I need to show you
how to create a mask, and we're going to
talk about it later.
10. How to combine Texture channels: Alright, so let's talk about
how you can create a mask. A mask is essentially
what you see here. If you go to Mega Scans, you will see that you
have this texture here. If I double click on this, you will see that
it's kind of like a green texture with
a lot of colors. We talked about this before. The red channel has
some information. The green channel
has some information and the blue channel
has some information. So in our case, we need to
combine those textures. And usually you can do it
in substance or Photoshop. However, not every people
have that software. So I'm going to show you
how you can do it in real. So we're going to go to plugins. Click here and type texture. And you will see
here texture graph. Enable it and
restart the editor. I already did that, so I'm
not going to do it again. So now that you
have this, you can just create a graph
here on the texture. Let's see if we can see here, texture graph, there you go. And we're going to call it like mask generator,
something like that. Alright, so double
click on this. And what you will see here is a graph very similar to
the material editor, move exactly the same right
click to move around. Use the middle mouse click
to zoom in and zoom out, and you have a bunch of notes. Now, you have way less nodes. And what exactly what's the difference between these
and the materials is that you can basically create
new textures from here. So what we're going to do is
to go for split channels. Sorry, combined channels. Going to combine the channel,
and we need an input here. So we need a color or maybe I think
scalar should be okay. Never mind. Let's just actually just grab the textures here. So I can grab the
ambient clusion here. Right. And we're going to call
it like Ao just like that. And we're going to connect
this to the red one. Then we're going to go
here to the roughness one. The roughness is going
to be the roughness, and we're going to go
here to the green one. And then finally, we're going
to go for the displacement. We're going to
call it like that, and we're going to
connect it here. Now that you have this,
you will see here in my right preview that
I have a new texture. So I'm going to go
here, go to the output, and you will see that
my output is like this. So now that you have this,
you can just export this. Export this output, and that's it. Look at
what you have now. Now, you have a
new texture here. We're going to rename
it as T Rock 01 mask. All right. We're actually
going to create a new folder. We're going to call it Rock 01. We're going to drag
everything here, just like that and move it. Now, you go to keep
importing textures. We're going to work
with one texture for now and we're going to keep adding more as we create
our master material, but just so that you can use
this to merge the textures. You don't need to use Photoshop, very handy tool, new
as well in real 5.5. I believe it's here since 5.4, but it really doesn't matter. It is available for you,
and now you have this mask. So SRGB is off. You can even go here for the compression settings
and put it on mask. So it's like in the right
compression settings. And with that, we
are good to go. We have enough textures to
create our master material.
11. Creating the Rock Master Material: Alright, so we will
start with the project. We're going to create a
rock master material. So we're going to start
from scratch here, right click create material, and we're going to call it
my underscore Rock Master. Just like that. Alright,
so double click on this. And the first things that you
want to use when you create a master material like this is that you
need the textures. So let's grab those
textures here. Let's go into textures, the one we created here. So we're going to grab the
base color here. Okay. You can also go to texture
sample, just like that. And if you have this one clicked on and you
go to texture sample, then you're going
to automatically assign the texture here. So make sure important things about this, make
sure that the color, the sampler type
is set to color, and the rest for the rest of the textures is going
to set to mask. By default, it will
drag the texture, the property that you have
here next to the mask. So make sure that's correct, and then we're going to go to
the normal map. All right. So very simple, we're going to connect these ones
here. Just like that. And we're going to go here the red one to the
amine occlusion, the green one to the roughness, and the blue one. We're not going to use
the blue one just yet. We're going to use it
for something else. We're going to connect
the normal map here. Gonna hit apply. And actually we don't
need this anymore. We're going to go and
put the surface on here. There you go. Now,
we can also use like a cub we see how our texture looks in different sizes
and everything. So what we want to do first, obviously, it's
change the tiling. And that's something
we haven't touched on. So let me show you what I mean. If you hold the U bottom, you will go to
texture coordinate. You can also type here,
texture coordinate to get it. And what it does
is basically you have UV tiling like U and V. So all the textures
here go from X and Y, like X being here
and Y being here. So you can just style this like your UVs will
basically on a space 0-1. So you can multiply this texture so that you repeat the
texture like over and over, just like this, for example, and you have one texture
here and one texture there. And the way you can do
this is very simple. You just connect
these ones here. Just like that. And hit Apply. And notice that
nothing will happen. One thing I will do is to
create a material instance. I don't really want to I'm
going to create a folder like old materials just so that
you can select all those. Check those later if
you want. Just in case. For now, I'm going to right click Create material
instance just like we did before MIRock 01. And double click on
this and notice that we don't have any parameter,
that's totally fine. And the first parameter
that I want to have actually it's UV tiling. So I'm going to, you will notice here that if
I change this to two, so I hit Apply and you
will see what happens that my texture became smaller and basically it
tiles two times. So instead of
changing this value, the best way you can achieve this is by hitting the
multiply button here. And now you actually, I show you a really cool trick. You can just hold
Control and click here, and it will connect all the nodes that are connected here. Just press the Control and
drag it just like that. And now this value is actually going to change
the tiling for us. So we're going to go here
and create a constant, press one and click
to create a constant. You can also right
click and contand here, constant one vector.
We're going to go here. And in order to convert
this into a parameter, we just need to right click
and convert to parameter. This is going to
be my main tiling. By default, it's
going to be zero. We don't want that.
We want it to be one. So just like that, we're
going to hit that. And now what we can do
actually is just go for our master or
material instance, and we can go here and
change the tiling. And this is not changing because it's not the material
instance. There you go. So we're going to
change the tiling here, just like that, and you
can see what's going on. The smaller the value, the bigger the rock, and that works very,
very well for us. Now, this is as
simple as it gets. This should be the
most basic material that you can actually create. So the next thing that I
want to do is to actually, you know, make some adjustments
here to these textures.
12. Adding Texture Color controls: So one thing I want to
add here it's basically u texture adjustment colors,
something like that. Very similar to
what we did before. So I'm going to go here
and drag and multiply. And I'm going to show you a
new node called desaturation. There is also saturation, but we're going to use
desaturation for now. And we're going to just go here. Okay, we're going to go
here to the desaturation, and not going to use
the multiply yet, and we're going to add a value. So by default, it will be sorry, it will be saturation. Will be like zero, right? So actually, the saturation. All right. So what we can
do is to connect this. And let's take a look at what's going on in our
material instancee. What's happened is if I
increase the value to one, you will notice that my values are black and white,
which is great. Sometimes you want
a neutral color. And if you go all
the way to two, you basically
oversaturate everything. So for example, like five, it's just going to be the
opposite color of what we have, which is a reddish color. We're going to leave
it at zero for now. The same can be said about
going for minus one minus two. So, you know, feel free
to play with this. I'm going to leave it at
zero for now because there's also another node that
we may need to add, and that is the at bottom. So we're going to go
click A and click, click on at click here, and then I'm going
to press one and go here to brightness,
just like that. I'm going to go
here to brightness. Click here. And by default, it's going to be zero as well. So what we can do is to actually let's put the
saturation to one, for example, so that you can see what's
going on and then go to brightness and you can see
that I have a brighter rock, and I can just go
for zero again. You know, this may be something
that you may or not want. So feel free to play with this. One thing I want to do with
the brightness is that I want to limit the maximum value. So the maximum value, let's just say let's
just put -0.5 and 0.5. Sometimes you don't want to, you know, the user
to change any value. You just want to restrict
the values for this. So -0.5 and five, let's take a look at
what it looks like. So 0.5 should be very bright. And -0.5 very dark. Now, I don't know in which
situations you will use a super dark value, but just in case, you don't want to limit the
creative freedom. Right. So the next thing, it's going to be the color. So I'm going to go here and type I'm going to show
you a new shortcut called V. V and click is going to automatically create
a color parameter. So it's going to be Vd tint. And by default, I'm going
to leave it on one. So that you don't
change anything. I'm going to connect
this one here and I'm going to multiply everything
here with this color. Let's check our
material instancee now. Now what I can do is add a
tint like we did before. For example, like a blue one, we can tint it blue,
we can desaturate. We can even put this
value to one or limit this value minus
two and two, maybe. A we can just go here for
minus two or even two here. We can even put one
and everything will be the same color. And we can change the
tint here a little bit purple and change the
desaturation to 0.17. You can see what's
going on here and it's actually working quite well. We're actually having a tint on every single area
of our texture. That's great. We're going
to leave it like that, and I'm going to show you how
to create functions later.
13. Creating our first function: So let's create our
first function. Functions are very
important because you don't want to do the
work over and over here. And this is a perfect example where if we want to use
this in the future, then we may not want to
do this all over again. So let's create a
function for this. In order to create a function, you need to go here to the
contact drawer, right click, go to material, and then go to advance and
material function. So let's go here,
and we will call it material function Alvedo
controls. All right. So double click on
this and what you will see it looks like a material, but it has this preview mode here where you can see
nothing is going on. So it's going to be really
simple or just going to go ahead and copy
Control C and paste here. Now, just like this, it won't work because
we need an input here. And if you check our material, the input here is this texture. Now, this texture, obviously, we're going to put
a texture here. So what we need to
understand is that this texture is composed
of three different values, even fourth what we're not really using the
fourth one here. So what we can do is go here type input and go
to function input. And if you click
here, by default, you will see that you
have an input name. It says vector three, which means the type of the
input that you will have. In our case, vector three
is what we're looking for, but you also have solar, vector two, vector four, texture to the bunch of other stuff that
you can use here. Vctor three should be more than enough, so we're
going to go here. All right. And just like
that, what happens here. Let's change the output here. So let's call it new let's call it Alvedo with a new
tint, just like that. And the input will be my
Alvedo texture. All right. So notice that I'm
using the material, the parameters that I had before just because I want
to show you something. So let's go here. And there are a couple
of ways we can edit. We can control space and
just dragon drop this one. Right? You have
our function here, which that's exactly
what we are doing here. But if you want to
search it here, you need to change the here. In that description,
you can just type click anywhere here
empty in the graph, and the description,
you're going to type like I don't know, changes Alvido color and adds new tint and
just like that. And here you will need to
put exposed to library. All right, exposed to
library categories, we're going to call it
tutorial, just like that. Torial hit Apply, save. And now, when I go to my
material, I can go here. I don't know if I can type
tutorial here and you will see all the functions
that we are using here. And that's exactly the same. So just like that, what you can do is very simple. You can just connect this one here and connect this one here. Hit apply. And what you will see here is that nothing
has happened, but we have if we delete this, you will see that everything
just works just fine. We have our parameters here, and they just work the same
way they used to work before. Now, why I put the
parameters here. Just keep in mind I'm going
to show you why I did this. The parameters here basically
will be a global parameter. And this will not work if we
add another texture and we change these values here
because we're going to update all the textures
that are using this function. So in this case, what we need to do is to create another input here,
function input. This is a parameter vector one, so we're going to go
for scalar parameter. We're going to put it
here, and the name will be the duration, just like that. Now, we delete this. Okay, preview value as default. Yeah, we can leave it like that. The preview value
will be this one, the first one, zero,
and the brightness. We're going to actually, we're going to control
C and control V and the brightness we're
going to call it here, brightness, leave it at
zero, just like that. And here, we're
actually going to use Control C and
Control V, this one. This is going to
be a vector tree, and we're going to
call it AlvidoTint and value by default
will be white. Use preview value as default. Yes, sir, that's what we
want. Delete this one. Because what will
happen if you don't put use preview
value as default, I'm going to show
you what happens. Here, we hit apply,
and it works. It will work just fine.
And if we go here, you see that we don't have
the parameters that we have because these are only let
me move this one here. These are only inputs. They are not parameters. We cannot change them on
the material instance. So if we check this use
preview as default, we won't have a default value and what will happen if
we will have an error. And if you see here, it says missing function
input vedo tint, which means this
is not optional. And sometimes, in this case, you want it to be optional. You don't want to
change the color of every texture that you have. So in this case, we're going to put everything as optional. But because we really
want to change it, we're going to delete
everything here, and we're just going
to connect here. The saturation and
the vedo tint, we're going to just
move it right here. And just like that, now
we have a function. Now, this looks
like a lot of work, but now every time
I want to do this, I just need to track the
function here and I'm done. Another thing I want to
change is the order of this. Al VDO texture is
here at the bottom. Notice here that you have the
description, sort priority. So we're going to
grab everything here and we're going
to put it on one. We're going to click here.
And what you will see is that you actually have
the Alveda texture. Like this, right? We
have the Alvido texture, can put it something like that. There you go. We can even move
this like this if we want. Alveto texture now it's on the top because
the priority says that Alveto texture is
zero and the rest is one. So they go 0-1 to two
to three and so forth. If you want to move
the Alvedotin here, then Alvedotin will
need to be two, and then the brightness and
saturation need to be three. It's just a matter
of organization. It will work just as fine. So if we hit apply
and we go here, you will see that we have our parameters back and
we can do the same. So these are material
functions, very, very useful. Now that we know that,
we're going to go ahead and work with
our roughness texture.
14. Using Static Switch Parameters: So now that we have this
let's work on roughness, our roughness is
the green channel that we have in our mask. If you double click on this, you will see that the texture or roughness is
like this, right? So it's going to be very simple. I'm going to use a larp node. So hold L and arp, and the Alpha will be
this roughness here. And then I'm going to
change these values. The Alpha will tell me, okay, the white values it's the
number the letter B here. So I'm going to Press one and
click to create a constant. Right click convert
to parameter. I'm going to call it roughness
max, just like that. I'm going to leave it on one. There you go. And then we're going
to go here to A, Control C and Control. We're going to go
for roughness Min. And we're going to
leave the default value to zero, just like that. And then we're just going
to leave it like that. I really need to
change anything. And we're going to go here to the roughness, just like that. And let's take a look
what's happening here. So let's go to our material
instance, roughness, max, and mean if you go for
the minimum value, if you put something
like minus I don't know, minus two minus three, you will see that you
have very reflective, kind of, like, a wet surface,
which is really cool. Like if you are using like this material like
a rainy forest or something and you want to have the rock a little bit
wet, then just great. And then you can also
use that roughness max. Max value of this will be
like, I don't know, like two. And this one we can change it. You can just play
with these values until you find something
that you really like. This kind of like
a little bit of a wet surface, to be honest. Um, so that's great. Let's create a
function for this. So we're going to
one thing we want to do is let's use
control C control V. Let's create a new material
advance material function, MF, roughness control. Just like this. No click
on this output will be new roughness,
just like that. Okay. And we're
going to paste this. Now, the Alpha will
be our roughness. So we're going to go
for input vector one, Roughness texture,
just like that. Go for this one, and this
one will be my roughness Min. There you go. And my roughness max. Just like that. We can go
here and put it like that. We don't need this anymore. Use pre value, zero and one. That's great. And this one we really need This one
shouldn't be optional. We're going to
leave it like that. And also, we're going
to connect this here. Now, what we need
here is actually, if we go to input, we're going to look
here for a static bull. You can use static bull. We could try. So let's go here. There are a bunch of
ways you can do this. You can either do this in
the functions or outside. So like this, go
here to static Bull, and then we need a
static mesh parameter. So actually let's delete those. Keep it like this, and we're actually going to do it here. So we're going to go here
and expose this library. Can put a description
if you want, exposed to library tutorial and then go here to the
master, drag it here. There you go. Control C. We want to actually not
delete these values here. So Max and minimum will be here. Max should be optional as well. So let's go here and
not this one, sorry. This is the old texture. Go for this one. Minimum, click
here, maximum click here. All right. So everything is optional except for the
texture, obviously. Otherwise, why would
you use this function? And we're going to drag
this texture here. Now, there are some cases where you just don't really want
to change the roughness. And in this case,
we're going to go for a static switch parameter. And here, we're going to ask change modulate roughness
and just call it like that. If true, we're going to go here. If false, we're
going to go here. And the default
value will be false. So let's go here to
roughness. Click here. And now when we check here, you will see that you have some static switch parameters values. So if you click here, you will notice that you have new inputs that you can use. But if you don't want to change the roughness, that's also fine. Check this one, and you won't need to
change the roughness. So multiple ways of doing this. We can do that here. It may be a little bit messy
because there are a lot of nodes here, but, you know, it's a you can see if this is
worth of using a function, you can actually go here for static function static switch, and you can put this
values go for input, for input bull, can put it here. And in this case, if it's
true, you use this one. If it's false, you use this one. And let's see how it goes. Use pre view value
as default? No. And we're not going to use it. And we're going to
call it modulate roughness, just like that. Okay? So we're going to go here. Modulate roughness, apply,
you will see that it's here. So we can go here for a
bull, static bull parameter, and we can call it
modulate roughness, we can just put it here. And now we don't need this says cannot cast
static bull to bull. So apparently, this is just
static bull parameter. And then we will need to change
this one for input bull, static bull, just like that. It's a static ball.
And there you go. So now that we have this, we can hit Apply and
let's check our material. Model roughness, click, and now we have our new parameters
that we can change. We can make it less
rough or more rough. And if we don't want
to change this, we're just going to click
here and we are good to go. Several ways that
you can do this. We take a look at the
static switch parameters. We have take a look
at booleans, overall, I will say the last thing
I just want to change is this roughness texture
to be on the top. So roughness texture
will be zero, and the rest will be just one
here at the sort priority. Okay? So just like
that, it apply. And I can just put
this one here. Perfect. A little
bit more organized. All right. Now
that we have this, let's go ahead and work
on our normal map.
15. Changing the Normal map intensity: So for the normal map, we will want to increase and decrease the
intensity of this. So a more intense normal will actually have a harsher
light contrast, like, for example,
in these areas here. So if you take a look
at the blue channel, you can see pretty much it's almost like an
ambient occlusion. You will see that
these areas become like have more of
a treaty effect. So this is very useful
because sometimes you don't want your Normans to
pop out and sometimes you do. So the way we're going to
do that is by changing the rate and the green values are the only ones
that we care about. So we're going to learn
a new node today, it's called the append node. And the append node, and we're going to
go append vector, We're going to append two
vectors here, red and green. And I'm going to show you something that I think I
haven't shown you before. If you want to take a
look how it looks like, right click and start
previewing value. And what you will see is that my normal map looks
like red and green, exactly how it should be because I'm only
using these values. Now, what I want to do is
to increase the intensity. And at this point,
you should know that intensity is
synonym of multiply. So we're going to
hit, multiply here. And then we're going to
press one and click. Right click, convert
to parameter, and we're going to call it normal intensity,
just like that. Normal intensity or going
to leave it like that, and we're going to
put one for now. And I want to see
how it looks like. Right click, start
previewing value. And if I put something
like five, for example, you will see that it starts becoming really, really intense. And if I put a value of 0.1, it becomes less intense. So already changing
the intensity here, now we need to add this.
How we're going to do it? We're going to use it append
again, append vector. We're going to
combine the red and the green channel with
the blue one here. Right click, start previewing
note, and there you go. Now we're going to
go here and go to normal. There you go. And now, what I have here
is my normal intensity. I can change it to five and you can see what's
going on here. And it's even more obvious when there is a
light coming through. If I go for zero, you will see that I
have no normal map. One is a default one. I go for two or three. Sometimes you want
to just pop out those normals like this
and be careful with this. You don't want to break it, but just so that you can use it. So we're going to
create a function for this is going to be very simple. Just go ahead and
just save everything. And right click material,
advance material function. Sorry, not material
function instance. We go here for material, advance and material function, and we're going to call MF normal normal intensity,
just like that. So it's going to be very simple. We're just going to drag this and we're going to
copy this Control C, Control V. We're going to change the output normal
with new intensity. And append, it's going
to be a vector tree. So we're going to call it input function input vector
tree, exactly what we want. And also, because you want to
get access to those values, you can go here and break
out float three components. And what this will give
you is the ability to select channels individually
from this vector tree. So we're going to
do the same here, red and green goes here, and the blue one will go here. Normal intensity,
it's going to be an input for a scalar value. So we're going to call
it normal intensity. We're going to use a
preview value default, put everything one just in
case and put it like this. Delete this one and this one
will be my normal texture. Obviously, this is not optional, hit Apply and click here, and also we can expose
it to a library, exposed to library category
tutorial just like that. Go ahead. And just like this, let's take a look at our
function here. Normal intensity. So the texture I want
it to be on top. So I'm going to go here and
the intensity will be one. So zero, it's going to
be the normal texture, and one, it's going
to be the intensity. And now I can just delete this. I don't need this anymore. I can just grab this
intensity here. You can also put a
switch here to decide, do you want to change the
normal map or whatsoever. I find in practice, you don't want to put a lot
of switch unless you need to. So in this case, obviously, if you don't want to
change the normal map, just leave it at one. If not, just leave it at zero. If not, you just change
the value, right? So we're going to actually slider Min is going to be zero and slider
max, I don't know, maybe it's just like ten so
that we don't go below zero. And with that, we're
going to put a normal map here, and just like that. Now we have our function
for our normal intensity, which is very, very
cool. Just like that. No normal map. It's going
to look really flat. And with normal map, leave it at one by default, and it's just going to
look really nicely. I can bump this a little bit if I want it. And look at that. Now we have a lot of
functions in our material. We have the tiling. We
can change the color, change the reflection,
change the normal math. Those are the most
important aspects of any texture manipulation. If you only have this,
you can go a long way. So with that, we're going to use it to improve it even further.
16. Blending Between 2 Materials: So now that we have
our first material, we want to blend it
with other materials. And I'm going to show
you how you would do it and what happens
under the hood, and then we're going to
do it the right way. So you don't necessarily need
to copy this by any means. But what I want you to see is when you have other
textures like this, you can use any texture import from fab, just like
we did before. Let's try to, you know, to blend these together. So we have this texture here, and what you will do is
basically use a larp node. So hold lt and click. And the Alpha, I'm going to
create a constant value, pressing one and click
and convert parameter called Alvedo arp or
just I don't know, material blend in general. So it's going to be here. And the top material
will be on B. Kind of see it like a
photoshop layer where you have the bottom layer and
the top layer, right? And the top layer,
it's going to be B. There you go. B and A. And how much opacity this has depends on the material
blend that you see here. So obviously, this one, it's going to be here and we're going to put it
to the base color. Alright, so by default, nothing should happen because material blend is set to zero, meaning B has no value at all. So we go here. Let's go to actually, let's go to our material.
Material incense. And you will see here that
if I scroll this to one, I'm actually changing
the texture. I'm just changing between
these two textures. Now, you can see what is
the problem here is one, I need to do this all over again if I want to have the
same control for this one, and I need to do
it here as well, so I can use Control
C, Control B. And I can just click
here to Bose and grab a mask and I can
actually, you know, just put the put the roughness here for
the roughness value, and the new roughness
value will be this one. And we can do the same
here for the normal map. We can just grab
the normal here. Put it here in B and
the same value here, and then the new intensity
here and the normal. And then we will go
for the roughness. Same for the amin occlusion, but we're not going to use it. So for now, we'll just
leave it like that. Look at what will happen now is when I change
the material blend, I can just tagle between
these two materials. So obviously, you
can do it this way, and that's actually
the only way to do it. But we're going to
use more functions for this because as you can see, if we want to add one or
two different materials, it's just going to be
really, really annoying. So I'm going to delete this. Again, you don't need
to do this by yourself. It's just to illustrate
what's going on. So I'm going to actually control see everything here that we see. Minus just connect this delete the larps
roughness leaf here, and normal leaf here. We don't need this. Okay, so this is our previous material. What we're going
to use actually, it's another node called
material layer blend. And you will see that you
have a lot of variations. You have the simple and
you have the standard. You're going to go for
the standard here. Now, the problem with
this is that well, how do you connect this
because you cannot connect this one here because
this asks for a material. Essentially what we are
having here is a material. We need the same input here. So what we're going
to do is to go here and go to make
material attributes. Make material attributes
will create a material. So if we go here
to the base color, starts this start connecting
all the stuff here, and the ambo clusion goes here. And then the normal
map goes here. And now, what I can do is just to connect
these ones here. Like, actually, you don't
need to connect all of this. You can just click here and
then use material attributes. Click here folds. And what will happen
here is Okay, use the outputs, the outputs of the material attributes
that you are getting. So if you are not using metallic or specular, you
don't need to connect those. Use this as it is,
and that's it. So if we apply this
and then we go here, you will see that
nothing has happened. So now what you can do is to actually go here and put
it as the base material. And the top material, we're going to control
C and Control B. We're going to replace
this later, but for now, so you can see you
can put this thing here and we're going
to change these here. Like all these textures, we're going to replace
them with new ones. And the Alpha, obviously, for now, it's just
going to be a number. Okay? So it's going
to be a number, let's convert it to
layer one blend. Go for here, and then
go for this one. Click Apply and you will see
that nothing will happen. But now, if I go to
my layer one blend, I can just blend
between these two. Obviously, this will
be a value 0-1. You don't want to overexpose everything. Same with this one. So zero will be our
layer zero or layer one, and one will be our layer two. And this is how you can blend between these two materials. You can see like everything
can change on real time here. And obviously, we're used
using a scalar value, which is a very simple way of blending these two materials, and we're also sharing
the same inputs here. Maybe we want different inputs
for different textures, and maybe we want to change
those into parameters. So the next thing we're
going to do before we span more into you know, our material, we need to
create something that makes our life easier with
these materials individually. So let's do that now.
17. Creating a function for our Simple Material: Alright, guys, I come
from the future, and there is a video
that got corrupted, and the video that
was missing was the creation of this material function
called standard material. Okay, so don't ignore
anything that you see here. This will come in the future. What I want you to
guide you through is the creation of this
material function. So the way I did this, I'm going to create it here. You can already see that I have my material function here. I'm going to guide
you through this. So my material function
basically has, let's go here to my
material advance and material function and
call it MF material 02, just to call it that way. So what you need to
do here is basically add the same properties
that we had here, but we need to add them
here on our material. So it is very easy. So obviously, the first one is the Alvido controls and the
make material attributes. So first things first,
make material attributes. Okay? And you go to copy
here to the output. You can rename this
output however you want. And these Alvedo controls ask
you for an Alvedo texture, brightness Alvedo tint
and desaturation. So Alvedo texture, obviously, it's going to be
my texture here. But I'm going to grab a
texture sample from this. So let's just create
a texture sample. Just anyone is fine because we're going to
change it in the future. So we're going to put it
here in the Avedo texture. Okay? This is not an input yet. So brightness, Alveda
tint and desaturation, we're going to create right
click and function input, and we're going
to go for scalar, and we're going to
call it brightness. And we're going to do
the same for all of those for this aeration. And copy and paste. And the last one, it's going
to be for Alvido tint. Alvido tints going to
be a vector three, and I'm going to
leave it at one. I'm going to leave the use previo value as
default. Same here. Brightens zero because I
don't want to add anything. And this alteration
has a value of zero. I'm just going to go here
and connect my Al VDO here. Okay? So you will see that actually I'm missing
a texture here. So what you can do is to put
any texture that you have. So for example, this one, it really doesn't
matter because it won't really use this texture
for the function. So you can just put any texture. As long as the sampler
type is the right one, like color, normal or
mask, you're good to go. So the second thing is
the roughness control. So the roughness control. If we go here for roughness, material function
roughness control, you will see that you have
your roughness texture, roughness max, modulate
roughness and roughness mean. So it's very simple. We're just going to
add another mask. So, for example, this and my roughness texture
is going to be this. Okay? And my roughness
max and roughness min, I can also put them as a
parameter. I can just copy here. So roughness Min is
just going to go here and roughness max
is going to go here. So modulate roughness is
going to be a static bull. So you have static bulls here, static bull. There you go. And you can just put it here, but you also have a function
called function input, and you can go for static bull. The preview is going
to be this one, and use preview as default, you can turn it on or
off and put it here. And the roughness texture, obviously, it's going to be not it's a scalar
parameter, right? So it's going to
be the green one. So we're going to connect
the green one here. Okay. And this one is
going to go for roughness. Let's go ahead and continue
with the normal map. So the normal, we're going
to use a normal intensity. So let's add this function
here and the normal texture. You can just grab
any texture here, put it here and
normal intensity, we're going to create
a function input. Sclor and call it
normal intensity. Put a preview value of one
for now. And put it here. The next one, we're going
to just go for this one. Okay. So now that
you have this, now, we have other options here for the texture object scale
and a lot of stuff. We're going to leave it simple
with texture coordinate. So how you're going to change the coordinate is going to be
very, very simple. Let me just connect this right on here for the amen occlusion. And what you need to do is to actually go for
function input. And go for a texture
two D. Okay? So if you see here, I'm actually
having a texture two D, and it's receiving
a texture object. So I'm going to go here and
go for a texture object. And actually, I'm going to click here and
then go, actually, let me click here
texture object. So I can have this one.
I can just put it here, and this one is going to
be my Alvedo texture. And you can just put
it here on textures. So now that you have this, you can actually
change the U Vs here. So if you go for
texture coordinate and for multiply and press one for increasing the tilling, actually,
we don't need one. We're going to actually go for function input because this
is also going to be an input, and this is going to be my
tiling scale, we can call it. I don't know which name
I use for this one. I use UV tiling. Okay so let's use the same name. UV tiling. All right. So we're going to leave
it as one for now, we're going to just put it here. Okay. And then we're
going to connect it here. We're going to do the same copy. This is going to be
my mask texture. Put it here. And the UVs
are going to be this one. And then I'm going to copy this. I'm going to go for my normal
texture and put it here. And my UVs are going
to be this one. So now that you have this, you do have your material
function that you can use to let's just call
it like material. And I'm going to call
it my MF material. So if I go here, you
will see that let's go for our intro to materials,
MF material here. You will see that I
have the same values. There's a function that I haven't changed
the name is this. So it's like modulate roughness. Okay. So if you
notice the order of the things are
really not you know, they're really not changing. So let's go ahead
and drag it again. You can see here
that the textures are first and the
rest ones are here. So, this has to do with
the preview value. So the order that you see here on the inputs,
sort priority. So I'm going to leave
all the textures to zero, just like that. And the rest one, I'm the rest, I'm just going to go
for all the inputs, I'm going to put a value of one. So I can have a
value of one here. And when I apply, you will see
that my textures are here. So obviously, if
you want to put, like, for example,
there saturation, you want to put it
first, you will need to change the value of this
put something into two. So it's like for one, zero, one, and the
rest, you can put two. It's really not
something that it is going to affect the
result of your material, but that's how you create
your material function. So instead of using all these nodes and
copying them again, you can actually use the material function
to add other materials. So for example, I can just
connect this texture here. So I can just go
for this texture. I can just put it here, put the mask, put the normal, and I can start changing those inputs to see
what I can make. So that's it for the
material function. Sorry for the inconvenience. And if you have any problem, just let me know
in the comments. I will assist you. Again, thanks for the heads up for
letting me know about this, since this material is
quite important, right? So we're going to leave it
like that and continue.
18. Blending with Vertex Colors: All right, so let's continue
with our master material. We're going to leave this here. First thing I'm
going to do is to update this roughness texture. So if you want to open
up a material function, you just need to
double click on this. And here you have
the roughness max, roughness is this static bull. So we're going to use
the date roughness. A little bit of a mistake from
the latations only a typo. It should work as expected. So what are we going to do? We're going to transition this, and we're not going to
use the scalar value. Instead, I'm going to
show you a new node. And it's going to
be vertex color. So vertex color, I'm going
to show you what I mean. I'm going to go here to the
molding section where we can add a mesh. I'm
going to add a box. By the way, if you want to learn how to model inside and reel, I have a tutorial also
here that you can watch. So make sure to
check it out if you want to learn how to
model inside and real. So I'm going to have 20 subdivisions for this box so I can have some
vertex to work with. And now, what I'm going to do
is to put my material here. So let's put our material. And let's just see
what happens first. So if you go here to the mesh paint mode
in the selection, you will see that
you can actually paint here in those models. I'm going to put the
default values here. What vertex color
information is basically each vertex has information
about the color, right? You can use this color information
to do multiple things. So what's happening here? If I go here to the
color view mode, I go to RGV channels. You will see that
is entirely white. And what I can do is to actually
go here and paint black. So I can just paint here, black, all the channels. I can also paint black
on two channels, which will leave me blue
or only one channel or, you know, all the channels, I can just paint like this. You know, you have a bunch
of things that you can do. You can also fill
this with black. So if I fill this
with black here, all the channels, then
I can start painting, for example, I only
want to paint red, click here on the red,
and then you will see that we have red here. We go for green, and then we have green here and
so on and so on. So I'm going to leave it here as just leave it as
default for now, right? So that's their text color. And what this does is we can use this information
here on the material. So instead of using this, I'm actually going
to use this one. So I can either choose
the white one for RGB, the red one for red, green,
and blue, and Alpha. So I would go for
the red one Alpha. And I also want to
put like a tint here. So let's put
something like let's put for create our
parameter vector T, and let's put layer
to Alvido color. And just for the sake
of demonstration, I'm just going to put
something like very red, and I'm just going to put it
here so that this material, it's just very, very red. Alright, so let's go
here, click Apply. And let's see what happens. So let's go back to this mode. And what you will see here
is that our material is red. Now, the reason for that is that Everything is white here. So there is another node
I want to show you. And the reason I'm showing you this node is because by default, all the meshes will have
the color data for white. Basically, everything
will be one, so it will look like white. So it looks a
little bit strange, but we want to paint with black. So let's go for one minus. And what it does is basically
does the inverse operation. So if this is white, then
the output will be black. And now what you will see is that we will have
our mesh like before. If you want to see the mesh, make sure to check off this. And by the way, if you
have nanite enabled, please disable it because this is not going to
work with nanite. I'm going to show you a method later where you can use nanite. But for now, just keep it
like this, keep it simple. So now I can just paint red. So I can just paint red here. I can paint black and
see what happens here. I'm starting to paint, and I'm having a
new a new material. I can do the same here or just going to work
in this area for now. Now notice that the transition
is a little bit funny. But the cool thing about
this is that we're actually blending between
these two materials, and I can actually open up the material instance and change this color back to white. And look at that. Now we
have something like this. I'm going to leave
it on red just so that you can see
what's going on. And in the next lesson, we're going to work on the transition material
that we want to use.
19. Introduction to height Contrast: So to make this a little
bit more realistic, we're going to have to
use our height material. And our height material, if you don't remember, we have this mask, and we have the blue
channel that has the height information
where the you know, the black values will
be the valleys and the white values
will be the peaks, kind of like a treaty view, like if you watch
it from the top, you can see this
height information. That's why it's
called like that. So if you notice, we don't have any
way to access this. We can go here and, you know, break, you know, just wrap
the information for here. But I want to actually
update this function. So double click on this. And actually, I'm going to
show you what you can do. You can actually
create another output. Function output. There you go. And here we want to use the
blue one, just like that. Now we're going to
call it height, and the sort priority
will be one. Heat apply, save it. And now, We're back
to the material, and you will see that I have
my height information here. So what can I do with this? So let me show you
what you can do. First, I'm going to introduce
you to another node. It is called the Power node. And the Power node is also
synonym for contrast. So let me just go here. Right click Start
previewing note. And what you will see is
that I see the height map. I can create basically
a constant here. I'm going to click one and
click create a constant, right click and call
it height contrast. Just call it like player
one height contrast. Just leave it at one. At
one, nothing will happen. Let me just put this as a box
so that you can see here. More clearly height looks like. I can put something like five, and you will see that the
contrast gets higher. Like we don't have
any middle values. It's either black or
white, which is amazing. This definitely what we want. The next thing we want to do is to actually change
the intensity. So with that, we're going to use the multiply node
that you already know. Hit and click for multiply, drag here and click one and click to get
the constant right click and call it L
one, height intensity. You are going to leave
it at one by default, and you're going to
see what's going on here, right click Preview. And if I put ten, everything starts becoming,
you know, more intense. And if I decrease it, it's going to be less intense. So great. Now that we have this, things are starting to get
a little bit messy here. So what I'm going to do is to
actually do a reroute note. So a re route node, it's basically a node
that you can use to organize a little
bit better your node. So let me go here and go for name and go at name
reroute declaration node. This will be my L one
height with contrast. There you go. We can even go and put like reroute notes
for each material. If you don't want
this, for example, reroute at a reroute
Declaration note, call it one material. And how you can use this,
what's the difference? Is that you can go here
and type one material. And you will see that I get
the same information here. So I can do the same
here, one material. And for this one, I can do the same as well. I can just go here and type name reroot Declaration
Node two material, and then just go
here and type L two. This is not necessarily
that you have to use this. It's just for
organization purposes. So what do you want to do? Let me delete this. We
don't need this anymore. We actually want to use
the height contrast. So go for height contrast, L one with height contrast, and we're going to
multiply it hit M, and we're going to multiply
by our vertex color. Now, I'm going to
show you what it does before the vertex
painting, okay? So just so that you can
see what's going on. We connect the
contrast node here, and if we go here for our rock, we can actually change the height contrast and
the height intensity. So we can just put
one or five or ten, and we can also put
it more intense like ten or 510 looks like
a really nice number. You can see like we're actually putting those on
the height values, right? If we even make it more evident, we will look like this, right? So very, very nice. We can increase the
contrast, as well. That's you know, you can
just play with these values. I'm just going to leave
it like this for now. Just put like maybe ten is a seven is a decent
number to work with. And what I want to do
is to clamp this value. I believe we use
it somewhere here. If we haven't, I'm going to show you this note. It's
called a clamp. And I believe we use it. So this is where
it becomes really useful because when
you use this kind of operations where you
multiply by seven by 15 or any kind of crazy
number, things can break. And the clam makes sure
that all the values are zero at the minimum
and maximum one, which is what you want for this. So if you put the clamp here
and connect it to the Alpha, you can start seeing that
the values will you know, you can see that they are
not breaking anymore. Like, they are not super
strem like we see before. In order to you can either use a high values
to blend like this, and it will work great
if that's what you want. But for our case,
because this course, we want to show you very
different ways of blending. And one of the famous
ways of blending different materials is
by using vertex color. So what we're going to do
is to actually multiply, once again, never mind, use this multiply
and connect it here. Right, go to the clamp
and look at that. Now we have our
first material here. I don't believe we
need this anymore. We're going to delete this one now just for the sake
of organization. We have our first material, or second material, and
this is the first blend. So we're going to go here. And I'm going to show you
how to comment notes. So select everything. Click C and type
layer one blending. This is, for example, our click C layer
to material here, we need to stop
previewing this mode. We don't really need it anymore. There you go. L one material. And look at that. It's
such a big network condensed into very small steps that we can use because
we are using functions, and here you have
even more controls. So everything is starting
to look really nice. Now, let's take a look at
what's the difference between painting with the height map
and without the height map. So with a height contrast, it will look
something like this. Let's fill everything
with white for now. Let's just paint here. Sorry, let's get out
of here, go to paint. And here, actually, you're going to use the vertex color
and multiply with this one. So you can just if you paint like zero,
nothing will happen. If you paint with one, let me take a look at
this vertex color. The black multiplies
by this one. So if we go for just take
a look at the colors. So put it like that, and now we can start painting. So, oh, we need to apply. That's why it doesn't show up. I was getting a
little bit scared. So we need to apply
first. So let's go out, mesh paint, go to paint. And now we're going
to paint black in the red channel and look
at what happens here. Actually multiplying
here this value, and we're getting a very different result
compared to before. And if you don't like
this result, obviously, you can play with the
material instance where you can change
the contrast. You can change the
height intensity, just like that, it's up to you. It will be entirely up to you. But with this, you can shift click to paint
the other way around, paint white, and you will remove areas where
you don't want it. So you have a lot of
control with this, and it does look really nice. Let's change the height,
something like that. And if you don't like it
that much, obviously, you can start painting
once again with shift to have a little bit
more control over everything. And the beauty of this is that you can just
paint your whole mesh, and you will have a
different result. And if you think
this looks weird, let's go back to the
other valley and try to put something like
a different color, you know, something that blends more nicely with
this and look at that. Now we have our rock material that is actually
blending between, you know, two
different materials. One, the cliff and
the other one, the other type of
rock, which is very, very nice, very, very nice. I think it and let's go
ahead and put more stuff.
20. Using the HeightLerp node: Now you will notice
with our method, there are some areas where
we cannot really paint. So if I go here and let me just put this
one on right again. So that's super easy to see. All right. So there
are some areas where I cannot paint no
matter how hard I try. The reason is obviously
it's behind this logic, and I want to introduce you to another node that is
actually very handful, and that is the height larp. So the hight lerb if you
double click on this, it will have a bunch
of functions here. Basically, we'll do
that transition phase where it's your Vertex painting, and pretty much similar
to what we have, and we subtract the high
texture and that's it. Instead of doing this ourselves, we can use this function, and height lerb basically
ask for a high texture. I don't really like to
use the contrast here. That's why what
we're going to do is to actually use the
contrast just right here, and the transition
phase will be this one. And now that we have this,
let me see if there is a clamp here in this function. Looks like there is no clamp. We're still going to
use the clamp for this. We're going to connect
the Alpha here. Sorry, not the contrast here. It's going to be the high
texture. Is this one. Okay. So now that we have this, let's take a look at what
happens when we paint or mesh. Now we can pretty much
paint everywhere, holding shift to paint the
white areas just like this. And we can also change
the parameters here. So let's play a little
bit with the intensity, just like that,
and the contrast. Okay. So you can paint white. So you can paint black. And you can also
increase the strength and the size of
this if you want, so you can just paint
like this, for example. And increase intensity. The intensity can be a little
bit of a trouble here. We can increase the contrast, but the intensity, we're just
going to leave it as it is. So there you go. So
now it's much better. Now we have areas where we don't really want it. That's great. Height contrast, we can leave it at lift innsity to one and
height contrast to one. Okay? So now we can
change the contrast here just like that and
the intensity value. There you go. And it's much
better, in my opinion. Let's increase the contrast,
decrease the contrast. Sorry. There you go. Intensity, once
again, beautiful. There are some areas
where I really paint, but it really doesn't matter. So with that, we have just used another note
here. Very, very important. It's a height larp.
It's very useful. You can also try the
contrast if you want. Just put a high texture
without a contrast. But I do find it's
much better without.
21. Using World Aligned Textures: Alright, so let's continue to add more details
to our material. What we're going to do is to actually use a new concept
that you haven't seen before. It's called world masking. And I'm going to
show you what it is. So basically, what we
need to do is to add some color variation to our
rock material so that we don't only have the colors
from our materials, textures, but also, you know, some tint on top of it. So what we're going to do, we're we're just going
to do it right here. I'm going to show
you a new node, it's called world
Align line texture. And for this, I'm going to
use the height map of this. So you could potentially use, you know, another texture. I recommend you to use a
temp because it just gives such natural results for this and nobody's going to
notice it's the same texture. So what I'm going
to do is to create a name rewrote declaration node so that we can change
it in the future. So we don't have that
line going here. So name rewrote declaration node and let's call it
layer two mask. We're just going to
put it right here. We can even connect this one if we want to make it a
little bit more organized. And our texture two D, it's going to be layer two. It's called layer two mask. So it's going to be
here. All right. And what I want to do is to actually change
the texture size. So for this one, I'm going to press one to create a constant, and then I'm going
to right click and I'm going to call it a color variation, world tiling. And we're going
to put a value of 100 just to test things out, and we're going to
just put it here. Now, what we're going to do
is we have this texture here. How are we going to use it? Well, first, let's take a
look at what this is doing. The first thing I
want to do is to make sure I grab the
blue channel from this. So what I will do is to create a component mask and what
do component mask does. Type component mask. What it does is basically
takes any texture that you have and basically mask only
the channels that you want. In our case, we want
the blue channel, so we're going to
leave it like this. Notice that there are several
ways of doing things. You're going to also go for break float tree components like this and break
the blue one. There's not a single node that
can do everything for you. You have multiple
alternatives for this. So we're going to go here and
instead of connecting this, we're going to
actually break this. So we're going to go for
break material attributes. And instead of using the use material attributes,
we're going to check this. And we're going to connect
the roughness here, the normal, the
ambien occlusion, and that's pretty much it. Connect the specular
if you want. But for the base color, I'm going to go here and put this one just so that you
can see what's going on. So if we take a look
at our material here, notice that we have
one texture here. But what happens
is, when I move it, let me go to the unlad mode, you will notice
that the texture is actually worth a line blend. So what would be the
difference without it? Well, let me just connect
this one like this. Let me just scrap
this just like that. Convert to texture sample, and we're going to
just put it here. And I'm going to show you how it looks like without
the word align blend. So we have this material. And notice that the texture is like stuck on
the treaty model, right? It doesn't move at all. However, when we go to
the other texture here, we're going to have
a texture that actually it's in
the world space, and it's actually working
in all directions. So if I duplicate this, the beauty of this is
I can duplicate this and notice that it
automatically tiles. I can just move it here, and I don't need to worry
about anything here, which is fantastic for us. So with that set, we're going to
leave it like this, and then in the next session, we're going to add it as a
color to our final material.
22. Adding Global color tint: Alright, so now that
we have our mask, we need to tell the
material that use this mask for changing the
color because right now, what we're doing is
just working with this. So this is our Alpha. And like most Alphas we
have worked with before, we want to use the classic power here for the contrast node, connect this one, and then we're going to
go for multiply, I'm going to connect this one, and we will create the
constants here that we need. Press hold one and click
to create a constant, right click convert
to parameter, and this is going to be
my world color variation. Contrast, and we can put
it on one for now and C, Control B, and we're going
to go for intensity. Just like that. Like always, we're going to clamp
these values to make sure they are
either zero or one. Otherwise, we will
break the color. No, it's either zero or one, but any value above one,
it's going to be one. A value below zero,
it's going to be zero. So I'm going to open
up the instance so you can say what's going on. I'm going to go for color
variation, intensity, so I can increase intensity, make it brighter, and also increase the
contrast like this. Now, it may look like it
doesn't look completely black, but if we go here to the
buffer visualization, go to base color,
you will notice that it's indeed actually black, so you don't need to
worry about that. So we can increase the contrast or color variation intensity. And also, if you want to change the word tiling,
we can do this. The lower the value, the more tiling you will
have the bigger. Obviously, it becomes,
you know, big enough. So 100 looks like it's fun for now, it's going
to look like this. That's great. So
now what we need to do because we break the
material attributes here, we need to grab this base color. So we're going to leerve this.
Going to hold L and click, and we're going to
larp this color. And the Alpha, it's
going to be this one. So we're going to go
here. The base color, it's going to be actually, let's create a name
rewrote declaration note. Name, it's going to be my
world tint alpha mask. And we're going to go for world tint alpha
mask just like this. Use this nice and organized. And we can go here
and put a base color, hold V to create a parameter, and we will call it
world tint mask. We're going to put a value of I'm going to put
it green for now. Say it's very evident. I know the material looks so ugly now, but yeah, just be
patient for a second. Everything is going
to work just fine. And then we're going to
connect the base color here to the A input. And just like that, we're going to go here to the base color. And there you go.
So what will happen now is that you see that we
have our growing material. Now, if you want to have
a more decent setup, we can just go for something
like this, you know, for different variation of the layer two material and
also the tint of this, we can go for something a little bit light,
just like that. And obviously, we can increase the contrast
and the intensity, so we can go for
something like this. Intensity just like that. And now we can just
go back to our color here. Just like that. Now, I want to be able to, you know, basically control
the Alpha value of this. So I think I can just
do multiply here, multiply node, and put
another input here, holding one and call
it like tint opacity. And we're going to
have a slighter max of one slider mean of zero. And we're going to put the
default value on one here. So we're going to
go here, and then we're going to go to the Alpha. So just like that, we're going to multiply everything by zero, so we can go for tin opacity. And just like that, we can
have very subtle color here and you can already see
how good this looks. Can even go for something a little bit bluish if you want, have a little bit
of color variation. And if you don't like
it, can always go for something like this and control
the opacity of the tint. Sorry, that was the
other material. To something like that. If you want and
control the opacity, zero, you won't have anything. One, you will have a lot. So layer two, leave it
at something like this, something like reddish,
and this one is going to be kind of, like,
blue, something. And then we're going to
go for a thin opacity. There you go. You can go for
something like this, and you can always
change the word tiling. Now, if this is too
much, obviously, you can change the tin capacity, and you can have a slight
world variation for yourself. Now, this is working
really good, but I'm already having
a lot of parameters, so I want to make sure
everything it's grouped. So what I'm going to do is to
go for all this and go for a group here and call
it color variation. Click Apply. And now
you will see that color variation has its
own parameter group, and the next one it's
going to be the layers. So this one, it's
going to be layer one. And, we can just
keep it like that. Maybe we can have the
vertex color contrast. So we're going to call it
vertex color contrast. There you go. Hit apply. And now you have
the Alvedo color as well that you have
somewhere here in this map. If I can find it, S
Layer two V color. Always here. Well, never mind. I'm going to look it up later. But for now, now we have our color variation that
is working just great. Now you can see that our
material is actually working. Now what we will do is to work a little bit on the slope mask.
23. Adding the moss Material: Alright, so before
doing the slope mask, we need to make sure
that we have an asset. And I find that in QuickSell, if you go here for
you can just go from QuickSell here and search
for moss material. We can look for some
moss materials here, like see materials and textures. And you can choose
anything you want. I already choose one
here and download it. So let's import it into unreal. So by the way, the
color is here. So we're going to put it in its own group layer
two, just like that. There you go. For
any kind of layer two changes, is
going to be here. So the next thing we want to do is to import this texture. So we're going to go
for IoT materials, and we're going to double click here and we're going to create a new folder called moss 01, and we're going to import
this, we're going to go here. And we can go here to the ones, we download it,
import everything. And obviously, we need to use our utility that we used before. So what we're going to do is to just go here to our
mask generator. And here we're just
going to change the color and everything. So we're going to go for moss
and the ambien occlusion. Actually, this one didn't
come with amen occlusion. Let's use a cavity for now. It's not exactly the same, but it really doesn't
matter at this point. Roughness and displacement
we're going to use. This one, of course,
there you go. So we're going to save it. And now we're going
to output this. So export or you're going to see that we have our output here in the intro to
materials, textures. You have our output,
going to move it here and we're going
to call it sorry, Ms T, mos 01 mask, and this is going to be
the color, which is okay. The normal map we just
need to change here for make sure it's normal
map and you are good to go. The last thing you need
to make sure is this mask here is actually set to mask. So we get the accurate
values. All right. So we're going to go
here to our instance. And now that we have this, we're going to create
another layer. So it's going to be very easy. By the way, before we do that, let's go to our function
and make sure all these textures samplers
go for shared wrap. And the reason for that is
we're going to use a lot of textures and if you notice here, there must be some
platform stats. Not this one. Probably here, the rock master material, you will see that you
have your samplers used, and you need a limit. You have a limit of how
many textures you can use. The wrap mode basically allows you to have multiple
textures in one material. So by doing that and saving
it, we are good to go. We're going to copy
this and paste it. And we can even change
this like go for white and call it layer
tree Alvido color. And this is our
layer tree material. There you go. And now
what we need to do is just to change
these textures. So we're going to go here to the texture object and go here to the color
and click Okay, and go for this
one and this one, we don't need this anymore. So we're going to go here to the mask and put it right here. And for the normal map,
we're going to do the same. Apply and by the way, I think I'm previewing
some values here. Oh, I'm just
previewing this one. So now that we have this, so this is our taint
with Alpha mask. We can actually make
material attributes once again and connect these ones
here, where they belong. So we have our material back and we can go back
to working with those. And what I want to do is to actually make a material layer
blend like we did before. And we're going to
go for standard. So the base material, it's
going to be this one. And the top material is
going to be this one. So we're going to call
it Tree material. And we are going
to connect it to the top material here,
LT material. Beautiful. Connected putting it here. Sorry, you can go for
use material attributes, connected just like that. And now, obviously, nothing will happen
because we need an Alpha. We're going to work on that now.
24. Creating the Slope Mask: Alright, so let's
add our slope mask. But first, let's
comment all this. So grab everything, and I
can just put it on top. I like to make it a
little bit sequential, so I can read this as,
like, from left to right. So I'm just going to
leave it here and call it like world tint Alpha mask. And this is going to be my world tint LRP, probably. Makes sense. There you go. So now the Alpha, obviously, we need a transition. So we're going to use
a node that is really, really useful and it's called the slope node, the slope mask. So I'm just going to put it here so you can see
what's going on. Start previewing note. You will see here that I'm actually having a
transition here. So I'm having the white on top and the black on the bottom. So let me just show you how
it looks on this one here. So I have this material, and you will see that I
have the moss on top. Now, also here, I
have the moss on top, but notice that
if I rotate this, the moss actually
always stays on top because it's taking a
look at the norms from here, maybe we can take a look at with another I don't know,
maybe maybe this. Maybe a Taurus can
be a good example. So let's apply our material
here. There you go. So notice that every
time I rotate this, the most always stays
on top, no matter what, it's on top here
and on top there, but it's never on the sides. Now, we can change this. We can change the angle. So let's actually move this a little bit to have a
little bit of workspace. And the slope angle, we're going to click V to create a vector parameter and
call it slope angle. And by default, it's
going to be on one. So we're just going
to put it here. And it apply and looks
like nothing has changed because we're actually
having the same value. But if we go for our material, and change the slope. And instead of being blue, we're going to go here to zero. 000 actually means no slope. So if we go for one, you will see that it's
on the X axis. So it's actually coming
from this direction, and it's pretty much
like this, right? And if we go for the Y, we go for green, it's
going to be like that. Obviously, you can't
control the intensity here. The lower the value,
the less influence the slope mask will have. So if you're wondering
why will I change this? Like, at the top,
it looks like the most makes a muss
of sense for me. Well, the reason is
sometimes, like, for example, you have a snowy area
or maybe a forest, you want to put some moss
on the bottom of the trees, maybe you can use this one to automatically put moss
on all the tree bottom. That's a very good
way, actually. Now, this sk lasks something, and it needs a tangent normal. Basically, what it will
do is to give you, you know, a little
bit of detail. So what I'm going to
do is to actually go here and use a Ni name
root declaration no. I'm going to call it three
layer three normal texture or drag it here. And this normal, we're going
to use a texture sample. And we're going to
use a rap, of course, and we're going to drag here or layer tree
normal texture. Now, if you wonder why
I don't click on here, it's because our object texture is not compatible with
the tangent normal. This needs to be a vector
tree. We're going to go here. And now that we have
our texture here, we're going to go to
the tangent normal and take a look at
what's going on here. We do have the most
normal working here. Now, you can try with other
normal maps if you want. For me, it doesn't make
much of a difference. Right. But now,
what we have here, it's basically a little bit of a better transition
between those two. Now, what else we can do? We can actually increase the fall of power
and the chip contra. So let's do that now. Click one to create a
constant and call it fall of power and let's just call
it slope fall of power. We're going to put
it here and we're just going to leave
it on one by default. And Control C, Control B. We're going to call
it slope contrast, not like this. Slope contrast. And we're going to put it
here to the cheap contrast. And we're also going
to select everything here and we're going to group it in the slope just like that. All right. So we can go here. And also, you could potentially convert this to a parameter if you
want to change, like, you know, the
tangent normal. I leave it up to
you if you want. For me, in my experience
working with this, you don't necessarily
need to put parameters for everything. The less is actually better to work with because you're
actually going to work with a material that it's only have the
most important stuff. If you work with other
materials, you may know that, um so click on this and let's try to play a little
bit with the slope. So we have the slope angle, which we already try.
Let's try the contrast. If we increase the contrast, you will see that it
becomes way contrasty. And if we go negative
one, it's actually going to do the inverse,
which is really good. We want to have that power. So fall of power, obviously, the lower you will have the more influence it can
have. Which is really nice. So, beautiful. Now we have, like, a really
nice texturing and it's actually working really,
really well for us. So now that we have this, I think we are in a good spot
to import a treaty model, so we can try our
master material to see if there is anything
we need to change. But for now, we're going to go here and call it slope mask. And then here moss
on top, blending. Look at that. We
don't need this. I don't know what's doing there. Look at our master material. It's slowly getting
really, really nice. So we're going to
work on that next.
25. Vertex Painting on Nanite meshes: Alright, so to
test our material, it will be better if we
actually import a model. So the way you do that is you will just look for any
kind of model here. It can be a simple
rock or whatever. I'm just going to
use this one. Go to download and go to the Raw file. This is the highest
resolution file you can get and also comes with
some textures and whatever. We're going to use
the FVX for now. But just hit download and
we're going to import it. So I'm here in real, and I already have it here. So what you're going to
do is to go to Import and you're going to
import the Treaty file. And sometimes it's the FBX, sometimes it's the OBJ. In this case, is dot FBX. So just note that you
can just import this. Just hit the default bottoms
and you're good to go. So I'm not going to do it now because it's
going to take some time. But first, make sure to
remove the nanite here. Okay, because we're going to
use some vertex painting. So we're going to drag this. Okay, we're going to just
put something like this. And what we're going to do is to actually put our material here. And look at that. It's
actually working really nice. Now, let's work with our
parameters a little bit so we can check what
do we need to change? So first off, I'm going
to show you how to paint. So go to mesh paint here, click on the mesh,
then go to mesh paint, then go to the paint tab, just like we did before. And now we can just paint in
red here, the red channel. Notice that everything
is white here. So we're going to
paint in black. So holding the Shift click, I'm going to paint red, the opposite color,
which is black. I'm just going to
paint like this. There you go. Notice
that I'm already adding a lot of detail to my mesh
just by doing that, right? So keep painting. Just so that you have some
color variation here. You don't want to have
the same texture there, like, just like that. And we can paint the
other side as well, and paint a little bit
here on the ground. You know, you can be
very creative with it. And we can also paint like here. Let's go for Shift click. There you go, have some paint. And it looks like it's
good enough for me. I'm going to just
paint a little bit here. And there you go. So now, how do you apply this? Because what I need to do is to apply this vertex color information
to all the meshes. And there is a bottom for that applies vertex instance
colors to source meshes, go to here, click Ort. And what you will have now, you're going to add a
vertex color information to your meshes so that
every time you drag it, you don't need to
paint it again. Now, this is a limitation
that comes from Nant. If you're not using Nante, you can have instance with different types of
vertex painting colors. But for now, what you can
do is to just go here. Double click on this one.
I already have it here. So two things we're going to do. We're going to go for rock one. What you will see here is as
soon as I apply my material, you will notice that my rock is already having the
vertex color information. I'm not really sure if you
can check the vertex color. There you go. That's the
vertex color that we paint. So that's great. The next thing, I'm going to enable
Nante a lot of people think that they cannot use
vertex painting with nanite. You can actually do it, so don't worry, hit Apply. And that's why I didn't import the mesh because it will
load this by default, and sometimes it will just take, you know, some time to load. So there are other ways to do the vertex painting
for nanite meshes. We're going to keep
it simple for now. But also be aware that you don't necessarily need to
import the nanite mesh. I mean, everything you can use should be nanite by default. There is no reason
not to use nanite. But if you don't want a
super high resolution mesh like this one,
you don't have to. You can just import
the lower resolution one available in fab. So that's it. So that's how you paint
on nanite meshes. Look at this. That's the
beauty of using this material. So what we're going
to do now is to actually improve our material based on this because now
that we can have this, we can test if we
like it or not, if there are some things
we need to change. So let's do that now.
26. Updating the Texture Tiling: Alright, so one of the
things we need to work on it the tiling. The tiling of our rock. It may seem from this
sense that it's fine. This looks amazing. By the way, we have created a great material that you can use anywhere. But if you look very closely, it starts to get a
little bit blurry, especially when we look
into the unlit mode, you will see that, you know, it's kind of like a you know, it's very low
resolution texture, and that's on purpose
because we want to use two K textures for our meshes. Obviously, if you put
a higher resolution mesh, it will look better, but the problem will still
persist if you actually make this mesh bigger like this
because the bigger it is, the more space in the
screen it will occupy, and you will see all
the blurry textures. So we need to change
the UVs here. If you remember
what we did here, we had a texture coordinate
here and a UV tiling. So it's going to
be really simple. We're just going to put
the UV tiling here. And we're going to click one because we're already
using the tiling here. We don't really need to
do anything so far here. So what we need to do is
just put this constant here and we will call it UV tiling. And we're going to
put it one for now, and we're going to connect
it everywhere like this. I go for UV tiling here, UV tiling, and here. We want all of them to
have the same tiling. Obviously, you can
create different tilings for each layer if you want. But for our case, I want the same resolution
for all the textures. I'm also going to
put it in the group. It's called UV tiling. There you go. Just like that. I'm going to go here, apply. Now what I'm going
to do is just go to the material incense, and then I'm going to go here for UV tiling
and change this. Let's put something like five. Alright, so now
when we get closer, you can actually
see that this is actually looking much
better, in my opinion. All the textures are changing. Not only this one,
this one as well, you can see it has a very,
very nice resolution. I just really looks
so nice, so nice. So UV tiling is very important. So we're going to explore some methods
here that we can use because when we duplicate this
and we scale it like this, you might find that actually
the resolution is lower, so you need to
increase the tiling, like, for example, 15, and that's okay for this size, but maybe for this
one, it is too much. So in that case, we're going to take a look at
other methods where we can change the UV tiling.
So let's do that now.
27. Object scale tiling: Alright, so let's fix the tiling when our rock is
actually bigger. So we're going to go here
and make this one bigger. So there's actually a node
that is very useful for us, and it's going to be
the object scale. And the object scale
is just going to give you basically the
size of this object. So if I right click on this, you will see that it's the size. So obviously, we cannot just
directly connect this here. So we're going to just
put it here just so that we can try
how it looks like. So what we're going to do is to go for make material attributes, and we're actually
going to put this here. Just go to connect for
now just so that we can see actually going to put
a texture here with T, and we're going to
go for textures, go for rock, go for this one, and just put it right here. And now that we have this, let's connect this into the material
attributes, hit apply, and now our rock should be updated with a normal
material, just like this. So how can we use this? Because we cannot really
connect this one here. Like, if we do that,
you will get an error because this is a float tree, and the UVs require
only float two. So what you need to do is to only go for a component mask, just like we did before. The RNG is the ones you're
going to make and just put them like this
and there you go. So now, you have your
UVs based on the scale. So let's take a look at
what this looks like. Now, it looks like
nothing has happened. Let's see what happens
when we scale this one. Looks like something's
going on here, right? So let me right click. Actually, we can
multiply this or divide. So let's see which one
works best for us. Hold to multiply and
then click one and right click and Object scale tiling, press one for now. But put it like this. I believe we need to
divide, but we will see. So let's apply and then go
to the material instance. And what we will do is to
change the object scale. Let's put something like 100 and indeed it is better when
we divide, I believe. So let's put ten, 100, 1,000, maybe 0.10 0.001 250, 0.0 001. It's like this. And the reason this is not happening
is because we need a UV coordinates, sorry, press U together texture coordinate and multiply this. There you go. I forgot
about this one. So let's go ahead and do that. Do not just copy this. Just put texture coordinates first, then multiply by this. So let's go back
and click on one. So now you can see that
when I scale my object, my texture will
also scale with me. You'll see that my
texture becomes bigger, so I don't get blurry. So that is great. That's something you may want because when you have
an object from distance, may look great from distance, but as soon as you get
close, it becomes blurry. So let's try the maybe ten. Maybe maybe two. Maybe two. It's maybe a little
bit too much. But at this size looks
looks okay to me, doesn't look too blurry. Let's try a smaller
size like this. There you go. 0.25. See how it looks like. It's
a little bit too blurry. So we're going to go
here, put like five. Put like five. It's
fine, I think. Let's go for if one
is very blurry. So ten looks like a
decent number here, and here it looks like you
know, it's styling more. So that's great, because
the bigger the object, let's say the player
will come here and you will not see
these blurry faces. So I think ten is
a decent number. Obviously, you can
play with this number as much as you want. For now, we're going
to leave it like that, but now the challenge
for us will be to use them in our
material function. So let's do that now.
28. Adding the Object Scale tiling to our function: So in order to
update our function, we're going to copy
this just like before. Also, we don't
need this anymore, so we're going to
delete it later. So control V, just like that. And this is our object scale, and this is our tiling. So our tiling will
be here. All right. And basically, what we want is either use this
one here or this one. So we're going to use a
switch. Static switch. And what we're going to do
is to put all these here. If it's true, we're
going to use this one. Actually, we're
going to use false for this one because
we're going to call it, are you going to
use object scale? Let it falls like this,
default value falls. And if it's true, we're going to use
this one here. So this value also
going to be an input. So we're going to duplicate this and we're going to
call it static bull. I'm going to put it here. By default, it's
going to be false. Use object scale for tiling. There you go. Use
preview value default. And for that, we need to put a static bull just like that. And with that, we already have the preview
value as default. It is set to folds, which means we're going
to use this one first. So we're going to apply. Okay. Now our material
has been updated. Use Object scale
for tilling here. So we need a static
bull for this, and we're going to right click
and static bull parameter, and we're going to call it
use Object scale for tiling, and we're going to put it
everywhere here. Here. You can also use the reroute
declaration node where we can just connect those
very easily if you want. So for example, name here and just use Object
scale for tiling. Just go disconnect this and use it here and let's just use object
scale for tiling. Click here, copy and paste, so you can have a little
bit more organized. You can do the same
for the UV textures if you want, for this one. For now, I'm going to
leave it like that. I don't think it's
such a big deal. You don't need to use
it for everything. As long as it's not too
confusing, I think it's fine. So just like that, we're
going to delete this. We don't need this anymore,
and we're going to go back to what we had hit Apply. Now what you will see is
that nothing has happened. However, if I go
here to my material, and let me put this
in the group node where we can actually
change this. What's the name, UV tiling. So we're going to
go for UV tiling here and look at what
will happen here. If I go to my material instance and then go to UV
tiling, click here. Now, my tiling will
scale with the mesh. So if I scale it like
this, it's like that, my tiling will scale
accordingly so that when I play my
game, everything's fine. You don't need it's not
blurred or anything like that. If I play like this,
it's also fine. If for whatever reason
I don't want that, I can check this and I will go back to the
default tiling. So it's always nice
that you can have multiple material instance with different parameters
depending on the case. Maybe you have an object that
is very big and you want to use this one or maybe you have an object
that is very small, you want to use this one, you know, without
the object scale. Not every setting will
work for everything, so it's always good to
have the flexibility with multiple material
instances so that you can have multiple
options for yourself. With that set, let's go ahead and continue to
update our material.
29. Updating the textures with new parameters: So I downloaded snow
texture here from Fab. You can choose anyone you want, just like we did before. And I already imported
here to my project, so you don't have to see the
same process all the time. I already have all the textures. I have my mask that I use with the utility
we create before, and I'm going to put
this as mask, remember? The base color here, and I have the normal map just like that. So that's great. What I want to do
is the ability to change those textures in
case I don't like them. That's the beauty of having
this master material. So maybe you have rocks from
the desert or rocks from, you know, in the snowy
mountain or whatever. So I want to update those. So what are we going to do
is to actually just right click and convert to
parameter, all of them. Convert to parameter,
and we're going to call it layer one Alvedo. Parameter two will be layer, layer one mask, and this one
will be layer one normal. Let's make a little bit of
room for ourselves here. Just move it just
like that. All right. So now that we have this, we can group them accordingly. So we're going to put this on
layer one, just like that. All right, so let's
do the same here. Convert to parameter.
L to Alvido. Now, you may be wondering
why I don't name this rock, snow, moss, whatever. I can show you some
experiences while I do this working on the AA projects. It happens sometimes that you have a lot of textures
in different biomes, and you have a really good master material
that you can use, and what will happen
is that well, sometimes they
update the texture. So for example, this
is the moss texture. We're going to update
it to use the snow one. So it is going to
be the tree Alvedo. And what you will have
is a material that says, for example, moss. And when you use it, you're going to find
the moss material, and it's actually snow. So it's like completely
misleading, you know? It's like why the material
instance says that it's moss when it's snow and why does it say rock
when it's grass? And it's exactly why the
reason I personally prefer to use numbers for this because if I update the textures I want
to use in the future, then you may want to also, you know, just use the
right naming convention. Otherwise, it's a little bit
misleading to have this. Let's just leave it like that. I don't really need the
preview. So there you go. All of them are parameters. So now that we have this, we can go back to our
material instance, and you will see that I actually have my layer
one here, layer two. Layer three, this should be
on the layer three group. We have this? It's a good thing that we notice and layer three. And we can change the textures. Maybe you don't like
this rock material, you want to change
it, you can go ahead and download another one. In our case, we're going to
change it to another one. So I'm actually going to show
you something really cool. Let's say you like
these parameters, you can actually Go ahead and create an
instance of an instance. So create material instance. So anything that you change here is going to change
in the child as well. So this one is going
to be my rock snow. So this one is going
to be my rock snow. So we're going to
duplicate this. Just going to put
it just like this. And we're going to just go
ahead and change the layers. So if we change the layers, you're going to see that we're going to put our
textures here for the snow. So we're going to
put the base color. We're going to put the mask here and we're going to put the normal just like that. All right, so why
nothing has happened is because we haven't
updated the material, so we just need to go here and drag and drop this
one and look at that. Now we have our snow texture
here next to this one. And you can actually
change a lot of things. Now, the cool thing about this is that when you
change the parent, so for example, let's say
you change the slope angle, you can just go ahead
and change this thing. And it will update both of them and change it to
the green channel, maybe, maybe also to the red channel,
something like that. It's fully covered in
snow. I like that. So maybe you want to
update like this. The cold thing is going
to update both of them. It's going to update
not only, you know, one of them is going to
update all the child, so you can go here, fall off power, remove the fall off or increase
the fall off if you want. That's amazing amazing stuff. So with that set, we already have a really good
material that we can use. And let's talk about texture
memory for a moment.
30. Memory usage: Alright, so this
is special session because some of you
may be thinking, why I shouldn't just download the acids that you
get from Fab or any other acid for that matter that already comes with a
k textures just like this. Like, the material
is already done. You don't need to do anything. It's like, why are we
going through this? Well, there are several
reasons for that. But one of the biggest reasons is that this is very heavy. We're using an acid that
has eight K textures, has unique textures
for the acid. Which means if we use this
for all our environment, we're going to have the
same size for everything. Now, I'm going to show
you how you can check the size here. You
can right click. Go to the size map, and you will see here that you have different assets that
are occupying some space. You have the static mesh
which occupies 200 megabytes, the normal mat 78, the amin occlusion 39, and so on and so forth. This is already very low
for this type of acid. Usually, you may be, you know, isolating 300-1
gigabyte each acid. So why are we doing this? Well, the first thing is AK textures are
really expensive. So what you can do here, if we take a look at this
asset, take a look at this one. And we can go for
size here, size map. You will see that we're
using the static mesh, still a little bit heavy, but we're using
lower size texture. So our memory actually
is less heavy. So what happens is that well, it's not that much big of
a deal, you may think. Well, the thing is, we are
using the same for everything. Let's say we use
this material here. So let's put our rock
material. Alright. There you go. Would
it like that? And you can save it. And let's take a look
what's the size of this. So we're going to go
here asset actions, sorry, not as actions. Size map. We're going to see, okay, 64 megabytes for
the static mesh, and we still have a
bunch of sexurs here. In total, it's 100 megabytes. But these are the same textures
that we are using here. So if I drag this asset here, we're actually using
the same textures here. So in total, we are only occupying memory the
size of the static mesh. The textures are already loaded. Unlike this one, the
textures are unique. If you put another unique acid, then it's going to
be double the size. And we can have like dozens of rocks here for this that use
this rock master material, and we won't have an increase on our memory usage because we are repeating the same textures
over and over again. And because we are
blending between, you know, different stuff, like we have the snow. We have a secondary material to cover the tiling
of the other one, and you have also moss. You can change some
textures if you want. You won't really
notice the difference. Actually, you may argue that this one looks better
than this one. We can even try this out. We can go here and put the
snow material and you can, you know, do the painting and everything, and
it will be fine. Or you can just use the
most material if you want. But in any case, like
what you need to to consider is that this material is going to be used
several times, and the same textures
are going to be used over and over again. So in total, the size of your
project will be very small. Not only that, you also
have the flexibility of changing the look and feel of all these assets that
usually come with unique textures that may or may not fit the
needs of your project. So that's something
to keep in mind. So with that said, that's the topic I want
to touch on performance. Obviously, this has
a lot of advantages, as you can see,
especially in big worlds. You don't have much
memory to use, so keep that in mind.
31. Wrap up: So congratulations for
making it to the end. Obviously, your work will be to create the exact
master material just like we did here so that you can create a rock master material and use it in your projects. Why I chose to work on a
rock master material is a great example to apply all those things
that you learned, such as tyiling, textures,
material functions. You have reroute notes, you have material
blending, height leer. We learn about object scaling. We learn about world blending. We learn about the slope. It's such a great
and useful material. It's not only great
for learning, but also This is what you have. When you apply when
you work in a project, this is what you will create. This is a real
example that you will be asked in the work or
anything for that matter. To create for your project. This is all the notes that you need to start creating
more materials. Obviously, the sky is the limit when it
comes to materials. But hopefully, this has been
a great example for you to learn all the basics
of materials and actually create something
useful for yourself. So if you enjoy this course, you may want to check
out my other courses. I have planned courses
for landscape, for many other stuff
related to world building. So make sure to check them out. And I would love
to see your work. So make sure to share it. Alright. Thank you so much. And I'll see you
in the next one.