 Okay, so in this step what we're going to be doing is setting about getting some foliage into the scene. So to do that in this video we'll be spending most of the time setting up the material that we're going to place on our grass because it's probably the most complicated material that we'll have in this entire sort of tutorial. So we do need to spend a bit of time on it, there's quite a lot going on. But before we can do any of that we need to get in the assets that we need. So there's some geometry for this. Okay, so let's just open up the folder. Okay, so the geometry is called grassclump.fbx. So we're going to drop that into our geometry folder. Okay, and the same sort of things we'll apply. We don't need any collision on this one because we want to be able to run through this because it's grass and if you bumped into a bit of grass it wouldn't be a fun game to play. And everything else can stay at the default import options there. So we'll import that, so that's our grassclump and then we've got a couple of texture files that we need to bring in for this as well and it's just this grassclump diffuse grassclump no we're just going to use those two. So we'll bring those into our textures folder and as always if you want to use the same assets that I'm using follow the link in the description and you'll get instructions on how to do that otherwise you can create your own or you can find your own assets elsewhere that's fine. Okay, so let's have a look at what we've brought in. So in the geometry folder this is our grassclump and grass in games has to be really efficient. So you don't work with individual blades of grass, you have these sort of planes here. You see they're one sided so they are on a shot when you're looking at them in certain directions but we'll make them two sided using the material later. So this is pretty much what it looks like. So you can see I've made it out of four planes, I think there's one here. One going up and down, there's one there and one there so they're all going in slightly different directions. Okay, so that's what I saw at the moment this has just got the world good material on there. There's not a lot going on with it really but we'll just move that over because I want to be able to come back to this to see what effect the grass is having on it before we start painting in the scene when we get the material in there. So what we then need to do is we're going to go into our materials folder and we are going to create a new material. I'm going to call this one M underscore grass master and the reason I've added the master to this is because this is going to be an instance material. So this is going to be like the master will hold all of our different settings and help the instance that we applied to everything. So let's open this up, here we are. So first thing we're going to do is just move the main node over there because we want the space available and we're actually going to change a few settings in the details so we've not done this for any of the previous materials but we want this one to behave differently because this has got an opacity mask on it. So we're going to be applying a flat image to our grass but we want the outline to kind of or the digital image around the outline to disappear so we're going to use an opacity mask but you can see opacity mask is not available to us. So we need to jump into here and make it available to us so the blend mode is set to opaque and we're going to change that to masked and that opens up opacity mask to us, lovely. We're also going to change the shading model from default lit to two sided foliage which will make our foliage two sided and behave like foliage so we'll turn that on. You'll also see that opens up a few other options on this main material node here. We do want it to be two sided, we'll give that a tick and I believe that's everything we need to change on here right now, yep that looks good. So now we need to bring in the textures and do some other crazy material magic to make this look super sexy. So anyway the first thing is two texture samples so I'm holding T and left click in, okay so this first one is going to be our grass clump diffuse, there it is and this one here is going to be our grass clump normal, there that one is too. So we're going to plug these in for now but we're actually going to bring in other nodes and disconnect them anyway as we go but I just want to know where I am at the moment so I'm going to plug that into base color and normal goes into normal, so far so good. Okay so now what I want to do is kind of finish working on the base color so what I want to be able to do is to be able to change the color of the grass in the instance and I'm going to do that by creating another node that I can add a color and multiply that with the texture sample that I brought in so to do that what I'm going to do is create a vector parameter, well that says vector that's not right, so this vector parameter here is the one I want and I'm going to call this tint because I will use it to tint the color, okay so far so good so I'm just going to bring that up there I think for now and what I'm also going to do is set the default color of this to white so I'm just going to drag that bad boy up there otherwise I'll have too much of an impact on on the grass to start with and then I want a multiply node so I'm going to hold M and left click to create that node so I want my tint to go into A it doesn't really matter which way around I do these I'm just doing them based on what order they are appearing I'm going to put the texture sample into B and then the result of that is going to go into base color, lovely so that's that happening but if you look at this it doesn't look right at the moment the alpha channel isn't doing anything and we need it to be doing something to get the outline going on and the way that I've built this texture is that there's an alpha channel on it that's what this output here represents so just to get us going if we take this output here and put it into the opacity mask when this updates you'll see that we now get an outline on the grass which is really polygon saving magic there you go look at that beauty so that's good we're now making some progress okay the next thing I want to do is get some parameters in for the specular and the roughness so I can change those in the instance later so we're going to have a couple of scalar parameters so I'll have one here that's going to go into the specular and we're going to name this specular specule R yeah that's good good spelling chain and we're also going to have another scalar and this little chap is going to go into the roughness and I'm going to call it roughness there we go so now I'll be able to change those and get them how I like in my material instance okay the next thing I'm going to set up is this subsurface color and what this does is it sort of represents like the way that light can pass through foliage so if you think about leaves on the tree some light will pass through it and the subsurface color is all about that what we're going to do is we are going to use our original color here plus the tint so we're going to come out of this multiply and we're going to multiply it by a number so we can change the strength of the subsurface so to do that we'll get a multiply going on down here multiply that's how you spell multiply oh dear okay so I know that the result of that's going into subsurface color okay I want another scalar and this scalar is going to plug into B of this multiply and I'm going to call this one subsurface strength and again that's something that I will be able to change in my instance which I want and so what I'll do is I'll get another copy of this color that's going to be mixed up here and that's going to go into a so based on what I'm saying is I want this color and I want the the option to be able to make it stronger if I want to and the reason I want that option in there is because the subsurface color is weak it'll be quite dark by default and we're really going to need to give it some more strength otherwise it looks weird okay so that's subsurface strength I'm happy with that the next thing I want to set up is based on the culling distance of the grass when we put it in there so I've just had a little play around with this I've rehearsed this step before I put it into the tutorial and in 414 which is the version before the one I'm using and the grass when you change the culling distance would fade in and that doesn't happen by default anymore it just pops in in big blocks it's really ugly and Epic have changed the way that the engine works so we need to add a new node into the material to enable that to happen which will do now and the node is called so we do a right click here it's called a per instance fade amount there it is and it comes in in this beautiful red thing and all we need to do is multiply it by this alpha channel here to get it to work so I'm going to put in another multiply there it is so this fade amount is going to go into B the alpha channel is going to go into A and then the result is going to plug into our opacity mask so we're bypassing the connection we already have we're just replacing it like that so that means that at whatever distance we set for the culling distance of the grass it will fade in nice and gradually per instance rather than just throwing in like 50 grass clumps at once and it won't be as jarring so that's that set up I'm happy with that and the last thing I'm going to do is try and comment this up a little bit so that I know what's what so my specular and roughness are already labeled I don't need to do that but these two here are to do with my subsurface strength so just so that I can identify those and my color is this yeah these three nodes here so I'm going to comment those as base color and yes I'm definitely using the UK spelling of color the per instance fade amount I'm not going to comment that I'm not going to comment normal so just those two there with kind of the complicated ones I think okay and that will do it for now now we are going to knit back into this material in a minute to add the effective wind but I want to show you what the grass looks like with and without so at the moment what we need to do is save this super now that that's saved we can assign it to our grass clump so what do we call it grass grass master there it is so this is now what the grass looks like when we apply that material so it's not bad I'll be honest with you this is some grass that I made extremely quickly and I'm not massively proud of it but it will do a job so at the moment because we haven't changed anything on the subsurface color that's what this horrible dark backside of it looks like but when we change those values they look much brighter and it'll look really good so this is what it looks like by default what I want to do now is get some wind kind of just tickling the tops of this so we're going to go back into the material to enable that okay we're just going to build that part of the material in some space down here so the main node that we're going to use for this one we'll just right click it's called a simple grass wind it's just that one there at the bottom here it is and we're going to need to set up some parameters to plug into this so we're going to need a few scalers so one there we'll have another scaler on there I'm just going to plug them into these top two on the simple grass wind node and we're going to name them whatever we've plugged them into so that we can change them in the instance when we want to so it can make the grass weaker or stronger actually in the level in the editor itself so that's quite nifty so this one's going to be called wind intensity yep very good my spell back correctly no in in tessnity behave ten city whoo no typos okay and this one is going to be called wind weight beautiful okay I'm just going to put a constant of zero into the additional WPL which is well positioned offset and then what we need to do is we could plug the result into this world position offset and I want to show you what this looks like now and then we're going to control the wind a little bit more so that's just by default we're going to set the default value of these two three let's say and you should then see that this starts waving around going all crazy so that will do for now and we're just going to save this and then we'll check out what it looks like on our geometry to see what the wind's doing okay so let's move over right you could argue the winds a little bit strong so we need to rain that in just a touch okay so what I've done is I've typed in zero point five as the default value for these two so we'll save that and see if that looks less crazy on the geometry because that was not what we were going for okay so that's done saving let's see if that looks a bit better yes it does okay so you can see that this is now sort of tickling the grass it looks kind of nice but what I don't like is it's happening too much at the bottom and we kind of want the bottom to stay still because that's connected to the ground isn't it shouldn't be wobbling around really so what we're going to do is we're going to multiply this by some vertex color that I did in the actual mesh editor so in Maya what I did is I painted a vertex color on the bottom of this mesh of black so it's black at the bottom and it's red at the top and what we're going to do is multiply the result of the wind by the vertex color red so what we're saying is that whenever you see red make the effect of the wind stronger if you don't see any red at all which is the black at the bottom don't do anything so let's set that up so we're going to create a vertex color which is this guy here I'll just put that there and we're going to multiply the result of our wind by vertex color red as I said I've set this up to work on the red vertex color channel so we're going to put that into there and then we'll plug the result of that into the world position offset so we're going to hit save on that and when that's done we're going to go back into grass clump and then the bottom of that that grass will stay put okay so let's see if I've been successful so into grass clump yeah so you see now the bottom of this stays put beautiful right so that's pretty much the material built looks nice doesn't it we've done really well there so we can now think about getting our grass put into the level ready for painting around the scene using the foliage tool which is going to be fun I think it's fun okay so let's get this set up right so the last thing we need to do is create a material instance of our grass master material so let's right click on this create material instance and it's going to be called M grass we'll get rid of master and we're just going to leave in instance m grass underscore instance good we're now going to go back into our clumpy clumpy grass and we're going to change that so from grass master to grass instance which is good so we'll save that and what we're now going to do is we'll open this instance so we can see it although maybe not that big so now we can see all the parameters that we've set up and I'm also going to drop just one piece of this grass into the level so we can see what we can do with it so I'm just going to come sort of over here so we can see it against the other the background of the other grass if you will so let's go to geometry here's our grassy clump I'm going to drop that in like so and I'm just going to deselect it by pressing escape in fact let me just click on it press F so this is now the focus of our scene so you can see at the moment there's all kind of horrible blackness going on on one side of it which I don't like so we are going to need to do some stuff to make this look better before I do though because earlier in this series in this tutorial when I started messing with an instance it kept crashing so to save me some heartache I'm going to click on save all before I do that and then if it does crash at least I can reopen it and I won't be as angry okay so here we go let's play with some of our some of the things that we change so the first thing I'm going to want to do is change the subsurface strength and I think four worked for me quite well earlier there we go so that's nice what it's also got going on at the moment in this one is shadowing which will turn off later but it's okay for now okay the roughness and the specular I want both to be set to one okay I think I'm happy with the wind for now and the last thing that I'm going to show you is if we want to we can use the tint to try and match the color of the grass to the grass below it so it doesn't stand out as much so we can click on this bit here and as you see as I drag this around it kind of changes the color so I can desaturate it a little bit if I want to take it towards the the browny red scale if I want as long as I don't go too far with it it'll come out pretty nice and just kind of brownify it a little bit if if brownify is a word of course so we can mess around with all that so that that's pretty nice I'm happy with that we'll go to okay and we need to save that just for now lovely okay so what we're gonna worry about next is painting this using the foliage tool all around our level so it will really start to fill this up it'll start to look ace so join me in the next step to fill your level up with grass I will see you there thanks for watching if you really want to take your learning further than I can cover in this series then I highly recommend checking out plural site they have loads of really detailed video courses covering game art and game development using Unreal Engine 4 when I learned how to use Unreal a couple of years ago this is where I went and I log in regularly to take a new course and improve my skills I recommend checking out the introduction to Unreal Engine 4 course by Joshua Kinney this is really good and offers a good overview of what you can do in Unreal you can get a free 10-day trial by using my link in the video description and you get full access to all of their courses for that time at the end of your 10 days you can either subscribe for more or cancel totally up to you it's got to be worth a free trial though right I'd like to say a massive thank you to my patrons your support helps me to keep making videos like this one and I really appreciate each and every one of you it really blows my mind that people will support my channel and my work by pledging their money through patreon so again thank you all so so much if you aren't already a patron and you'd like to offer your support then please go to patreon.com forward slash Shane Whittington