How to INSTANTLY TEXTURE your landscapes in UE4 - Unreal Engine tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this tutorial we will create a material that will in seconds turn our landscapes from looking like this to this and the reason why this looks so much more realistic is because in real life landscapes change materials depending on slope so if we have a sharp falloff we won't get grass instead we'll probably get a dirty or rocky cliff-like material and that's exactly what we're going to do in this tutorial important to know that this is part two in a series on how to create photorealistic landscapes so if you haven't seen part one yet i would highly recommend it since we go over how to hide those nasty texture repetition and we're gonna be building on top of the material we created in that tutorial also if you just want the final material you can download it right now link in the description below for free so with all that being said let's create that material here we are back in the material and you've noticed i made some changes the most obvious one is that i added a new material down here called rough rock wall i believe it's called on mega scans and this will just act as my cliff texture i've also gone ahead and added a distance blend technique to both of these materials right here so the exact same way we did in part one basically it's just a way to hide our text repetition by scaling or increasing the texture size depending on how far away we are from the landscape i've also added some color tints and in the material instance i went through and just darkened that grass because i found it was a bit too bright and i added an extra multiply parameter right here to control the amount of dry grass and you can see that this cliff material is right now plugged into my layer blend so the actual layers of my landscape are just two right now i have grass and i have cliff okay first off gross my material nodes are getting way too large i mean look at how far below all of this is so if i want to make any adjustments if we want to blend all these materials together it's going to be pretty hard now we can solve this by turning these materials into notes and i'm going to first demonstrate that with all of these materials right here so i'm going to go all of these select them and control x and now i'm going to go right click here go to materials and textures and then go to material function i'm going to call this mf underscore grass double click it here ctrl v to paste in all my notes and connect it up to the result apply and now i can drag this node that we just created into my material so all those nodes that took up this entire space are now contained within this small little thing and plug that into a layer blend so i'm going to do the exact same thing for my cliff right here and yeah i'd say my material is a lot more manageable right now and just a lot nicer so material functions are just that they're little containers that you can put a bunch of nodes in and whenever they're highlighted with blue right here we can double click and go into that material function within distance blend down here you can see that this is a material function so unreal comes with a bunch of material functions by default and we can actually go into this one by double clicking on it and we can see what's actually happening don't play with any of the nodes that are by epic games like they're there for a reason okay two things i forgot to mention and that is all my parameters are now in groups so if i click on any of these parameters we can see that under material expression i have group and that's at the grass i can create a new group by just highlighting it delete it i'm gonna call this new group and now if i hit apply and the best way to see this is actually go into my material instance right now and since this node is actually within this material i also have to hit apply in this material i've already done that and if i go to mount it alone go into my material instance we can see that our material instance is organized by their groups and if we go down here we can see that we have a new group so that's what i like to do on all my parameters just give them a group that's how i can quickly go through my material instance and find where that exact parameter is i want to change because with the landscape materials they can get pretty complicated pretty fast and finally do not i repeat do not forget to do this on any of your landscape materials you want to set all your textures to sampler source shared wrap so set them all to that because if you don't and if you paint a lot of materials in one section it just will stop compiling and unreal will not tell you what's happening so when i was first starting out on unreal i remember getting stuck on that for like half a day and then i went through all my textures set them to should wrap and then it started compiling correctly so do not forget to do that okay so now let's go over how we can actually isolate our slopes and to do so i'm going to use a world align blend function and i'm going to set up a parameter for bias and sharpness so i found a value of 30 for slope sharpness and a value of negative 12 for slope bias to be pretty good default starting numbers so now i'm going to go plug up this function to my base color that's so we can actually see what this is doing so i'm going to drag out from the alpha go to base color hit apply okay so immediately we knows our function is doing a really good job at just isolating those really sharp sloped angles but we will also notice is that the transition between the different values are pretty splotchy that's actually because it's taking into account the normals of my grass so if we zoom in we can see some grass strains now if we don't want that if we want a smooth transition i go back in my landscape and we can use the explicit normal output and plug it into base color hit apply and now we get a more traditional blend of the two values where if we zoom in we can see that there's a slight fall off between the two and the normals are not being taken account so i will use this function now to drive where my grass where my cliff is being placed so i'm going to select all these drag them into here get rid of with explicit normal and also hook up my multiply base color that'd be bad if i forgot that and to blend them of course we're going to use a blend material attributes node i'm going to hook up the grass into b cliff in an a and with explicit normal into alpha now just for test purposes i will hook this up to grass to see if we're getting anything hit apply and immediately we'll notice that it's going into effect so all the really sharp slopes where you would normally expect there to be cliff there is cliff and then there's grass where there's a flatter area so we get nice flat planes and then we also get a good transition into rocky cliffs which is pretty realistic and remember this is using with explicit normals if we were to drag alpha in here we would get an error that our landscape isn't compiling correctly and i'll go over a way where we can bypass that and actually use the normals to blend the two materials together but for now i'm going to stick with explicit normals and i'm going to create a new layer and i'm going to call this auto and plug this one in there and plug grass back into the grass layer hit apply and hit shift 2 to go into my landscape mode going to paint and sometimes we don't see our new material there that's fine what i'm going to do is save all go into my landscape and unapply this landscape and then reapply the landscape material instance so now if i go into landscape mode we can see that i get my auto material right there and our preview is showing that it's working correctly so i'm just going to create a layer for this so wait blend normal hit okay and instead of going through everything and just painting everything i'm going to go right click on grass and clear that layer and then i'm going to right click on auto and go fill layer okay nice so our auto material is working right now and we also have the ability to switch between grass and cliffs so let's say if we have cliff in an area we don't want to i could just go to grass and paint that out likewise i can go to cliff and manually add in clips if i need to just to better fine-tune my landscape okay so at this point we could pretty much call it done if i open up my material instance docket right here we have the ability to even control where that angle starts so you can make that angle a lot larger so less clips or more cliffs so i'm gonna get rid of that but there's just one issue that if we zoom in i think it's fine right now but what if you don't want this really soft transition between the cliffs and the grass and you want the normals of both of these textures to drive where that transition is well we can go back to mr square landscape and we can use alpha but as we just saw it gives us an error so we're gonna have to do some fiddling right now to get the alpha working we can give ourselves the ability to blend materials with an alpha by using a matte layer blend standard right there but they're just one issue and that i want to plug in both the explicit and the alpha so i want the alpha to affect all the channels but this one to only affect the normal so i'm going to have to edit this function so i'm going to double click in here and this function might look complicated was actually pretty simple it's basically just two materials having all those channels lerp together and all of their alphas are being connected to this alpha input you don't want to edit engine materials so what we're going to do instead is copy this material and create our own then we're going to edit it so i'm going to go to browse find where that is ctrl c go to where my materials are control v right click rename because this my blend go into it and now here i'm going to go duplicate this alpha i'm going to call this alpha underscore normal and have this affect the normal map so find where my normal is it's right here drag this in and switch it from alpha to alpha normal hit apply drag my new material function that i just created into landscape here you're going away then drag alpha into alpha and explicit normal into alpha normal and then i'm going to use the same setup right here so we use grass at the bottom layer cliff as the top as the base and then we drag this into layer auto compile okay and we can hop back into our level and everything is looking a lot more realistic if we go in we can actually see that the transition isn't just a smooth fall off it's actually using the normals so some of the grass is blending over into the cliff and yeah you wouldn't just expect there to be a sharp fall off and then no grass you'd expect there to be some graphs still growing on the cliffs so i think in this instance it made our scene a lot more realistic so for some scenes i want a normal blend but for other scenes i don't want normal blend so i'm going to give myself the option within my master landscape so i'm going to right click let's go static switch parameter and i'm going to call this one is normal blend so if this is true we're going to use this one if it's false we're going to use our traditional one and let's move everything back and then if we connect this up right here go back into our scene so now if i go into my landscape instance scroll down we can see that we have a boolean that if i turn on we can get some of that nice normal blending and then if i turn it off we can get the traditional fall off blending so it's a good mix to actually see on each of your landscapes which one would fit it better so maybe you want the blend maybe you don't right here is a good example of when you would want the normal map blend so i'm in the arctic scene that comes included within the downloadable content and if you look right here yeah this isn't really looking too nice and we can visibly see the fall off and where the vertices are so if i activate my use normal blend instantly i mean like automatically our landscape is looking like five times better and we can actually see some nice transitions and even if we look at the distance this is before this is after it just adds some nice variation to that transition and right now i would say we are pretty much done now one thing you could do and i did do this on the actual landscape that you can download right now is add in another blend with a third material that goes in between the clip and the grass so maybe like a dirt material that's how it goes from grass to dirt and then the cliff i think at this point i might as well show you how to do that so here is the downloadable material and you can see i have a new world aligned blend and i'm calling all these parameters extra and i have three materials mf underscore a is my cliff b is my grass and c is actually my dirt and you can also see that i added a parameter to control whether or not i want to add that dirt into my slope lens so i'm not going to go through how you do it because it's pretty much just plugging in and doing all the normal math and if you really want you could just go into the material and control c all this and control v this into your own material so go ahead and do that and that's how you make it auto landscape material if you got something out of this video make sure you like and subscribe also stay tuned for the next video in this series where we will go over specular values and erosion which is a pretty big deal when it comes to landscapes also make sure you check out my other videos and goodbye you
Info
Channel: Unreal Sensei
Views: 84,502
Rating: undefined out of 5
Keywords: landscapes, auto material, photorealism, unreal engine, unreal, tutorial
Id: mP8eHwVEA0o
Channel Id: undefined
Length: 15min 56sec (956 seconds)
Published: Fri Aug 07 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.