Transcripts
1. Introduction to Class: Hello everyone, and
welcome to this new class creating stylized grass
in Unreal Engine Five. With the help of this class, you would be able to create your very own fluffy
looking stylized grass. We will be going for a look similar to studio gibley grass, but you can very well
customize it on your own. We will start the process by setting up the RVTs and creating the landscape material as the color for the grass would be driven from the landscape. After that, we will be
modeling the grass clump in blender using very simple
modeling techniques. You can use any three D
modeling package that you have as the steps
done are universal. After we export our grass
model from blender to unlined, we will be creating
our grass material. We will add various
customizations to it through which you can
adjust it accordingly. At last, we will also
be adding wind to our grass material so that our stylized grass looks
even more realistic. We would be learning a lot, and I hope to see you
there in the class. Thank you.
2. Setting up RVTs: Hello and welcome everyone
to this new course where we will be creating
a stylized environment. From start to finish,
we will be creating a landscape type environment
with a stylized look. We will be covering a bunch
of things in this course, like creating nice looking, stylized fluffy grass,
stylized foliage. Things like stylized rocks, bushes, clouds, and
many more things. Let's start right away. We can start by creating a
new hundred project. Just open up this unreal
project browser and head over to the game Stab so that we
can create a new project. You can select blank
from over here, and rest of the setting stay at default, check,
check, check, check. Now let's just change the name. I will say it to
something like course, underscore stylized environment. Let's just hit Create and
wait for it to finish. All right guys, now our new
under project has opened up. I will just go over a
couple of basics of Fundal. You can move around in the
Ca by holding right click, and then using WASD to move around like in a game.
It's pretty basic. Another thing, if
you want to bring up your content browser, you can just press control
plus space to bring it up. I'm pretty sure
that you are aware with all these shortcuts
because they're pretty basic. Now, in this first lecture, we will start by creating a simple landscape
master material. We will set up a landscape
and we will also set up our RVD's that is run
time virtual textures. If you don't know what that is, it's basically a feature
in Unreal Engine that will help our assets
to pick up color from the landscape itself
and use it so that there is a seamless transition between our landscape and the assets
that are kept over it, like the grass, rocks,
everything like that. A we will get like a seamless transition between them and not like a hard edge. It will mainly help
our grass to take color from the
landscape. All right? Yeah. If you don't understand it that well right
now, don't worry. We'll go over it completely. In the upcoming lectures, you will understand
it completely. We don't really need
this level over here. This is like the starting level. We can right click over
here in a content browser, so just press control
space to bring it up. And you can click over
here to dock it in layout, so that it stays over here. Only now you can
hit right click. Create New Level. Let's create this new world. Only double click to open
it up, say selected. And now when the
level will open up, you will be welcomed with
this completely black screen. Because currently the level does not have anything,
not even light. We need to add them on our own. Let's just quickly set up a basic lighting
scene for our level. Now you can go over here
in window and enable place actors so that we can
view this place actor window. You can just drag
and drop anything from over here in this
window into the scene. Let's search for something
like directional light, which will basically be our sun. Drag and drop it over here. You will notice nothing
really happens. But wait. Another thing
that we're going to add to the atmosphere,
that is sky. Atmosphere. As soon as we
have like a nice looking sky, we have this dark
area over here. We'll just fix that in a minute. One more thing is select the directional light
and make sure to search for atmosphere,
sun light over here. It is enabled by default, but if it is disabled,
just enable it. You will notice
this is the thing that connects this directional
light to the atmosphere. That way we can see
the sun over here. Next thing to add is I think we can add exponential height. For to add a bit of fog, we don't really need
fog in our scene. But let's just add
it so that we fix that black color thing over here that was
appearing at the bottom. You can adjust the fog
directly from over here. By the fog density, we can decrease it to 0.0 001, that it is very less. Let's see, Next we can add is skylight is dragon
robber skylight. And make sure to enable
real time capture from over here so that we don't have to
capture it again and again. It will automatically update whenever we change the lighting. The last thing to add is
you can also add a bit of clouds just for now so that
your scene looks good. But we won't really
be adding them in our final scene as we will
be creating our own clouds. We don't really need them, but if you want to add them
for now, you can add them. Yeah, that's basically it. Let's see. First
we can hit Save. Another thing that I will do
is I will just select all of them and click over here
to create a new folder. And I will place all of
them in the light section. Yes, so we have
everything organized. We will try and keep
everything very organized in this course so that
we have no problem in finding assets and things. Also, when I pass on all
these resources to you, you guys also don't have any
issues finding out things. Now we can just close this place actors window because we
don't really need it. Now we have our basic
lighting set up. Next we can add a
landscape to our scene. You can go over here
in the select mode and select landscape
from over here. That will be now in the
landscape editing mode. And you can see this
huge green color plane appearing basically
what this is. This will Help us visualize how big our landscape is and how many
like sections does it have. You can see if you change
it from over here, it will update if
you just create, now the landscape is appearing. You can sculpt on it
and do things like it, but let's just undo it for now. We need to change a couple
of settings over here. I don't really want the
landscape to be too big. I will just go over here and set the selection size
to seven by seven, and we can increase the number
of components to 32 by 32. Then I will just scale it down. Type in just 25 over here. That way we have a nice bit
of detail in our landscape. And it is like really small because you don't want
it to be too big. We can detail it properly with it being small if you want. Yeah, definitely. You can go for a larger one if you
want to have that. But yeah, I'm just
going to keep it this way and create now. All right, so now we have
a landscape with us now. You can use the tools
over here and the brush to sculpt on the
landscape very easily. We can add elevation
by painting over it. If you hold shift,
then you will be like adding depth
to the landscape. You can also change the brushes
to add like smoothness. You can select the
smooth brush or flat to flatten out the surface. They're pretty self explanatory. We also have brushes
like hydro and noise that damage thing to like your landscape to make
it look like actual land. Which is pretty cool.
Yeah, Basically, I will just quickly
undo everything. Now what we want to do is we just want to add
like a little bit of variation in the
elevation of our landscape. Just so it looks
like a real land and does not look like
completely flat this way. Let's just just brush size, Let's set the strength
to something like 0.2 that it is not that much. Select the scud tool and just
paint over it like this. Randomly, you can add a little bit more elevation
to some of the area. Just so we have
variations all around. Right away, it looks
like much better, but we can maybe
select things like the erosion brush
again, paint over it. Don't want it to be
like that obvious, we just want it to be
a little bit subtle. As you can see, we have a little bit
damage in some variation. We can add some noise as well. That much. Let's just
undo it over here. I think I will use a
flattened brush to decrease this a little bit. Obviously, you can spend some more time with this
until you're satisfied. But yeah, I think
this is pretty good. You can also use a smooth brush to like smoothen out some of the surfaces where you think
the elevation is too much. But yeah, this much is pretty
good. I'm happy with this. If you look at from
this perspective, we have like various
different elevations. Just let C and add a bit more height
over here. Like this. Yeah, I think that's good. Let's come back to
the select mode now we're done with
the landscape. Now what we want to
do is we want to set up the runtime
virtual textures. The first thing that
you need to do is to edit and project settings over here ser textures, you need to enable
virtual texture support. If you are doing this
for the very first time, it might take a little while, so just keep that in mind if you enable and then you need
to restart your project. I'll just hit Restart. You
guys can also do that and grab a cup of coffee because it will take
a little bit while. I'll just resume back the
video when it is done. Save. All right
guys, it is done. Now let's just close this
project settings window, open up our level. Let's see. I will right click over here
and create a new folder. Let's just rename this to R VTs. We can add our run time
virtual textures over here. The first thing that we need
to do is go over to Tools to window and enable
actors and search for. Time. Yeah, pin time, virtual texture volume, and just drag and drop it onto the scene. Now you can see this volume
has like a box like thing. What we want is we want this box like thing to cover
our entire landscape. That way the volume would work. We don't need to do it manually. We can do it from over here. But before that,
let's just rename this press two to rename it. This one will be our base color one because we will be
creating two volumes. One for the base color and
another one for height. Duplicate this
suppress control C, then control V. Rename
this one to height. Press two again and
rename this to height. All right, now we
have created like two volumes to run
time, texture volumes. The next step is to create the corresponding two textures. Come over here in this folder. Let's close this
place actors window. For now, in the content browser, hit right click and in
the texture section, you can create a run time
virtual texture from over here. Create this again. I will first rename
the base color, just so we know that it
is for the base color. Right click textures, and
again create another one, and this one would
be for height. Now select the base
color from over here in the virtual
texture section, come over here,
select base color, and in the height also
select the height. Now we need to change
their size just so it fits everything fits
our landscape properly. So it is very easy to do,
just select the base color. And you will see
this bound Align actor, select the dropdown. And using that dropdown,
select the landscape. And then hit Set Bounds. As soon as you do that, you can see the size has increased and it is completely
encompassing our landscape. Do the same thing
for the height. Click on this, drop down, select this and set downs. All right, perfect. We are, good to go. Let's see. Next step is to just
open up your base color, the textures from over here. Double click to open them up. Now when you open this up, we will see the virtual
texture content and we can just change it to base color only because we will only be using
it for base color. We do not need the
rest of the channels. Select base color and
make sure to increase the size to its
maximum and it's safe. Close this and do the same
thing for the height. Double click to open it up. Change it to world height from over here and
increase the size to maximum Close this
again if you want. You can change the
virtual texture content for the base color to
contain all of the channels. Just to have them, but we
won't be using them at all. We will be using the
base color only. But let's just keep
it to have it. All right, now we are basically done with a run
time virtual texture. The last thing to do is select the landscape and drag
down come over here. In the virtual texture section, we also want to add both
virtual textures just to know that they need to be
connected to this landscape. Click over here and select
the base color again. Click on this Plus Cycon
and select the height. Now as soon as you do that, you will see that our height has some texture
appearing over here, this black and white
texture, basically. Now we know that our RVTs are working because basically what this white and black color is, wherever our landscape is like, raised in height, it
is appearing in white. And wherever it is flat or like downwards, it
is appearing black. Just quickly restarted
my unwell project and you can see it is
appearing over here also. Now we can also see in action, if we go over to
the landscape mode, let's just again start
sculpting over here. Send this to something like 0.2 again and just sculpt
lightly like this, you will see update over here. As you can see, yeah,
the color has updated. If you keep on sculpting, you'll see the map
changes over here. Also, the base color
is not really changing right now because our landscape
does not have any color. But when we will add
our landscape material to it to give it color, then we will see it appearing
in the base color section. Also, if you hold shift
now and create depth, you'll see that black color
spot appearing in the center. This is basically for the death. If you keep on like painting, you'll see it starts
to appear basically. Now we can confirm that our RTs are working properly and they're connected
to the landscape. I will just quickly undo it. Yeah. Now I think it is done and it should revert
back to normal in a while. I think it is still
left. So let's just quickly undo everything. All right, so everything
is back to normal again. And in this lecture
we have successfully set up our RVT's. I think this is it for
this first lecture. In the next video, we'll be creating a landscape material. Yeah, we will start to paint on the landscape a little bit to
give it a bit more detail. Yeah, thank you as watching,
I'll see in the next film.
3. Creating the Landscape Master Material: Hello and welcome everyone. In this lecture, let's set up our landscape master material. I'll just come over here in
the content right click. And let's create a new folder and we name this new materials. Now in this folder, let's again right click and create
a new material. I will name this as the
Landscape past the Material. Double click to open
up this material. And let's start. We
will be creating a pretty basic landscape
material. Let's just start. First, to access all the
runtime virtual textures, we need to add a
virtual texture output. Not just hit right
click and search for virtual texture output Enter and place it right over here. All right, next we need to set up the base color
of our landscape. What we will be doing is we will be setting
up a layer blend. And we'll choose like three
or four different colors, one for the ground,
dark colored grass. Then we will blend them all. And using that, we will
paint on our landscape. Just sit right click
and search for landscape layer blend this one. Now what you need to
do is select this node and come over here and click on the plus icon four times to
create four different layers. Let's open this up from here. The first one would be a ground. The second one would
be grass underscore, will be like a lighter
version of our grass. This one can be sly grass. The last one would be
grass underscored dark. Now what we need to do is we need to plug this
into the base color. Basically, this node will
drive our base color. We need to add like four different colors for
all these layers. Just V on your keyboard hold and then just
click like this. You will see a
parameter is added. Basically, this is like a vector four parameter and
we can rename this to ground just like this. Now this copy paste
this four times, just plug all four of them into their respective channels like this and make sure
to rename them. This one would be grass
underscored light. This one can be grass, the last one is
grass underscored. All right. We could
have also like created them normally
just by pressing three. And if you use like this
kind color basically, this is also a color input only. But the reason I created them parameter is you can just right click and
convert this to parameter. Now this is a parameter. The basic difference
between using it normally and using it like a
parameter is, uh, when we create the
instance of this material, we can change this on the fly. And we don't have to go
into this material and change the color like
manually again and again. We can just directly change
it from the instance. Let me just quickly
show you how. First let's just set the color. Select the ground
and let's see that the alpha to one and we can select like a yellowish
color for the ground. Obviously, we can change
this at any point of time. You can just quickly set
this to anything you like. This one would be a ground color for the grass underscored light, we can choose like a
greenish yellowish color, something like this. For the grass underscored dark, let's just select a darker
color, something like this. For the normal grass, let's choose a
basic green color. Yeah, I think this is
pretty good now, as I said, we can change these on the fly when you could save on
your master material. Wait for it to completely save. Let's close this window and
if you come down over here, right click and create
material instance. We won't be actually using the master material
on our landscape, but we will be
using the instance. When you open up this instance, you can see over
here we can easily change all the colors on
the fly however we like. We don't have to
actually go into the master material and
make the changes over here, then it safe, because that will be a long and
tedious process. Yeah, that's why creating
like parameters for the values that you will change
often is a good practice. Let's just hit safe. I will
delete this instance for now. And open up the master material again. And let's start working. One thing that we forgot is make sure to set
the alpha to one. Yeah. All right. Now for the specular
and the roughness, we can basically hold one
on our keyboard and then click to create these
two scalar parameters. And just plug them into
specular and roughness. Make sure to right click
and convert them to parameter like this and
rename this one specular. This one can be our roughness. Now obviously we don't want
to set the roughness to zero because landscape is
basically like ground. It won't be reflecting that much value for the default value. We can set this to
one for the specular, Let's see, You can see how the specular value reacts with the
landscape material. For now, I will just set
the default value to 0.1 and we can see how
it works out. It's safe. Now, basically this is a very
basic landscape material, but you will notice that
we haven't actually done anything with this runtime
virtual texture output. What we need to do
is it is pretty. Whatever you plug
into the base color, you can just grab it and plug
this into the base color. And this way now it is working. Connect all these colors and our base color into the
N time virtual texture. Whenever we place things
like grass or rocks, whatever, they will
pick up the color from the ground and
everything would work. Just plug this into the
base color if you want. You can also plug
these channels into the specular and the
roughness like this, but we won't be
really using them. I will just not do it. Another thing that we want
to do is if you remember we created two different RVT's, one for the base color and
another one for the height. We need to plug something
into the world height. It is very simple,
you'll just hit right flick and search for
the node world position. This one absolute
world position, this node will
basically give us like the coordinates of
a single pixel. We cannot directly
plug this into the world height because these
are like the coordinates. So we'll just keep it like this and search
for component mask. Basically this will mask out the coordinates value this
has like R, G, and B. Basically this is x, y, and z. For the world height,
obviously we will use the z axis only because
that is the height. Just enable the channel because
we only need the z value, because we only need
the world height, we do not have any use for
the X and the Y. Rgb is X, Y and Z just enable the blue channel and we
only need the z value. And now plug this into
the world height. Basically it is working perfect now and we're done with
a landscape material. Now let's start painting on the landscape a little bit
to give it a bit of color. Close this, now hit right, create material intense, select the landscape
and just drag down. And in the material section, landscape material,
drag and drop. This material
instance like this, you can see our landscape
went completely black. All right, let's fix that. We can go over here in the mode, in the landscape mode, select the paint and you can see all four of five layers
are appearing over here. But if we start painting,
nothing really happens. It will say that this layer has no layer in
four assigned yet, so we need to create that.
It is pretty simple. Again, click on this plus icon and select Weight
Blended Layer Normal. And we can save it over here. But first I will create
a folder right click and create a new
folder layer info. Now click over here,
Weight Blended Layer and the layer in four
folder. It's safe. Wait for it to save. Now as
soon as you will save that, you will see the ground
color is appearing all over our landscape because
that was the first layer. That's why it is completely
filled like this. You can now select
the grass light, click on the plus icon, and just keep on creating
all the layer in files for all four of
the layers like this. Now all of the layer
inflows are created. Now when you select the
layers from over here, like let's select the
grass and start painting, It might take a
little wide to load. At first it will
be a little slope. You can see this green color
is appearing over here. It is not as dark
because currently the tool strength is set to
0.2 If you increase that, now you will see it
is a lot darker. We can sleds dark and
start painting like this. It is a little bit laggy, but yeah, we can work with it. It is definitely not that bad. You can see this way.
We can paint over our landscape easily adding like all these different variations of colors to make it look good. What will happen is when we will add our grass onto
the landscape, it will basically pick these
colors from the landscape. And using runtime,
virtual texture, the grass would automatically appear of that color, whatever. Below it. It could
be really cool. We'll do that later on. But right now, this is
looking like really bad. Not that good. What we can do is we can use
the custom brush. That way we can easily
paint onto our landscape. If you select this
icon over here, we can also select the
alpha brush from over here. Currently it is empty, but if you move over into your resources folder that
I've provided to you, open up that folder. In the Textures folder, I've added this Landscape
Alpha, this dragon. Drop this into unreal. Obviously, we cannot
keep this out over here. Let's just create a new folder and keep everything organized. Drag, drop this into
the Textures folder. Now, select the
Alpha and Dragon. Drop this Alpha over here. Now you can paint
over it this way. It would give a nice
feel onto our landscape. It is much better than
using the normal brush. As you can see, it is already giving us really nice results. All right, Before I
start to actually paint, I want to show you something
that I mentioned earlier. If you go back in the
material section, open up the material instance. As I said, we can change
the colors on the fly. Let's say I did not
like the ground color, so I can set this to completely
different, like red. Okay? And you can see instantly that color
changes to red. This is like the power
of using parameters. We don't have to go into the
master material actually, and we can just quickly change
them from over here only. Let's see specuf I
said this to one, give us better results. One is lights zero. I think setting it to
zero looks much better. In my opinion, roughness
is okay at one only. Because if you
said this to zero, everything would be
like really reflective. We cannot see it right now. But yeah, we don't want
this to be reflective. We'll just set this to
one, only specular. Instead of setting it at zero, we can set it 2.1 Now let's just start
painting on our ground. We can adjust the
colors later on. How we can do that is I will
just select the grass dart. Give it complete
one tool strength, and paint it all over
our landscape like this. Discover it entirely. This now we can use the other layers
to like layer onto it. Let's select the brown
and make sure to decrease the tool strength to something
like maybe 0.4 for now. And quickly dab onto your
landscape like this. If you keep on layering, trust me, it would turn
out to be really good. Just keep on doing this. You can see we have this
nice layering effect, like over these areas, we can use it repeatedly. So maybe set this 2.6 this time. Again, keep on doing this to give it like a painterly look. I need to do it like multiple
times to make it look good. Let's select this now. This might take a little while, but it will drive how our
actual environment looks later on because
all these colors are dependent on to grass. It'll decrease it to
0.2, or three maybe. So now I would just
suggest you guys to pause the video and just keep on doing this until you feel like kind of nice effect
has been reached. Make sure to keep
on like changing the tool strength again and again and just have different
variations of these grass. And you can see it
is starting to look. All right. Obviously we can change the colors
at any point of time. The tools strength because I want the grass
dark to be like, mainly predominant
in the landscape. Now, just select the, this
one is a tool stretch, again, just to the same because earlier it was looking
like really light. Now it is much better.
I think either side, this might take a
little while to achieve the perfect
combo right now. I think I'm really
happy with it. It is, giving nice
painterly look and I'm quite satisfied with it. Let's just keep it this way. And I will hit save. We are done right now with a landscape. We have set up the
basic material. We can now change these
colors whenever we want. But right now, let's
keep them this way. Only when we will actually add our grass onto
our landscape. Then we will change
the colors and see how they react and how they look. For now, I think that's pretty
good. Let's just hit safe. And much is it for this video. Thank you, us watching.
I'll see the next one.
4. Modelling the Grass: Hello and welcome guys. So in the last lecture, we
created our landscape material and also set up the landscape
so that we can paint on it. And in this lecture, let's
just finally start to model the assets that we will be mainly using in
our environment. So the first thing that we
will be creating is the grass, so it is pretty easy to do. Quickly open a blender
because we will be using blender to
model everything. All the grass foliage,
rocks, everything. We will be using blender. Open up a new scene in Blender. And let's just start
by pressing A to select everything and just delete all these
default objects. I will also press N and quickly
enable Screencast keys, just so you can see all of the shortcuts that
I'm performing. As you can see, they
will appear over here, all of it by clicks and even the keyboard shortcuts
that I'm performing. Yeah, that's pretty helpful. All right, to start off, the first thing that I
want you guys to do is if you will quickly go over
to your resources folder. In the exports folder, you will find this unreal
mannequin FBX file. Basically, we will
be using this model. This is like a human
model that we can use for our reference reference, the size of our
grass and foliage. Everything just go over
to file import f x. Now quickly head over to your tutorial directory
just a second. Now, in the exports folder, select this and you will see this mannequin
import it into a blend. Then we can use it to reference
all our assets that we create so that we get the perfect size and nothing is like too big or too small. All right, to start off, let's just press Shift
and add a plane. This plane would
be added, press R, then X, and rotated
by 90 degrees. You can type in 90
on your number pad to rotate it exactly
by 90 degrees. The first thing
that I want to do is I want to move
the origin point, right over here at the bottom. Do that, just press Tab
to go into the edit mode. Press two for select, select this edge, and
then press Shift Plus. And move the cursor over here. Select cursor to
select shift plus S, then cursor to
select it to bring the cursor right at the
center of this bottom edge. Then you can go over
here, object set origin and set the
origin to three cursor. The reason I'm doing this is
I'll just quickly show you. First you can press, then set. Now when you hold control, you can snap it like
this and easily place it exactly over
this axis like this. That is exactly over here. If you scale it
down, you can see it is really simple
to scale it down. If you press then
to scale it up, you can see it is pretty easy. Conversely, if you
add another plane, and let's just say the
origin was in the center. And if you place it like this, then if you try to scale it, it can get a little
bit tedious this way. When you set the origin
right at the bottom, it is very easy to
scale everything. All right, let's see, I will first scale
it down something. Let's just see how thick we
want a grass strand to be, obviously not this
much the length, you can see it is around
two boxes, two units. You can make the
length of the grass strand this much only
around two units. You can press then to
scale it accordingly. Then you can press then
X to scale it down on the x axis like this. Let's just keep it
this much for now. And then what I will do is
selected press control, apply the scale, then press Tab press control and just
add a bunch of edge loops. You can add maybe
five. Add edge loop. You can press
control and then use your scroll wheel to
increase the number of them. Make it five. Then
hit right click to place them exactly at
the center, like this. Now what I will do is
select these two vertices, Press one verticlectelect,
these two vertices, then press M and
merge them at center. Create something like this. Now to make it a
little bit thinner, what I will do is I'll select this and select this
thing over here. This is proportional editing. I will just show you what it is. Basically, just
enable it for now, Press tab, Just select these three things,
these three vertices. Then press the X, and when you scale it
down, first enable it, Now press then X. And when you scale
it down, you can see even though you are
scaling these three things, only all of it is
being affected. And you can control it by
using your scroll wheel. If you bring the
scroll wheel down, whatever is inside this
circle, it would be affected. If you increase the
size of the circle, you can see all of these vertices still
here are being affected. If you increase the
size even more, then everything is
being affected. But if you decrease the size, the only these three
are being affected. This is really cool. What I will do is press N
X to scale it like this, and then just increase
the size of it. Yeah, this is pretty good and it is giving us
like a nice strand, like look, which I think
looks pretty cool. We don't have to do
too much with this. I think this looks fine. Now what we need to do is we need to create a grass
clump out of this. Basically we need to
duplicate it again and again, and then we can
create a grass clump, but before that, make
sure to disable this. One thing that I want to do
before actually creating a clump out of this is
go over to UV editing. Let's over here, press control, Apply the scale first, then press Tab press to
select everything. Then press U and
just hit unwrap, that it is UV
unwrapped like this. You can select it over here, Then press R and type in 180
to rotate it by 180 degrees, just it is UV unwrapped. Before we do anything disabled
proportional editing, let's scale it down and place it just like this over here. The reason I'm UV unwrapping it before is because
after we duplicate it, it would be easier for
us to wrap all of them at once because they would
be already UV unwrapped. Let's just keep it this way
and come back to layout. Now we can actually
start to duplicate it. I'll just select this
mannequin and turn it off. For now, press H to hide it. You can press Alt H
to bring it back, or you can just
tbl it from here. I'm expecting you guys to know
a bit of these shortcuts. I might gloss over them, but I will try to guide you through every step and tell every shortcut that I'm using, but sometimes I might forget. Now, I will just press three
for the right side view. Basically, when you press one, it is for front side view, seven is for top, and three
is for right side view. I will select this
grass strand that we created and press Shift
plus D to duplicate it, press Y to lock
it on the Y axis. Let's place it
somewhere around here. Obviously, it is too straight
to look like a grass. We need to rotate
it a little bit. Press Tab, let's again
enable promotional editing. Select these three, I think, and then press R, then X, and you can rotate it like this. You can maybe select
Sphere from over here. Obviously decrease the size. Let's try the first one now, press three again for
the right side view. Let's disable it first and
press whenever you like. Press three and try to
select all these vertices. You will notice that only
this side is being selected, so make sure to enable x ray. Now when you press
three and select them, you will see everything
is being selected. Yeah, just make sure
to remember that. Bring it out over
here in the front. And just try to create like a nice looking
curve out of this. Yeah, I think that
looks pretty cool. Now what we need to do is
I will select this one. Obviously this is too
straight right now. Just select this one,
Press R, then X, enable this first, we can just rotate it
just a little bit, not too much, so that it does not look
like really straight. That's okay. Now we don't
need to do anything. Select this, press shift
plus D, rotate it around. Shifters these to
duplicate things, you can just duplicate
it a couple of times and place it
around like this. Very simple, obviously. Right now it is looking
really repetitive. But what we will
do is select this, we can scale this one down, rot, make them all
various different sizes. That's why I said the
origin at the bottom point. As you can see, it is
really easy to scale them down and easily
move them around. Press R, then X, and rotate it
downwards like this. Now we can, let's
select these three. Select them all. Duplicate them. Scale them down like this. Again, duplicate them. Place them over here.
Make sure to break up the variation a
little bit already. It is starting to
look. All right, let's place one over here
again, scale it down. Make sure to press R then X. As you can see, it is
not rotating properly. But if you press X once again, then you can rotate
it like this. Whenever you press
any axis two times, let's say if I press then Y, and if I press once again,
it would be aligned. Across the rotation,
it's pretty helpful. Be sure to make them all a
little bit leaning forward. Again, I would suggest you guys to spend some time with it so that everything looks proper. The more time you spend it,
it would come out nice. But right now, I think it
is looking pretty good. We can duplicate stuff
a couple of more times. There's anything many? Yeah, I think the
size is pretty good. If you want to make it
a little bit larger, you can select them all and scale them up just a little bit. All right, so now I'm
pretty happy with it. Let's hit Safe and make sure to save our
blender file first. Totally forgot to do that. Now in the blender files folder, let's to grass and hit Save. All right, now
what we need to do is select them all like this and then press control
J to join them all together so that they are just a single object like this. Right click and shade. Smooth this and go over here
in the object data property. Then make sure to
enable or to smooth. The next step to do is go
back to the UV editing press to select
everything and we do not need to UV and
wrap it once again, just go over to UV and make sure to select average
island scale first. And then just
select Pac Islands. We will get something like this. We selected all disabled
proportional editing, press R and rotate
it by 180 degrees. Now what we need to do is we
need to make sure that all, all these bases are
parallel to each other. We need to do that because
if we don't do that when we set up like
wind in unwell engine, it can cause problems
for us because we only want the
base to stay stable. That's why we need to keep all the bases in
the single line. Only what we need to do is
it is not that difficult. You can first enable this from over here so
that they are visible. Now, just hover over
each one of them. Press L, and you can
select them easily. You can see, however,
over this one, press L and then press then
Y to lock it on the Y axis. Then hold control. Okay,
first we need to go over here and make sure to
select vertex snapping. Select vertex snapping
from over here. Now when you press then
Y, and now hold control. You can see you can snap
them both perfectly again. Press L, then press then Y, and snap it quickly. Keep on doing. Press
L and press then Y. Press L over here, then press
then Y and hold control L, Y and hold control. So quickly, finish
up this thing. All right, Now it is done. We can displace them
somewhere around here. Scale them up a little bit. Now all of the bases are
completely parallel. That is what we want it. Now we can move back to the
layout tab, and let's see. All right, now let's
select our object. And first let's
rename this to Grass. The last thing that we
probably have to do is we just need to fix the
normals of our grass. And with that, everything would
be done and we can export this to Un engine.
To fix the normals. First you need to
select your object and go into the edit mode. And Come down over here
and enable this thing, this one in the center,
middle normals, you can display all the normals. And you can see they are all facing in different directions. What we want them to
do is we just want to make them face all
upwards like this. Then it would work correctly to do that, It is pretty easy. But first what you need
to do is you need to press Tab to come out
of the edit mode. Then select your object and press control and
apply all transforms. What this will do
is it will make sure all your
transforms are applied. There is like no
rotations or anything and also the origin is exactly
at the world origin. One more thing that you need
to make sure if your grass is like place somewhere around here and it is not
at the origin. Is quickly press seven
for the top view. Try to place it just
around at the center, only like this,
somewhere around here. Then you can press control
and apply all transforms and you will see
the origin point shifts back to the center. We want it to be
at the center only because it can mess up
things in under engine. If it is, not, just make sure your grass is exactly
at the center and the origin point is also over there at the world
origin. Like this. With that, when you've
applied all the transforms, you can press Tab to
go into the edit mode. Press eight to
select everything, and then you can press all plus n. You will see this
point to Target Normals. When you select Point to
Target, you can click anywhere. It does not matter where
they are all pointing. You can see this thing that is popped up in the
bottom left corner. Just increase the Z
value to a large number. You can maybe set this 21000, that point exactly
upwards, just like this. With that, all our normals
are correct and fixed. Now, export this thing
into Unwell engine. Now to export it,
you can just select, make sure to just
select this thing only and not anything else. Go over to File Export
and select FBX. You can enable
selected objects so that only the selected
objects get exported. And make sure to select
Mesh from over here, so that only mesh type of
objects get exported and not anything else like
camera, anything else. You can just rename
this to Grass and come over to
your exports folder. And hit Export that we
are basically done. You can open up Unwell. Let's right in the
content browser and create a new folder. Will rename Grass. Open it up. Go to Add Import in your folder. You can select this
export file that we just exported from Linda
Grassfbx and hit open. Make sure to enable
import normals from over here you can open up
this advanced option. In the normal import method, import normals is selected
and not anything else. Re everything can
remain at default only just import nor grass has been imported
into under engine. You can drag and drop
it into the scene. But it would look
very weird because it does not really have any
kind of material right now. You can see we cannot
even view it properly. But don't worry,
we'll fix all that. Let's just delete it for now. Next thing to do is right click and create a new material. Let's rename this material Grass Underscore
Master Material. Basically, this will
be a master material. Yeah, I think this much is
pretty good for this video. In the next video, we'll start working on the grass
master material. Thank us watching.
I'll see the next one.
5. Creating the Grass Material: Hello. I'm welcome guys. So in this lecture, let's start working on a grass
master material. If you remember, I mentioned
that the grass will be picking up color from a
landscape using RVT's. Let's just do that now.
Double click to open up your master material and
it is really simple to do. Let's just set up
that first hit, right click and search for run time virtual texture sample. We will be using this one. Just select, if you remember we only need the base color.
Just select the base color. And plug this into the graph, master material, base color. But first what we need to
do is we need to actually select the virtual texture
over here. Now go over here. Remember now that we have
painted our landscape, you will see that it
is appearing over here in the RVD like the height. Now, we can just select this
node over here and select the virtual texture as this
base color automatically, it will pick up the color
from the landscape safe. And that is all we had to do. Obviously, this is
not the material, It is very, very basic. We will add more things to it, but for now, just to see
the colors and everything. If everything is working all
right, that is pretty good. Let's just try it
out on a grass. Select the grass. Let's right click and create a
material instance of this. So we have this grass
master material instance. Let's open up the grass
and select over here. And search for grass
material instance. This one, select it and now
disappearing over here. All right, let's close this out. And what we can do is
we can go over here, select foliage, and you can dragon drop this
grass into foliage. Select this and make sure to set the paint
density to one. Let's increase the brush size. If you just start painting
over here like this, you can see it is appearing, but it is very small
and it is like, Let's just delete this
all and what we can do is instead select this and make sure to increase the
density from over here. By increasing the density, it will appear a lot more, maybe something like 6,000
that it is a lot higher. Now when you start painting, the grass is
appearing a fair bit. It still does not
look that good. But if we closely
look at the grass, it is picking up the color from what we can
say, our landscape. It is picking the
color from landscape. Let's just undo it all. And what I will do now is now that we have
increased density. Let's just also play with
the size a little bit. Right now, they are
all of equal size. We don't want our
grass to be that way. Increase the scaling from over here for the maximum value
to something like three. Now when you paint
it, you will see the grass is of different sizes. That's much better. And
it is looking right now. If you just quickly paint
it all over like that, obviously it looks really,
really bad right now. But we will do a
couple of things that will fix it a lot more. Now that we have
painted quite a lot, clearly see that the grass
is picking up color from the landscape and our arbuties
are working perfectly. You can see wherever
we paint it dark, the dark grass is
appearing over there. And wherever we painted, the light grass is appearing, making it look pretty good. It does not look
stylized at all. And it does not
look like fluffy, But yeah, it is what
it is right now. Let's just quickly paint
it all over and then I'll show you how we can make it look a
little bit better. There is a magic
option that we can just select it and it will automatically make things
look a lot better. Let's come down over
here and let's just find a nice little angle that
we can look our grass at. You can to turn on and off game view so that you can
view everything properly. I think over here, everything
is looking pretty good. Now what you need to
do is stylized grass basically does not
have any shadows. You can just select
over here and scroll down and make sure to
disable cast shadow. As soon as you do that,
the grass looks much, much better and it looks like much more
stylized because there are not really any shadows and it's starting to
look a bit fluffy. That is what we were aiming for. It is still not perfect. We will add things like brain, some color variation, but for now it is
looking pretty good. All right, Next if you will, just quickly hover
around your scene and look over where the part, the light is hitting the grass. You can see that it is
looking very weird. And the reason for that is
because we haven't really set up the roughness and
the specular of our grass. That's why it's looking weird when light hits the
grass like this. Just to quickly fix this, let's place our scene like
this so that we can see the effect in the
grass master material. You can come over
here, hold one on a number pad or
on your keyboard, and click like this to
create two parameters, right click and convert
them to parameter. Rename this one to roughness. And this one to specular. We can set the default
value of roughness for one, and the speculator
can be at zero. Now you can connect this
one into roughness, and this one goes into specular
As soon as you hit Save, the look of the grass
should improve massively. Now you can see
that the grass is behaving much better when
the light is hitting it, and it looks really good. Now you can also close this out and open up your
material instance. And you can easily control both of these parameters from here. If you increase the roughness, nothing really happens when you decrease or
increase the roughness. I think it is not that visible, but we don't want our
grass to be reflective. So we'll just set this
to one for the specula. You will see that
if you increase the specula and the grass gets light and it does
not look natural at all, let's just keep it to zero. Now you can see the
roughness when we increase the specula and then we
play in the roughness. You can see now it
is very reflective. Obviously, we don't want that. Let's just put this to one
and this to all right, much. Our CD is coming
along pretty well. The next thing to
do is let's save over here and open up a
master material once again. Now we want to play around with the colors
a little bit more. One thing that I want to share before we
proceed is you can also create like a parameter for this run time virtual
texture like right, and search for run time sample. And you will find this run
time sample parameter. Basically, both of these nodes are basically the same thing. The only difference being
that you can change this node in the
material instance also because this
is the parameter, let's say I just plug this in, it will show a error right now, but I will select the base
color as this one save now. The only difference
is when you will open up your material instance, you can change the virtual
texture from over here. Also, this does not
work because we only have one virtual
texture and we don't really want to change
it from the parameters. But yeah, I just wanted to show you that you can add this node, the parameter one, and you can change it on the fly in
your material distance. If you have multiple
different virtual textures. Let's select,
delete this one and plug this into the
base color once again. So we want to be able to change the tip color
of the grass and we will create a gradient
to control it. Let's just do that. Hold
four and click like this. We can just delete
this and hold instead. And then click to create this parameter vector
four parameter. Let's relate to tip color. We can set something greenish yellowish for now because we can
change it later on. Okay, now we want
to mix these two. The way we can do that
is we can love them to select this and just search for linear interpolate
and plug them both in. Now basically both of these
are combined are runtime, virtual texture, and the tip
color that we have created. We can change it in
the material instance. The way we will control this
is by setting up a that will decide which parts will get this thing and which parts
will get this thing. What we can do is we will
be using a gradient. As I mentioned earlier, because grass is basically
like a strand, we need to create a
gradient in the y. Let's just use a
plane for this one. You can change the
objects from here. A plane represents a grass beta. Let's just select this and right click and search
for linear gradient. Now there are two
different gradients, U and V, that
basically are x and y. We will choose the
gradient in the y axis because we want to create
a gradient like this, because our grass strands are standing straight
up like this. To select the gradient and
plug this into a multiplier. Now press one and
create a parameter. Right click and create
a parameter over here. Let's rename this
Gradient Strength. Basically that will control
our gradient and set this to 0.3 Now I will show you just a quick little trick to
visualize your nodes better. You'll understand
way better this way. Right click select,
Start reviewing node, You will see that
here is the gradient. If you select this
gradient strength, you can control
the default value, you can increase the
decree default value, and then you can
control the gradient. Basically, this will be
our gradient strength. That's why we created a parameter so that
we can change it. In the material instance, if you said this zero,
it is completely black. And if you increase this, it
will tighten up over here. But now obviously
this gradient is flipped because it is
coming out from the top. We want it from the bottom. To do that, you select this gradient and plug
this into one minus node. Now plug this into the A, and you will see
that it is flipped. Now that is what we want it if you plug this
thing into the alpha, just right click over here
and stop reviewing this node. The thing about this is if I plug this into the base color, now you can see that we can control this gradient
by this gradient. And if I set this
to completely zero, it will have the
color of this RVT. And if I keep on
increasing this gradient, then slowly this tip color
will start to come in. As you can see, basically
this is what we wanted. You can also change this
tip color from over here, and it will show up over here. This is what I meant
with the alpha. This alpha is like controlling
what parts will show the top node and what parts
will show the bottom node. And we are controlling that
through this gradient. I hope I was clear with the explanation because it
is a little bit confusing. Let's set this to 0.3 And now plug this
into the base color. Hit Save and see how
it changes our grass. It might not look good, but we can change things in
the material instance to make them look better instantly. Our grass is like a lot yellow. And it does not look
good right away, because now everything
looks pretty much the same. But let's come to the
material instance now and try to control
the gradient strength. If you increase the
gradient strength, it will become all
yellow because now the tip color is
completely taking over. But if you decrease it and
just keep it like a low value, then we can have a
nice bit of effect. You can also change this
color to make it like a more greenish yellow that is completely
according to your taste. I think that would add a
nice bit of value this way. I think it looks much better. Now, this hit, okay, let's
set this to something like 0.2 Now if you keep
on increasing it, the tip color would
start to take over. But if you keep it
at a low value, you can see if you
set this to zero, then it is completely
like the LVT. But if you increase
it a little bit, then this tip color
would start to show up. Let us set this to point
to because I think that adds a nice bit of
color to our grass. I think it makes it better. I'm happy with it.
Let's continue. Let's go back to the
master material. We can hit save over
here. Let's see. Now the only thing that is left is we need to set up
the wind in our grass. Adding wind to the
grass is really easy. You can just hit right
okay, before adding. Another thing that we also
have to do is enable two sided on your grass
and hit Save. Everything would look
really weird when you just enable two
sided and then hit Apply or Save because all the shadows and
normals would go weird. Don't worry, we'll quickly
fix them later on. Now you can see they
look very weird, but let's just quickly fix this. Now the reason
this is causing is because we don't have anything plugged into our normal channel. That's why the normals
are all weird. Hit right click and search
for a multiplier node. For this multiplier
in the first node, right click and search
for two sided sine. And plug this in because we want our grass to be two sided, that's why we are using
this two sided sine. Another one would be hold
three on your keyboard. Click like this to create
this vector three node, basically a color node, and set the blue value to one. This color is like the base
color for the normal maps. That's why we are
using this color. Now plug this into the
normal channel and it safe. And that should fix our
grass back to its original. All right guys, Now our grass normals are
completely fixed. I think we can move on to the
final part of this lecture. That is to add some
wind to our grass, and that will give a lot
of life to our scene. Everything is pretty
good right now. And if we add the wind, grass would start to
look really nice. Let's start, open up the master material and
adding wind is pretty easy. It's not that difficult,
it's pretty straightforward. Just hit rightly and search for a node called Simple Grass Wind. We have this node
over here first. Let's hold one and click
over here to add this node. Plug this into intensity. Right click and convert
to parameter and let's rename this
as Wind Intensity. We can set the default
value to as usual 0.3 I will just duplicate this
parameter control C and V. Plug this into the wind weight. I will plug this
into the wind speed. Again, rename this
to wind speed. For the additional, I will
just put this to zero, hold one, and click over here
and plug this into zero. All right, for the last thing,
that is the wind weight. If you want, you can
directly plug in like a normal parameter into it and then plug this whole thing into the world position offset. It would work fine I think, but the main problem that
would be caused would be that the whole grass strand would start to be
affected by the wind. And we do not want
that, obviously, we only want the top part of the grass strand to be
affected by the wind. We want the bottom part to stay stable into the ground
because that is how it is. Also in real life, the
bottom part stays inside the ground while
only the top part is affected by the wind. Obviously, we need to plug something else into
the wind weight. If you remember, we did
the same thing over here. When we created this tip color, we created like a mask. Like think for the gradient. We created a gradient
on the y axis that masked out the
tip from the bottom. If you view this node,
start previewing node, you can see we have
easily masked out the ground part that
is in the black color, that will stay stable and the rest of the part that
would keep on moving. We can again, use
this setup that we used over here in
the wind weight also, let's just stop
viewing this node. Copy this whole thing up. Control C, then
control this time. Just plug this into
the wind weight. Obviously, we need to change the parameter over
here this time. This one can be wind
for the default value, we can set this
to something else because if you just
start proving this nod, you will see that
this black color is coming up over here. This area also would not be like properly
affected by the wind. What we can do is we can
increase the gradient strength because we only want the wind to not affect the ground
part of our grass. So we can maybe set, this is something like 0.9
maybe for the default value. Obviously we can change
this in the parameter, but right now we can set
this is 0.9 and hit Save. We are pretty much
done with everything. Let's stop viewing
this node and plug the result just into the
world position offset. You will see that our plane
is starting to get wobbly. You can see it is moving around. If you view this in
the sphere form, you can see that the
sphere is moving now, that means our wind has started to take place. So it's saved. Let's close this out. You can see it is
working perfectly. The wind is making our grass move and it
is looking really nice. Now, as you can see, the wind is working perfectly. If you go close to
the base over here, let's from this side, you will see that the base
stays inside the ground. It is not really
affected by the wind and only the top part
is being affected. If you remember, that's why
we did the UVs that way, when all the bases
were parallel. For this reason the
bases were parallel so that they won't be
affected by wind altogether. And we set up like gradient
like thing to mask them out. If you open up the instance now, if you decrease the
gradient strength, let's set this to zero for now. And also increase the
wind intensity and the wind speed now
increase the gradient. You will see as you increase
the gradient strength, more and more of the strand is being affected by the wind. And if it decrease, less and less parts
are being affected. If you keep it at
a very low value, only the tip is being affected. If you keep on increasing it, more and more of the
strand is being affected. If you make it even
greater than one, the whole grass is being affected and it is
moving like crazy. Obviously, we can set
this to 0.9 Yeah. Right now, the wind speed and the intensity is also very high. That's why it is
behaving this way. Let's just set them back
to default to 0.3 and 0.3 Let's play around with
them to get a nice result. When both of them are set
to the default values 0.3 the wind is really
not moving that much. We can increase it maybe
a little bit. Let's see. We can increase the intensity
to somewhere around 0.75 That is making the grass move quite
a bit for the speed, we can maybe set this 2.6 These values I found them
to be working pretty well. The grass movement is
looking very natural. It flows pretty well. You can maybe increase
the speed if you want to 0.8 and that is completely
according to your taste. You can increase it even more, increasing the intensity also
to get some crazy results, but the more you
increase the speed, it will look really unnatural. Keeping it at 0.75 and 0.6
I think looks really nice. With that, our grass
is good to go. We can hit save on our scenes. I think this is pretty
much it for this lecture. Thank you. Are watching?
I'll see the next one.