 In this step we're gonna bring in our tree and we're gonna get that all set up ready to be used with the foliage painting tool in the next step but this step's all about just getting it set up in the first place. So job number one is we are going to bring in our tree so it's currently in the foliage folder. I'm gonna put it into my geometry folder along with the other stuff so there's tree.fbx we'll just drop that in there and we need to just be a little bit careful this time because there's an additional setting that I need us to look at. So I think by default our import box looks like this. It's not a skeletal mesh and this time we don't want to auto-generate collision because the file we're using has a collision mesh that I created there so it's got a custom collision which we want. So turn that off and then we're gonna show advanced and we're looking for import mesh LODs so make sure you tick that box because that's gonna bring in LODs and we'll get into what those are a little bit further in this video but they're cool so we want them. Okay and everything else that we can leave alone so we'll click on import. Okay so there we've got that finished importing you might notice that importing this one takes a little bit longer than the previous ones and that's because in this case it's actually importing five separate meshes instead of just one so it imports that all into the one tree. So there it is so I'll open this up and there's quite a few things going on but we can see that we're gonna need to build three materials and you can see I've got a typo in there that says tree for taunt so I'm just gonna change that to tree front. Okay so we're gonna need to build three materials so before we can do that we need to bring in those textures so let's go to our textures folder and we're bringing all the all the textures that relate to the tree so we've got two for the bark two for the branches and there's this one that's called tree front as well which is actually for our billboard tree which we'll get into a little bit later but we need those five textures so let's drop those in super right they're all done so now we can set about building our materials and getting this all ready to go so we're going to go into our materials folder and let's just have a look at the tree I'm probably just going to build them in order so we'll do the tree bark first so let's right click new material we're gonna call this one M underscore bark seems like a good name let's open that up okay and we're gonna need a couple of texture samples for this so I'm gonna hold here my keyboard left click twice one two and this first one if I just search over here for bark we're gonna be using bark diffuse and the second one search for bark again I'm going to be using bark normal and they're going to be plugged into their respective inputs there we go very nice very nice okay we also need to get the roughness under control so we're gonna use a constant for that and I'm gonna go 0.9 on that because barks pretty rough plug that in okay and we'll call that one done that's the bark material done so let's save that and now that we've got it made we'll just come back into here and we'll assign it to the tree we'll do these one at a time so let's have a look here so we're searching for bark M underscore bark let's assign that and you can see that's now put the trunk in that's good okay so the next one's gonna be the tree branch so let's make another new material where are we material lovely okay I'm gonna call this one M underscore branch let's open that up and this one as the materials really gonna resemble what we did with the grass so we need to get that set up and quite quickly so let's have two texture samples again this first one is going to be the diffuse and the next one is going to be the normal if I spell it properly I'm going to get those plugged in but what we also need to do I know that this one you can see the texture here looks a lot like it did with the grass there's the background is not cut off so we need to use the mask but at the moment we can't get at the opacity mask so we're going to click on the main material node we're going to change the blend mode from opaque to masked we're gonna set the shading model to two-sided foliage would make sense and in this case we will have it be two-sided okay so that's all set up now what we need to do is plug in the opacity mask we're also going to plug in the diffuse into the subsurface color that's the one that makes it like lights kind of passing through through a little bit so I'm happy with that we're gonna need a roughness on this as well so let's get a constant in there if you want to at a later date you could promote this to a variable and you could edit that in an instance but let's just go for 0.7 I think okay that'll pretty much do it for that and then what we need to do is get a little bit of wind going on to this as well so we need to create this simple grass wind node so just right-click and type simple there's the simple grass wind lovely okay I'm gonna need a few constants one two three so this zero here is going to go into additional world position offset and then these are going to go into the respective ones wind intensity and wind weight so I'm gonna set both these to 0.4 because I quite like that number and again if you want to make these parameters and create an instance of this material you can just right click on these constants and convert to parameter I'm not going to do that in this one because I want to be quite quick with it so there's no vertex color on these branches either so instead of going through that like we did on the grass I'm just gonna pull that straight into world position offset and that will give us our wind so I think that's gonna be enough to get us going on this we might come back and tweak it if we need to but for now that should do it so let's save that okay so we're gonna add that material just here so let's drop that down I'm gonna search for branch which I think we called it yep m underscore branch and there you go they start whippening away so the strength might be a little bit high so I might come in and just drop that down later but that's okay for now and then the last thing we need to do is this tree front material and I'll show you what that is if I zoom out a little bit on this go a bit further this is our billboard tree and this is gonna appear when the trees in the distance and all it is is two flat planes that kind of intersect and that really saves on the polygon count but that's got a separate texture that looks like the outline of the tree just there to create a silhouette really but we need to create that material as well so let's get that one sorted so let's have a new material when the colors one M underscore tree front okay well open it up and this one is also one of the foliage ones that needs to be masked so let's change it to a masked material it's going to be two sided foliage but we don't need to hit the box for two sided because of the way I've created this LOD it's actually two sided anyway so we're gonna need just the one texture sample in here and this is just gonna be tree front there it is so I've got that and we also need to plug that into our opacity mask just in case it matters I will plug it into the subsurface color as well but it shouldn't really be that important and I'm gonna create a constant which is gonna be set to one which is max and that's gonna go into both specular and roughness and that's just to stop this being too glossy when the Sun hits it okay and that should do it for that so let's save that as well okay smashing right so what I'll do now is I'll just close these windows so the editors and crash on me again and we're going to add this tree front material just in here tree front when that loads and you can see now we get like a really simple sort of impression of the tree when we zoom out so at this stage I want to talk to you about LODs so if you're looking this top corner here you can see I'm currently looking at LOD 3 and there are currently only eight triangles in total on this entire tree that we're looking at as we move in a little bit it moves up to LOD 2 and there are now just over 2,000 triangles in the tree and you can see that it starts waving and it's got a shadow if we zoom out oh it's got a shadow on all of them okay if we zoom a little bit further LOD 1 that's now gone up to nearly 5,000 triangles and it's got a bit closer and then if we get all the way up close that's LOD 0 and that's 17 and a half thousand triangles so what LODs are all about is based on the the distance from the camera or the screen size that the asset takes up and it will swap between different versions of your model and the further way is it'll choose a more simplistic version that's easier to render so you can show more things on screen at once without using too many system resources but what we need to do is change that up a little bit so that it's not too jarring when you see it so let's just save this tree for now we'll drop one into our level and then we'll fine-tune the LOD distances so that it's not too obvious when these are swapping over because the last thing you want is these popping and being really noticeable so let's just go where are we so I want to put a tree just about here I think so let's go into our geometry folder I'm just gonna drag a tree I'm just gonna plop it next to the the cabin okay and then what I want to do is get a feel for when this is changing so if I just zoom back a little bit you can see now that is too obvious that's really noticeable because it's happening when it's too close to the camera if you're looking for it will always be noticeable but we want to make it so that the player is not going to instantly say oh the tree just changes it's weird so let's go back into our tree static measure editor and we're going to have a look down here and the thing that we are looking for is this tick box here auto compute LOD distance at the moment unreal has just decided what distance it's going to do it out but we're going to tell it what distance so I'm going to deselect that box and you'll see that now these grayed-out boxes here become available so what I'm going to do is just in this viewport I'm going to zoom out and when I think the trees are good size that I might not be able to see the difference so about there I think is nice and small we can get a value from here current screen size so it's what set to 0.096 whatever so I'm going to set that in my LOD 3 to 0.1 I think should be fine and now as I zoom in and out you can see that's changing just here which is a lot further out which is much better so that's good right when we're up close I want to drop away from this 17,000 one quite quickly I want to do that quite aggressively which is actually that's quite good I like that distance already and I'm going to give the 4,000 tree a little bit longer I think so let's have a look so the 2001 can come in at about 0.3 I think the moment's coming at 0.5 so let's do 0.3 and then we'll just see how that looks not too noticeable you can see the difference is happening but it's not too noticeable okay there's one more thing that I might want to look at and that's as it gets further away from the camera we can save on resources by turning the shadows off as well so when it says absolute furthest away I'm going to kill the shadow so you can see the shadows here and as I zoom out as it goes to LOD 3 that shadow disappears and the idea of that should be that the trees are so far away we don't want all the extra calculations going on to get the shadow for the tree because it's just there to create the silhouette and our landscape really so we'll leave that there right so that's our tree setup so let's just save that I'm going to go back into my level and I'm just going to have a little run around and see if this tree looks okay so at the moment as I'm moving out it's not too obvious when the changes are happening I think the most obvious one glitch a little bit is going to be when it changes to the billboard which is just there they can see you see that that changes snapping there but I think that's far enough out when we've got a level full of trees I don't think we're going to see that or by the time we've changed all the lighting and you've got gameplay going on that wouldn't be very noticeable at all so I'm happy with that but you can always fine-tune it later so let's just get back over here where where all the magic's happening okay so that is it for this step so we've got our tree in the level is set up all our materials work we've got a little bit of wind blowing we've got flappy flappy branches and we're ready to paint this into our level with the foliage tool in the next video so very much hope I will see you in the next video for that 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 look 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