Hello everyone,
We will create such a complex material “from scratch”, I mean, from zero to result.
Well, let's go! First of all, I create a folder for new material
and sign it to understand what it is. I go inside.
What textures did I use? There were three textures and they were downloaded
from Polygon.com - in the last part I showed what these textures are.
I will find the originals of these textures now > Open Source Location.
Next, I'll use Ambient occlusion for the Bump texture for the relief, and from that texture
I will convert it to Normal Bump. Next comes a color texture and Glossiness.
So, I pick these three textures and then drag and drop them into a new folder - either here
or you can drop them into the structure like this. That's all.
Now they will be transferred, you just can't see how the importing process is going because
the folder is blocking your view. As soon as the objects are imported, we will
instantly see them here. And after that we will create a material,
we will immediately throw the resulting textures into a new material.
We right-click > Material and sign that this is Material > Base (our parent!) and also
indicate that this is a floor right away. Next, we open the resulting material, move
our scroll and immediately throw our textures into the workspace.
Texture Samples are created optimally and automatically.
But we don't need this optimalit y, we need each texture to be replaceable so that we
can change it. Let's say we want to create another material
- for example, not a nut, but an oak, solid oak, and we just load new textures, that's
great. How to do it? We don’t need Texture Sample, we need choose
Convert to Parameter. And we sign here that this is Diffuse_texture.
Next, we have Glossiness. We immediately sign that we will have it...
Yes, first ... we're converting to a parameter ... and I'm wondering why it doesn't convert
to a parameter - so, first we convert to a parameter - and that will be Texture_roughness.
Ok, done! We'll come back to this texture later - we
need it, not Texture_sample, but to convert from a conventional diffuse map to a Normal
Bump, we need a certain node. But I'll come back to this later so as not
to interrupt my explanation. Now I'll quickly explain the logic, but you
can find more details in the first part. We right-click to enter Multiply here, or
we press and hold M - this is a hot key – and left-click: we have the node that we need.
Passing multiplication through this node - that is, the Multiply function > we press S > so,
we create a controlled parameter and type in Albedo here.
Albedo means there is a diffuse map, in this case lighter or darker.
So we connect the controlled parameter called Albedo to the indicator B.
These are the actions we will continue to do - we will load some nodes, connect maps
and parameters to them. Now, what is Albedo doing? Look, now there
is zero, zero means black (color), black is mixed with the texture and we get black color.
If it's more than zero, then the texture will become lighter.
If the default value is set to one, it means that this texture will be unchanged.
But in order for our texture to appear, we need to connect this twig to the Base Color.
That's it. We connected it. Now it's going to be the original color. Already
loaded, right? We go to Albedo. Then I can set, for example,
more than one, and the texture will become lighter.
Do you see what's happening here? If the value is zero, then it will be completely
black, as I said. If a little more than zero, or any value higher
than zero, but lower than one, then it will be darker than the original texture.
When the value is zero point five, for example, it will be twice darker.
A value of 1 is the original color, more than 1 means lighter than the original.
Next. When we increase the lightness of the textures, they become more saturated, that
is, the Saturation is increased. To compensate for this, I create a Desaturation
node. I connect indicator A in Multiply coherently
and hold down S and click the left button. This will be a controllable parameter, and
it will desaturate or control the saturation of the light.
Therefore, I type in Saturation_texture, now we attach it to Fraction and connect this
branch to Base Color. When you work in a team, in order for your
colleagues to easily understand how you created the material, as well as to make it to manage
and change this material, you need to select the desired branch, then press C and sign
Diffuse. That’s all, we signed it.
Now we go to Texture_roughness. We will have an area and a group, a Reflect
category, and we will operate completely uneven reflections using Roughness card.
But first, let's run this Roughness through a few nodes.
The first thing we need to do... Firstly, I will maximize the window, secondly, I will
hold the right button, and then move my mouse closer to our sphere to get a closer look
at the maps and the scale of our material, and after that right-click Start Previewing
Node. So what's happening here?
We do not see the material in general, but the separate texture, in this case this is
Texture_roughness. Now, I want to invert it.
For this we have a node called OneMinus. So, we enter here: "one", "minus", and here
it is, and then we pass the texture through this node.
Well, let's see what this will affect. Look, our streaks are black now - this is
the original texture. Passing through inversion node... what we
have now? We have a Start Previewing Node ... our streaks turned white, that is, the
color has inverted. Now, I'll do next.
I need a function or a checkbox so we can switch between inverted map and original map.
To be able to switch between two types of shaders: Metallness and Glossiness.
For this there is such a node called switch, we need StaticSwitchParameter.
It will switch Metallness on and off. So, we attach the inverted map to the True
indicator, and after that we need to manage the switch.
As always, we hold down M, left-click, and Multiply appears here.
Next, we have a controlled parameter, we hold down S, then left-click and here we will have
Glossiness. But this is, if I may say so, such a blend
between Glossiness and Metallness. Ignore these parameters - electrics, dielectrics,
Metallness or Glossiness - these are types of shaders.
The most important thing here is that we need to focus on the parameters that will change
so that we can easily get the material we need in two clicks.
In general, we connect the A indicator to B, and then we connect the Inversion to A,
and finally, this small structure we connect to False.
And then here and now we can manage the inversion and its blending.
That is, we can say that this is a type of shader - Glossiness, Metallness, and we can
operate them. Next we need to make this texture more contrasting
to control the reflections. The streaks will be more or less prominent.
For that, we have a cool node called CheapContrast, here it is at the top.
Here, to the “In” indicator, we connect Metallness.
And we will control the contrast as usual with a controllable parameter that will be
called Roughness_contrast. That's it, we did it and connected it to the
appropriate input, that's great! So now we have two parameters.
The first parameter, which inverts our original texture, and the second parameter, which controls
the contrast. And the third parameter - for this we hold
down M and left-click - this is the lightness of our Roughness.
Then we press S – this is our control, a parameter that will control the lightness
of our texture. So, we will have it - and let's sign it for
ourselves. just to understand in parameters - Roughness_intensity.
Next, we connect the parameter to B, then we connect our chain to A, and after that
we connect our entire structure to Roughness. So, now let's move this whole structure, like
this. Here we press C > Reflect. Done.
I'm just trying to make the structure a little better so that you can understand what is
where. Now we need Metallic and Specular.
Using the usual parameters, let's control - and therefore it will be Metallic.
Next, using Control + W, we copy this and it will be Specular.
We connect to the appropriate inputs, right? Now everything is ready here, but if we forget
something, we will just return at any time, save it to Parent, our changes will be transferred
to all instances. NormalFromHeightmap node doesn’t work with
Texture Sample. But we can do next.
Let's find this texture by clicking on the magnifying glass icon, it will be selected
in the Content Browser of the project, and after that we write NormalFromHeightmap ... oops,
not there ... no, everything is correct. Look, NormalFromHeightmap is the node that
makes Normal Bump out of a conventional texture. Yes, that's all.
But we won't be able to connect the Texture Sample: look, that's it, you can't.
What will we do? We select one more time, found this texture,
and now we find the TextureObjectParameter. Done!
This will be our Bump_texture, that is, we can change this texture later.
And connect it to Heightmap. Why did we select this texture?
When the certain texture is selected - when creating a new node – the selected texture
is applied to this node. But we could, for example, do this - select
this texture and then click like this. Or just drag and drop it, no difference, it's
just faster as I showed. Next, we hold down S and left-click, this
will be Bump_intensity. We connect Bump_intensity to Normal Map Intensity,
that's it, our mission regarding Normal is complete.
Normal will be converted from color or black & white texture, it doesn't matter, to Bump.
So, we select our branch and click C, then sign "Bump", after that we connect this branch
to Normal, that’s all, done! Let's move it to make it clearer.
Now we have a little more to do. This is the scale of our texture so that we
can control our texture, but we'll also add rotation here.
But first I want to say about a very important point.
Look, now I will right-click and select StartPreviewingNode to show the Normal texture, you see?
Now the texture itself is not visible, no Normal.
In order for this texture to appear here, we need to create coordinates - we hold down
U and left-click. If we now connect at the same time to Normal_Bump,
as well as to Diffuse and Roughness, then our coordinates will change proportionally.
And I will do the following: right-click > Multiply, or hold down M and left-click, connect via
multiplication, and the next step we need to right-click and select the AppendVector.
I connect this node in Multiply to indicator B, then S - a controlled parameter - this
will be U, {Control + W} - this will be V. So they are X and Y of our texture coordinates.
We connect U to indicator A, then V we connect to indicator B, and after that we connect
our small structure by a twig... you can see, Simple Texture has its own coordinates.
So we connect it in right here. But the TextureObjectParameter doesn’t have
this parameter, U/V, there are no coordinates. However, NormalFromHeightmap has such a parameter,
and here it is – Coordinates, that's it. And besides, I forgot to add rotation here,
that is, I want to rotate the texture at the same time.
How do we do this? The CustomRotator will be responsible for
this, we set the coordinates as UVs. Next. Passing through consistently, we set
in Multiply a node that is responsible for rotation. That’s all.
And now, most importantly, Default Value is set to zero here, but in order for our coordinates
to appear, we need to set the value to one for U and V. Good!
And now all our textures will work. But we don't have the intensity yet, because
it is set to zero here. Besides the fact that we did not have the
coordinates, it just was zero, and no texture applying could take place, we also need to
set the value to one for the intensity. Then our Bump will work, here it works.
But there is one thing which must be made clear.
First, I want to say that such material is quite expensive in terms of resource consumption.
In my course, I talk about a working way that I use in commercial projects, a way where
a Bump can be created in other applications. And this option is more optimized.
The option that I'm showing you now is a more universal, or, if I may say so, a more lazy
way. Ok, actually, you can use this one too.
And look, one more little thing. When we use NormalFromHeightmap, we need to
go into it twice, and by default, the system is set here five-thousandth, that is, this
value makes too much of a shift. Now let me show you, what I'm talking about.
By default, if my memory serves, the value was set to five-thousandths here.
And, you saw such a blue texture here, so it was not as saturated as it is now.
This is too much of a shift. What is the consequence?
I’m moving here now and, above all, I’ll save this.
this node, you save it not only for this project, but you save it systemic, for the entire engine.
And now - you see that happening? - this offset works by default.
And this offset won't work correctly. So let me show this, using the old material
that we did before. And now, all this has been applied systemic.
You can see that the previously applied material is now being modified, compilation occurs
in the lower right corner. The compilation will be completed now, and
you will see that Normal Bump will not work properly.
And again, as I said: by changing the system node in one project, it will change in all
projects in the engine. So, you see what we've got?
The Bump is too ... I mean… the color that controls our relief is shifted.
In this case, I have empirically determined that one ten-thousandth is perfect for our
needs. I'm saving this now.
And you will see then, because we had a shift here, but now we have an exact Normal_Bump.
That's it, we decided on this. So we have Bump, we have Reflect, we have
Diffuse and we also have control over these textures.
I select the U / V branch, and then press C and sign that we have UVW.
I'm saving this material now. Next, from the base parent, that is, the parent
material, we need to create an Instance. It's important to save the structure I showed
just the way I showed it. So we have Parent and we have Instances.
Well, now the compilation is complete and we are moving on.
We find this material... here it is, right? In floor_remove.
And then, that's okay with Bump now... We are creating an Instance from the base
Parent: right-click Create Material Instance. We did it.
It is generally accepted here to sign the M-Instance or MI.
But it doesn't matter, so you can just copy, I usually just copy, but leave the structure:
M - material, t - texture, here you can rename, but we will not waste time on this now.
Anyway, we go to Instance. We went to Instance.
This Instance is not configured yet, we are applying it. Ok, we applied it.
Now, when the material is overlaid, there will be a compilation, and also when switching
Metallness to Glossiness and back for the first time, the compilation will also take
place. Now the material is not configured, we'll
do that. As you can see, everything is inconveniently
located here, just all is mixed, both scalar parameters and texture options, all is very
uncomfortable. Let's go back to our main structure, and here
we will change the categories, create our own categories and assign each category to
its intended purpose. So, the first group will be Diffuse.
This Diffuse group will include: besides the fact that we have now put this variable parameter
in the group, since the texture will change, we can also set Sort Priority to one.
That is, in the group in the Instance, in the Diffuse category, our texture will be
displayed first. The next one will be Albedo.
Albedo will also join the Diffuse group, but it will be the second by structure.
The next will be Saturation Texture. It will be in the Diffuse group as well and
will be the third on the list. After that, we go to our Reflect.
So, we select - let's take, for example, Glossiness or let's start with textures.
This will be a group called Reflect. The main thing is that the texture should
be the first, so it is more convenient, and keep the rest, as they line up.
We choose here: Reflect. Metallness also goes to Reflect.
Roughness goes to Reflect too and Roughness_intensity goes the same way. That's all, isn't it?
If we forgot some of them, for example, I didn’t include Metallic and Specular in
the group on purpose, so that later we would see that in the Instance they will stand separately
in scalar parameters. So, now here we need to select Bump_texture,
Relief groups, and here we also need to do it within the meaning as before.
Bump. Sort Priority… let it be the first. Intensity will also be Bump. Bump_intensity
- there will also be Bump. And here Sort Priority doesn’t matter.
And next, we have also a U/V group. So, for U now we take CustomRotator… first
of all we have there… By the way, CustomRotator - and this is an
important point - I forgot about the controlled parameter there: we will have Rotation_UVW
here, right? We link the branch here, in Rotation Angle.
So here is a hint for you - there will be a rotation from zero to one, I mean, zero
and one are the equal values. As I have told in the first part of the video,
so there will be in the first part of the lesson.
So a zero value means that the texture applied as it is, as for the value of one - the changes
will not be seen because it is a turn of 360 degrees.
Zero point one hundred twenty five is 45 degrees, zero point twenty-five is 90 degrees, zero
point five is 180 degrees, so zero point one hundred twenty five - this will be a 45-degree
rotation. So, now you’ll see how it works.
That's all. We put the Rotation and chose everything here. This group will be responsible
for… we have not created it yet - this is the UVW.
By the way, let's, just like in the example with Rotation, we will sign that for Description
– and let it be the first in the list - the description will be like this – “Change
between zero to one”. And here for Diffuse_texture let’s sign
in the description, for example, “Change your diffuse_map”. That’s all.
Do you see? A hint pops up here, if anything... Our colleagues will be able to open it at
any time and will know what and where to change and what is responsible for what.
I set UVW_map for U here. There is also a group called UVW_map.
And I also want to show ... we have Glossiness - and for it we can set not a zero value,
but a Default value. Zero point five tenths is a standard value
which we will not even change. But there is a Slider Minimum and a Slider
Maximum here - that is, there will be a minimum from zero, and the maximum will be limited
to one. It makes no sense for us to change anymore
- this will not affect any parameters, so that the person who later opens the material
doesn’t set the value more than one. Now we save it, everything is ready.
Let's go to Instance and check it out. You see, I deliberately left the scalar parameters
Metallic and Specular, and a group without naming was created separately here.
So, we go to Metallic and indicate that this will be Reflect.
Specular will also be Reflect. Then we save it again.
And this unnamed group of scalar parameters will disappear and these two parameters will
be moved to the desired category. That's all. Now, let's see and check.
So, we have Bump, Diffuse, Reflect and UVW separately, that's right.
For convenience, I'll put it like this. So, in Bump, as you can see, we can change the
texture. In Diffuse and Reflect, we can also change
the texture. Thus, at any time, we can replace the textures
with those textures that we need. Now, Bump. Let’s start with Albedo.
I would like to make it a little lighter. You see, we make lighter but the texture becomes
brighter. So we compensate, desaturate our texture.
Then I turn on Roughness_intensity. I am increasing the value, but nothing will
happen until we turn on the Specular. We turn on Specular and the reflection for
dielectrics starts working right away. We have Metallic - this is a reflection for
dielectrics, you can add a little Metallness to non-metallic materials.
Now let's take Contrast. I add Contrast here and our texture becomes
contrasting. Now I will turn off Metallic.
Our texture becomes more contrasting and here with the help of intensity we can show our
streaks less or more. Let's set a bigger value for the Bump until
the Bump shows up. You see, our seams are showing.
But the texture is too huge. I'll set, for example, 3.0 here for U and
here independently I’ll set 2.0 for V. Do you see? It scales disproportionately now.
If you want to make it proportionally, just set two of the same values and everything
will work. Rotation. I want to rotate 180 degrees, so
I'll set it to zero point five. Do you see? Our texture has been mirrored.
If you need to rotate 45 degrees, then set it to zero point twenty-five.
If it is necessary... now it has turned 90 degrees, but we want to rotate it 45 degrees,
then it is needed to set to zero point one hundred twenty-five.
As you can see, our textures are at an angle now.
Next… can you see this? We have a check mark next to Metallness here - the first time
there will be a compilation, but then this structure will be easy to switch on and off
here. Now it will take a few seconds to compile…
there it is! And we press a second time to compile this
parameter. Ok. So, what's going on here?
Look. When we turn on Metallness, Glossiness disappears - do you see it?
And conversely, turn off Metallness and Glossiness instantly appears here.
And now let's play with these parameters. What do we want to achieve by this?
Here we have the usual Glossiness, and here we have Metallness.
Choose the material that suits you best, the parameter that will work for you.
And here I want to make even less material, so we’ll reduce our textures by half and
continue. Now I want to change, for example, the intensity
- look, so the intensity will be higher or lower.
And the contrast can be changed in the same way.
When you increase or decrease the contrast here, the streaks start to disappear or, conversely,
appear. Specular is the power of reflections.
And now I can turn on Metallness. At the same time, Glossiness will now disappear.
It’s gone, right? And now we will set the parameters in such
a way so that we ... so that we have an effect, and it will be the opposite - the opposite
effect. Here, you see this?
Now I… Here it is…
And now this parameter - the reflection of the streaks - we will change to inverting.
Here we uncheck the box, and Glossiness turns on.
And we take a screenshot. As you can see, we control the reflection,
which means that our streaks will either be reflected in this way, or they will be inverted.
Choose for your own material. Let's go back to the material.
… and turn off the unnecessary. Albedo can be made darker or lighter, as you
wish. And once again I show - when we turn on Metallness,
Glossiness turns off, and we start specifying our parameters for Glossiness.
And empirically we achieve the desired result. We're making Glossiness lower.
Now, once again - we turned it off, Glossiness appeared, and by the way, let's turn on Glossiness
right now, by default we have set zero point five.
And we can switch like this too, do you see? We can also influence the nature of reflections.
Thus, you can create any material in a completely universal way - it can be solid, opaque, not
the subsurface, but simply relative to the wood, relative to the materials of the wall
and brick. As for a brick - displacement will need to
be added, for example. In general, if you liked this video, put your
"thumbs up", if you are interested in the topic of complex materials, write about it
in the comments, I will continue to reveal this topic.
So, support the channel, like it, share with your friends.
That’s all! Bye everyone! Until next video, good luck!