Unreal Engine Landscape Master Material Tutorial - UE4 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
alrighty in this tutorial we will go over how you can use the unreal sensei auto landscape material how to customize it and use all of its features in detail that's how you don't feel lost when you're using this auto material because i feel like this is the biggest issue with landscape materials that i've noticed in the unreal engine community is that they're very confusing they're organizing weird ways where only the original creator of the material would know how to edit it and that wasn't the point of this material the pointless material was to make it customizable that's how you can copy and paste it or even create your own material built off of this one so i hope you enjoy this tutorial we will go over all all of the features and in case you don't know unreal engine 5 is coming out soon i think it's important to keep up to date in the world of unreal engine which is why i created a weekly newsletter the unreal sensei newsletter so i hope you can subscribe link in the description below and stay up to date in the world of unreal engine 5. now without further ado let's jump into it this is what you should see when you open up the auto landscape project please please please make sure you unzip the project before you open it if you don't unzip the project then all you see is black right here and all the folders will be gone so i've had so many people complain saying that the project is empty that's just because they didn't unzip it so first off i just want to like make it clear that i'm not lying when i say that there's a one-click solution to hiding texture repetition if we look down right now we'll notice that hey there is no texture repetition on the grass and we can bring that back so i'm going to click on the grass and let's go open up our example landscape right here and down here since i know grasses be underscore material we have you cell bombing if i unclick you cell block bombing we will see that we bring back that text repetition this is what it was before and with just literally one click no setup that texture repetition is completely gone and if you don't like how it looks right now you can change the cell scale and see what the best option is i'm going to reset that real quick so basically what texture cell bombing does very very quickly is if we open up this texture that's using basically each cell will offset the texture just a little bit so each cell will kind of move the texture around which helps randomize our textures and this works great for natural assets like dirt grass clips but this doesn't really work for like synthetic textures like brick or or wood boarding so make sure you only use this for your landscapes and if we look through all of the different materials that we can add to our material landscape we can see that they all have the option at the end to use cell bomb so you can use cell bombs with all of these ah there's just one downside to using cell bomb and that is if we go to lit optimization shader complexity and then if i turn off the cell bombs right now so let me go turn off the cell bomb for a and then the cell bomb for b material a and b so the more cell bombs you use then the worst performance you'll get out of the shader but i think it's worth it because of how great it is so i'm going to turn on cell bombs again now it is time to briefly go over how this material is organized and what all the different parameters can do so we'll just go through all of these like a very high level how to get started and then we'll go over the nitty gritty of how the material is actually created now when we have if i collapse all of these right here real quickly we can see that we have a material b material c material d material and e material you can think of each of these material as a material within a material so the a material should if you want to use the auto landscaping features is basically your cliff material so these materials are the really sharp angles you see on the mountain right here and the next one is we go down here the b material this is basically your grass this is your flat land and the next one is optional c material which would basically be your dirt so you so it's like the in between if you want if you don't want to like sharp transition between grass and cliff you can add another material in here and we'll notice with all these materials they have the exact same parameters so for material a it has color tint a color multiplier a and if we go down to b it also has tint and multiplayer multiplier so we have the same parameters for each one that's how you don't so it might look more complicated than it actually is now we're going to go down all the different parameters so of course you need to specify your color you have color a normal and roughness this works great and it's specifically made for your mega scans so you just drop it in there also if you really want to use it you can click on use mask here click right here and let's say if you have a mask material which is basically red is metallic green is roughness and b is ambient occlusion then you can add it in right here but for all of these and qixel doesn't organize it this way i just have these turned off for now but there is an option if you do use masks like that and below that we have our color tint very self-explanatory we can tint and add just some slight variation so if you don't like the way so if you thought beforehand that the cliff was too orangey now it's a lot more grayer now it's a lot more rocky so it's just some way to like quickly make some edits without having to make the edits in photoshop or substance below that we have color multiplayer multiplier this will basically bring in you can increase the brightness or decrease the brightness you decide that's all it does roughness multiplier which will basically increase the roughness or decrease the roughness i tend to keep everything pretty rough for my landscapes below that is normal intensity it does what you think it increases the normal let's go two very sharp zero no normal i have it at 0.5 right now below that is tiling far and tiling near so basically actually let's go demonstrate this with the grass we can see that the grass texture right here is you know it's pretty big but then when it go down it transitions right here's the transition so the grass texture gets even smaller for gameplay so that's how in the far distance you have larger textures for more detail but when you get up close it transitions back and the texture grows smaller so that's what tiling far entirely near does this is also an option if we go down here to distance fade we can uncheck this and now we no longer have any transition it's just always the near one and we lose the tiling far parameter that was right here so i'm gonna go bring back distance fade and of course we can change this so let's go change the tiling far we can make this 0.001 we can make this larger or we can make this smaller like 0.2 i'm just going to keep at 0.025 for now and below that we have specular from color so if we zoom right here and i had i made an entire video explaining why we use specular for landscapes if you want to check it out i believe it's in the top right corner right here so feel free to look at it if you want a more in-depth explanation but basically if we uncheck specular from color this looks gross this is fake it looks like plastic and when we add in specular artificially that gets rid of that plasticky look and then we have a multiplayer right here to also fine tune the amount of specular we want and i tend to keep it at something low like something below 0.5 often has some really great effect or you could just do zero and i have no specular but i just like to keep it just a little bit of specular and what spectrophone color is doing is that it's just grabbing the red channel from color to just add a little bit of specular variation while we bring that down to near zero so yeah those are pretty much all of the main parameters of our materials that we have we have how many materials we have one two three four and five different materials that you can add and you can paint onto your landscape and we'll go over painting in just a bit and below all these materials we have material underscore cell bombing which is as already said is that amazing feature that automatically gets rid of that nasty pattern without having to do anything fancy which is great now the cliff material has something very special on it and that is try planar projection because oftentimes let's go up to a we see a underscore material underscore projection we get some texture stretching on landscapes especially at very sharp angles like here so what this does is it just reprojects the texture on the sharp angles that's how we don't get that nasty texture stretching and i think let's go see if there's anywhere where we can demonstrate this so i'm gonna go turn off use try planar projection let's see okay so let's turn on off on off on so you can see it's making a slight difference i think right here it's most noticeable so let's actually go into unlit so this is with it on and this is with it off so as you as you can see when it's off that's some very nasty stretching there's nasty stretching going up and down right now and then when we turn on use trying planar projection that disappears which is great and in case you're wondering this example map yes it does come with a project i highly encourage you to just go through and just play around this example map this map is meant to be experimented with okay so those are the main parameters now let's go down to the special parameters at the very bottom down here that start with z so we have z underscore distance variation this is basically the different variations that you can have when you're looking at a distance so i have it turned down pretty low right now let's go bring up the coloring amount to like one what this is doing is if we have it right here you can see that there's a small texture if we open this up let me go out of here if we open this up we can see that it's just some slight variation of color that i am overlaying onto the landscape here so this could just add just a little bit of variation to your landscape that could just add just a little bit more realism get rid of that uniformity which is what we want in landscapes we want to look real so i'm just going to bring that back down to 0.4 and you can turn off these features right here so if you don't like any color if you don't want any color you can of course make it zero or to save on texture rendering you can just uncheck it right here and get rid of that with just one click right below that we have the texture tiles basically just the tiling of your color variation and below that we have the distance normal variation so let me go bring this up to one actually let me bring up ten that's so you can see it yeah okay so basically this just adds a slight overlay of different bumps to your landscape and of course when you get close to these these bumps go away so this is just some slight variation also in the distance again these are all very slight modifications that you can add let's bring that back to 0.5 and then we have end distance variation fade start distance variation fade these are the same as up here we have end distance variation fade start distance variation fade basically this is in centimeters how far the transition you want to be so let's say let me demonstrate this with the grass so right now we have our start distance at 1200 meters centimeters and then we have it at 8 000 centimeters so when we scroll up to like right here let's say we want this transition from the far texture to the near texture all we have to do is just bring this down so we can bring this to [Music] something ridiculous like 500 and then if we want the falloff to be really sharp we can make this 600 okay so now this is very noticeable the difference so that's just a good way to be able to like hone in and make sure you have the settings you want for those transitions i'm gonna go back right now because it's kind of ridiculous i'm gonna go back down here same thing applies here basically when do you want your distance variation to kick in when you want the normal map to kick in or the texture overlay to kick in below that we have foliage i'll go to folger bit but these are basically switches so let's say if you added foliage and you have grass but you're like hey i don't want this grass anymore you just flip a switch material b foliage and it will get rid of it and right below that we have macro variation i remember watching this in an unreal stream and next you know every landscape material has macro variation but that's for good reason it basically just overlays some small darkening over your entire landscape so it's a really small darkening but it can make a huge effect i don't really know if you will see a difference right now actually let me go into unlit and let's go uncheck it real quick let's see if we actually see a difference okay so this is without macro variation and this is with macro variation so probably with the u2 compression you barely see it um all you know is just adding in a little bit of random black spots everywhere and below that we have the normal map blend so let's go back to lit and with the normal blending right here we can choose whether or not we want to use the auto material function basically by default this will blend between material a as the cliff which is the sharp angle and material b as the flat land which is your normal material of your cliff or you could change the angle of your grass by just going here and changing like this so now we have all cliff and then if i bring this back we can slowly bring back the grass and bring that to right there so now we have all grass so if we just go back like this this is what it is by default you can also adjust the sharpness here which is kind of like the fall off so you want just like a really weird sharp falloff you can also adjust it here like that and we have the option for extra material blend if we turn this on like this nothing will really change that's because we get some more options here but basically this will allow us the ability to have a transition material and that transition material would be c right here and we have use normal map blend option basically it's blending with the normal map so if we go in right here we can see that the grass is kind of going on top of the rocks based on the rock's normal maps and the grasses normal maps it makes it look really realistic if i turn this off then we just get your normal kind of fall off normal map so like this so this is like optional if you want to use normal map blending you keep that on or off i tend to like it on because this this does look kind of unnatural because it's just kind of like a weird fade going in and out if i turn it back on then we do get some natural transitions going on and just looks a little bit nicer now it's time to go over virtual texture blending aka how you can get your static meshes to look like they're coming out of the ground so no no more are those harsh transitions you always see in video game when like a rock or cliff is on the ground now we can show that ground slowly seep into the object into the rock and give it a nice natural transition and it's already done for you within this landscape material also also don't forget if you want to go more into depth into virtual texturing i created an entire tutorial on how you can create this from complete scratch but for the purpose of this landscape material i already made it for you but if you want to check out that tutorial there should be a link somewhere right there okay so within the example map you notice over here we have some words if we fly over here or if you're lost you can press two i bookmark this location this is an example of this materials blending features with mega scan assets and the mega scan assets were barely modified basically what i did was that under auto landscape materials we have this mf underscore vt ground blend if we open this up we can see it's kind of complicated but basically what this allows us to do is that i can drag this material function into any material and that will give it the ability to blend perfectly with this landscape so for example what i did with the mega scanned asset right here if we open this up and open up the default mega scan material we can see that nothing changed except i added that function right here at the very end and what this did is if i open up the material instance it gave me all these features down here so i can control so i can control how much of the landscape is on the rock right here with like the fall off so i can make this a large fall off or a really sharp fall off i can also change the height of this and i can remove the sides to avoid some of that texture stretching right there so that's why i added in that option you just press in and the texture stretching is gone and i also added dither temporal aaa which if we zoom up here it just slightly differs the texture a bit which makes it blend in just a little bit more but that's optional you may or may not need to use that if you do decide to use different temporal a make sure in the main material that it is changed from opaque to masked right here within the blood mode so make sure you change it there if you want to use the different temporal a but really you get nice results without it so we can disable it right there i also now everything disappears so let's go back into msn square default and change it from masked to opaque and let's press apply so now we should be able to get that back okay now we got it back now we also have use noise texture so if i click on this this just adds a little bit of a little bit of scrunch up just some it makes a fall off a little bit more natural so i'll just disable that right now alrighty and then we have two virtual textures you need to specify what virtual textures need to be used now we're going to go over how you can set up this material from complete scratch so we will start off with only one landscape and then i will go over my process of using this material setting it up properly getting all the textures in and starting with the virtual texture blending so you're not lost when you're trying to apply this to your own world right now okay so i am in a very basic level right now you don't see anything right here but we can see in the world outliner all we have is one landscape so if we go into brush wireframe we can see what our landscape looks like so let's go through the process if this was in another project i would have to migrate our landscape master material to do that all you have to do is go to all the landscape go to materials and we'll have the three main materials right here you want to select all three right click go to asset actions migrate and then go to the content folder on your computer where the project is you want to use this material in now i already have everything in here so we're just going to keep it as is as we can see we have the auto landscape which is basically your simple landscape and we have the optional auto landscape underscore height which basically also adds height blending in between layers if you really want to use that and then we have mf underscore vt ground blend which i will go over in just a bit so first off what does this world need it needs a sun so directional light drag it in boom we got our sun now what does it need it needs atmosphere so we're gonna do atmos sky and atmosphere we're gonna drag us in atmospheric fog is going to be deprecated that's the old way of doing it this is a new way of doing it and this is amazing so i'm just going to drag it in we notice that there is no difference that's because i need selected directional light and tell it to use atmospheric fog so i believe if we scroll down we should eventually see it there it is and we want to make sure the sun selected in the details panel atmosphere sunlight turned on boom we got some nice sunlight now something i don't like is the darkness we have surrounding everything this darkness is kind of scary so we can hide that darkness with an exponential height fog so we're going to drag that in like that now there's too much fog it looks like it's in a sea of fog maybe you like that but i'm going to go to details and one thing i'm going to do is i'm going to take fog in scattering color bring it down to black and then tricked directional in scattering bring that also down to black and then i'm going to click on volumetric fog and now i'm going to slowly bring this down like this so basically now this fog will be dependent on the sun and the atmosphere and not just giving out emission just because it can so if i hold down control and l i can rotate the sun around and if i bring the sun down we can see that the fog also disappears with the sun and the reason why we made this black is because if i make this white i think the sun's not gonna disappear with it yeah yeah the sun doesn't disappear with it so by making this black it does if your project doesn't do it if it's still not disappearing or if the fog just disappears when you make it black make sure you go to settings project settings type in fog and make sure support atmospheric fog is selected and support sky atmosphere affecting height fog is also set to true so make sure both of these are set to true and then you should be able to use your fog correctly with the sky next up shadows pitch black that's not realistic let's get some light on the shadows let's use let's use a skylight bring that in like that all righty everything's looking great we're pretty much done with the lighting now unreal engine's lighting is pretty easy it's amazing holding ctrl l we can adjust the look of things like that instantly really fast it's super cool okay let's now add our auto landscape so of course you wouldn't just add this landscape as is we would create a landscape material instance so i'm gonna right click create material instance and we're going to call this demo very very simple and right here i'm going to go drag a demo onto our landscape material like that and now we have pitch black and this is this is the point where people would email me saying that their landscape is pitch black right now well that's because you need to assign landscape layers unreal doesn't know what material you want on this right now and if we go to modes landscape go into paint we have all these different landscape materials that we need to create and we need to assign to it but all these landscape materials are empty right now so let's open up this material instance we just made and we can see that these are all just using unreal's default textures nothing too special so what we can use is a browse let me open up bridge we can browse any of bridges thousands of different assets take any of these in here download any of these and make sure you have a color map a roughness map and a normal map that's all you need for this material and merely bring it into unreal if you don't know how to i have a beginner tutorial series that will go over how to do that and once you have those textures into your unreal go to mega scans surfaces and we can select our textures so for a material let's make this mossy creek stones which will basically be our cliff drag albedo like that normal like that roughness into roughness like that let's go out let's make this forest ground so let's drag force ground into color like this normal like that and roughness like that so now that we have those abilities in we can see that they already updated right here if we want the auto blend to kick in right now all you have to do is you need to create and get rid of this blackness is create a landscape layer so to do that you want to select what layer you want hit the little plus icon and go weight blended layer normal select that just go okay you want to save this layer somewhere and now boom there we go it is working perfectly fine it already looks okay i mean it looks okay right now i'm gonna go clamp my exposure real quickly let's make this zero negative one okay i'm gonna clamp at negative one and i'm gonna bring up the sun a bit just aligning everything okay so now that we have our landscape auto material all right there let's go edit our materials just a bit so if we come up here i already noticed that yeah everything's off right now the tiling's off and there's way too much distance variation and we haven't even turned off the specular so this is the point of the tutorial where we're just going to be editing all of the parameters i have exposed for everyone to use now i already noticed that there's some if i go like this there's some weird color variation going on there's way too much color variation so i'm going to go tone that down all the way down here with the distance let's make this 0.5 and the normal strength is probably a little bit too intense so make this like 0.25 okay that's better now i need to scroll up here make the grass texture a lot larger because this grass texture is way too small so from a distance it just looks like it's one color so under b underscore material let's go entirely near b let's make this 0.25 0.01 0.025 okay that's better we notice that the texturing looks terrible because it's repeating right now so one click to solution use cell bomb should get rid of the repetition it's way too rough and the specular is off right now especially if we i'm gonna go turn down this exponential height fog real quickly because this is way too large okay there we go oh yeah by the way if you do not know exponential high fogs are kind of location dependent you can bring it up like this to bring up your fog or bring it down so that's a fun fact so if we go down all the way here yucky gross first off let's go increase the roughness and i'm gonna make it four in case you don't know i'm kind of remaking the example material the example mountain material that i already did that's how everyone knows my thought process when i'm using this material and then i'm gonna go specular from color b is already being used but we need to turn down the specular so i'm gonna make this at least something below 0.5 let's go 0.2 okay okay now this is starting to look good now it's starting to look like an actual landscape and over here this looks gross so we're going to change our cliff tiling real quickly with let's go entirely near 0.01 maybe that's a little bit too strong zero point zero two zero zero three okay zero point zero point zero three but now we're noticing that there's texture repetition so we're going to use u-cell bomb okay now that texture repetition is gone and we notice that there's texture rep there's a texture stretch in here so then we're going to use try planar projection that should just eliminate it okay now the tribe planner projection it's the scaling of the tripling projection projection is off right now so we're going to do a change the scaling right here under triple projection i think it's tripling or near size and let's make this 0.1 okay now this look that looks a lot better let's go 0.08 0.2 0.075 if you want to know the secret to what i'm choosing with all these you just play i get these are sliders you can play around with them when you find something you like there is no magic number at least not for these those kind of magic numbers with lighting but that's because lights are supposed to be physically accurate okay normal intensity way too high brings down from one to zero point five and then color multiplier i'm going to bring that from 1 to 0.5 to make it darker and now we notice the same issue with before that is definitely specular and roughness is true so roughness multiplayer multi plier i keep on saying multiplayer we're gonna bring that to two so that's already looking better spec from color i'm gonna bring that down to 0.5 okay okay everything's looking good everything's looking good right now it's not too bad uh if i zoom in on this we see we have just some weird gradients going on let's use our normal map blending we scroll all the way down here and we have the use normal map line so i'm going to select that select true and boom now we get some nice transitioning going and there's way too much cliff i feel like there should be more black grass than cliff so i am going to go use extra material blend actually no not using that i don't want transition material i'm going to be using bias and with bias i'm going to bring this up like this reading it up like this that was a glitch right there it was using the extra material blend but we got it deselected okay that looks pretty good okay so now we i'd say that's pretty much the gist of using a material like this i think it's important now to go over painting materials so what i will do is let's go add a new material let's add it to c right here so let's go back into our surfaces snow let's make sure all these are checked bring in snow breed in normal and bring in roughness now we have our snow material in there all nested let us go to modes landscape paint now let's start adding layers in case you don't know if you don't like the auto layer or the auto material you can override these so let's create these three layers so this is cliff grass and snow just click on the plus icon wait blend in layer normal okay plus okay and plus okay and we can see that it's making those layers in here let me go save everything that's off unreal crashes we don't lose our progress and now if i click on the grass and let's say yeah i don't want a cliff right here for some reason maybe gameplay reasons maybe just doesn't look nice we can just paint that away like that and we can bring up the strength to one that's how it's completely erasing all that or let's say we want purecliff right here we don't want any transition we don't want any funky business we could click on cliff and we can paint right here just make that complete cliff or we can click on snow and let's say at the very top here it's really cold cold it's snowy here i can just start painting in different landscape layers and okay that snow is way too tiling needs to be fixed right there okay that's better so i could just start painting in layers and we still have material d and e so let's say material d could be mud or material e can be like a dirt path so this is very customizable you can choose what you want and you can just come in here and you can just start painting and whatnot so that's the joys of unreal engine landscaping something that's really cool and something most people don't know is if we can completely delete this so let's say instead of going over everything like for some reason i want this entire place to be snow instead of having to go back and forth back and forth like that i believe i could just right click on material c and click on fill layer okay there you go and now the entire world the entire landscape has been filled with that specific layer or i can remove that by right clicking and go clear layer and i gotta go right click up here or if i just want grass instead my auto material i can right click and click on fill layer like that and now i can go and select this material right here and i can manually paint in some of the auto material like this to really have control over your material so yeah i mean that's the joy of this material is that you're not just limited to whatever the material gives you it's very easily customizable the entire point of this is full control which is also why i made it where it's a balance right i could have a billion different parameters and make this the ultimate ultimate landscape material but then no one would know how to edit it no one would know how to add their own layers and that wasn't really the point was to find a nice middle ground between what's complicated and what's customizable so people can like just take this material and make it their own and we'll go over that in just a bit okay let's go over how we would use virtual textures so just as a reminder i have an entire tutorial on virtual textures i highly highly highly recommend you check it out before you watch this just because i'll be going over this pretty quickly but i'll go over the gist like the main points that you need to get started with texture blending so first off we need to actually create the virtual textures we can do that anywhere just within my contents i'll go right click and let's make a new folder let's call this virtual textures let's go in here right click go into materials and textures runtime virtual textures let's call this vt underscore height control w now let's call it vt underscore coal for rough and spec which will basically be our material and let's save both of these and make sure within settings project settings virtual textures is enabled because then if this is unchecked then you won't be able to use virtual textures all right so within coal rough spec let's specify that this is basically our normal rough and specular and does it by default also by default this is 250 because it's 256. i think that's a bit too low so i'll bring that up to 10 which will make it 10 24. same thing with the height this is 256. i'll make this 10. and now that we have both of the virtual textures we need to specify the boundaries from which the virtual texture will read our landscape and we do that with the virtual texture volume so within place actors let's go to virtual runtime virtual texture volume i'm going to drag that in right there and instead of scaling this up i'm just going to go drag let's start with call rough spec i'm gonna drag it into here and with the picker icon right here i'm gonna select this and i'm gonna select my landscape and then click on set bounce what this just did is that it it created the entire bounds around my landscape automatically so i didn't have to scale this up and tell unreal manually like hey i want my entire landscape to be captured nope unreal will just scale it up for me which is really nice now i'm going to press ctrl and w with the runtime virtual texture selected to create another one and now this is going to be the high so i'm going to drag in height just like that now i need to specify in unreal that this landscape is the one that these virtual boundaries of the textures should capture so i'm going to select my landscape go all the way down and oh we can already see that these are here they should be empty because i copy and pasted this from the old example but pretend these are empty we should see virtual textures and draw in virtual textures i'm going to add the plus icon twice and drag in rough cool spec and then dragon vt underscore height now what i need to do is okay we notice right here that both of these are color that's wrong and within vt underscore height i should have changes from virtual texture content to world height so this is world heights and this one is base color normal roughness and specular okay now i want to find the asset i want to blend with this landscape so for example we're just taking the basic just some basic mega scan assets i'll drag it into here like this and nothing is happening so basically what we want to do is that we want to get this little material function right here mf underscore vt ground blend and i want to open up whatever objects material function or material it has and then open it up again and then you want to drag mf underscore vt ground blend right here so at the very end of the material you want to drag and just place it there now if the material looks something like this make sure that all of these are connected into a material attribute so we want to make material attributes so basically you're going to move all the connections from here to here and then once it is like that we're going to go into our material details and then click on use material attribute and then from here you would drag onto mf underscore vt ground blend and then you would drag this into material attributes like that so that's just the case for materials set up in a different way than using material attributes so we're going to press apply and this will give us new options within our material instance specifically right here under global texture parameters we need to drag in the virtual textures of our landscape so i press on this little icon right here to jump to wherever those textures are located in my content browser drag this into color like that and drag this into height like that and now we have which we should have okay now we do okay it was just too small to notice all right so now we have virtual texture blending that we can increase the fall off and let's try to get something that looks nice so that's how you go through and set up the texture blend settings now we're going to go over how you can use the procedural foliage tools built into this landscape so that's how we can start getting some static meshes on our landscape like grass and rocks okay within auto landscapes under materials we'll have a folder called landscape grass if we go into this we see we have a bunch of landscape grass types so if you never use this before all you need do is let's say you want a specific object maybe you want grass on like a grass static mesh on the actual grass material right here or let's say you want rocks on the cliffs basically what you would do is you would go to that materials respective grass layers so if it's rocks it would be a or if it's grass it would be b for our setup right now so let's go in a b and with b open you would add a new element right here with adds elements so now we need to choose a static mesh that will basically function as grass that will be spread all around the green so i can click here and you can pretty much choose anything i'll just use cones for now as an example and we can see when we go out we have cones cones everywhere so this is a great way to just procedurally go through and instead of painting foliage you let the landscape itself handle the foliage now this looks kind of wild it also comes with a bunch of different options we can play with so for example you could do the density right now it's 400 we can change this to 100 so now there's not as many cones being spawned or as many meshes or we can make this like 1000 so this is all cones and we can also change the bring this to 500 we can also change the size right here so we can have a minimum size so let's say the minimum size is one but the maximum size can be five so now we have varying cones from length of five all the way down to length of one which this looks pretty cool right now so it looks like the scale of like a pokemon or something all right and then we have end distance and cold distance we have the start distance and we have the end distance let's say you don't want cones to be too far off in the horizon just for performance reasons you can play with here so we can make the end distance like 100 and now only cones within a one meter radius will be spawning around you but let's bring that back to what is 10 000 like that and then we have down here random rotation so that just adds some slight variation and then we have a line to surfaces basically if we go right here we can see that the cones are aligned to the surface angle so because this is at an angle these cones are facing out that way if we go and disable this the cones will be facing straight upwards like that so let's go align the surface again okay right here i have a little example of basically the power that this foliage tool has all of the grass you see right here has been procedurally placed aka i did not use the foliage tool our auto landscape material is handling everything and we can see right here if i bring up foliage underscore b that we can see all the different meshes and all the different options you can customize and make your own procedural ecosystem which is so cool and to just show you what the switches do that i was talking about beforehand if i go here and i know that this is b since this is only spawning on the grass and i like to use material b as my grass layer if i deselect material b foliage we get rid of all that and then if i reselect it again we can bring it all back so basically that's what that switch does it just turns on and off the procedural foliage and finally let's say you want to disable this foliage but only in like a particular area so like a road or maybe there's a house somewhere and you don't want the foliage growing into it well very simple all you do is go into your landscape and within paint if you scroll all the way down we see foliage remover layer and this is very important when you're about to make this layer when you press on the plus icon instead of saying or pressing weight blended layer normal you want to click on non-white blended layer so make sure you click on that now that you click on this let's hit ok and make sure this is selected now with strength at 100 we can manually paint away the foliage where we don't want it so like i don't want it there or maybe here and yeah so it just gives you like another extra level of control which is pretty great now it's time for the fun stuff and that is how to customize this landscape material build on top of it and make it your own for your own specific needs that's how you're not just limited to all the material parameters you can add your own parameters and make it special to whatever project you are making currently now it is time for the tricky part and that is actually opening our material and showing how the material was made and how to customize it and if you notice all the way up to this point i think we're almost an hour in right now i haven't even opened up the main material yet and that's on purpose if you never you can just skip this part right now if you never want to open up the material or see how it's made or customize it then you don't need to even watch this part and that was a point of the material was it kind of abstract all the easy stuff that's how you the users can create epic landscapes without ever having to go through the fuss of actually creating the material itself but for all those people who want the technical knowledge i wonder how to customize it then let's go and open it up so we just double click on where it is if you don't know the main material is located in auto landscape and under materials so here it is it might look pretty intimidating or it might look pretty surprisingly simple i think it depends on the person right now so let's start from the very left and we're going to work our way down until the very end right here which is the output also keep in mind a lot of the functionality here i've already explained in past videos so i'll be linking them in the top right hand corner here so if you want to go into more in depth into something then you can check out those videos so the far left here we have where our materials are this is material a right here b c d and e and we've already been using them so we'll go into them in just a bit but just know that right here are where the materials are located and if you notice with a we have some extra nodes right here this is basically the tri-planar option so we have u tri planar projection question mark this is basically what would give us that power and i only have it on a because pretty much a for me and for the auto material should be your cliff material or your really sharp angle material so it would make sense to have tri projection in a when it makes sense to have them in all the other materials so right after that we have the slope blending so here is where the material blending is this is where the auto material is actually being made so we can see that we're blending this material so we're blending a with b and we have the option to also blend c if need be so that's what all of these nodes here are doing if you want an in-depth explanation i've already made a video on auto landscapes in the top right hand corner we're going to detail how you can make these specific nodes that you see right here now after that we actually have the layer blend this is what tells unreal that hey this is a layer landscape this is what gives us the ability to actually be able to paint our landscapes so we can see we have material blend that's what's called right here we call material blend then we have a b c d e and foliage remover all of these are seen here except the folds remover that is seen down here but it's using the same node now right after that we have the macro variations again um some of these techniques that you see right here of hiding text repetition has already been gone over except cell except the cell bombing that was pretty new but you could top right hand corner if you want to know more about what macro variation what these things right here are actually doing or how to make a distance blend but then this is the distance variation this is our normal distance and this is our overlay distance and right below all of these is the virtual texturing at this point after the macro variation is when we will take our landscapes and capture all the data that's already be put into it and put that into any runtime virtual textures if we are using that that's how we can get that really nice blending you see right here and yeah then after that after all of these we'll just feed it back into the output and below all of this we have the foliage remover so this handles all the folds right here so we have our switches at the very end of the filter mover and then we have some math this math isn't actually that complicated basically i also want the foliage to spawn even when we are using the material blend so what i'm doing is that i'm taking the output of the material blend and using that to specify right here where the b foliage or the a foliage should go if we are doing it that way and then we have the folds remover right here which is as talked about beforehand will just remove your foliage so that's a very very high level introduction to this material now i think it's time to go into the nitty-gritty of what some of these material functions do so we see that we have mf underscore a b c d and e now all of these so all five of these there is no difference between these except except if we go into mf underscore a we can see that all these parameters have an a at the end of it so we have distance fade a and distance fade a tiling a mask a roughness a and also the groups start with a so a underscore material and then if we go to b we can see that there was no difference these are the exact same except with b now instead of saying a we're saying b and then instead of group a underscore material we're using the group b underscore material so that's just to tell unreal engine and that's because if you don't know if you have two parameters let's call this param and then if we have another parameter let's say if mfr score a and we call this one power ram then basically epic or unreal engine they will treat both these parameters as the exact same thing so we can't have just a start distance variation fade with no b or no a because then all these materials will just treat that as if it's one so we need to specify that hey these are unique parameters don't combine the parameters you have right here so that's what we're doing and now we're going to go through a little explanation of what's actually happening in these material functions so of course we have the material blend this will basically tell us whether or not we want to blend the material with a material that's up close to the player or material that's far away from the player or camera and we control that right here with the distance blend and the tiling blend and then we can see it feeds into we have a couple of options for images we have our color and we have the mask that's if you're using a mask now by default all of this is not being used because we're just going to be using a roughness texture since that is by default what mega scan uses and this material is foremost should be used with mega scans and then we have a normal and then we have a height so the height isn't being used in m underscore auto landscape right now but if we go into m underscore let me go leave this if we go into m underscore auto underscore landscape height and we go into like this we can see that this is the exact same material except now within our layer bend we're also taking into account the height so that could just have a little bit better fall off between them so like if we have a height map for dirt or grass then the grass will be growing into like the dirt crevices first and then eventually engulf the entire dirt so you can just add just a little bit more realism but this is optional sometimes i use this sometimes it does that's why i separated it out since oftentimes we don't even have access to a height map so for this material right here this height is being used but within this one which is our main material height is not being used right now so that's what the height is all these textures right now are being fed into two nodes and that is distance cell blend which if we go into it is using unreal's built-in texture cell bombing so that's how we're able to get rid of those nasty text repetitions so this is where the magic is happening and it is also using below here mf underscore distance texture blend which is just your normal distance texture blending so basically and here we have the u cell bomb and all of these have the same u cell bomb where if we're going to use cell bomb then instead of using here the really basic distance texture blending it will use this instead and then we have some extra options here so we have color multiplier color tint we can add an ambient occlusion if and only if you're using a mask so if a mask does have ambient occlusion congratulations you can use that and also we have speckler from color which is right here which is as said before it's grabbing the red channel from this texture and using that as the specular detail and then we're able to change things here so this is really really customizable right here let's say we want to add in a desaturation node to our a material well we can by just adding it in right here so we go d saturation let's go s let's call this d sat fract plug it up like this press apply and now if we go back into our main landscape and let's us open the mountain drag this down actually make sure when you add this in let's add this specifically to group a underscore material let's go call this dsat fract that's how if we add this into any other materials they won't be conflicting and we know for sure that this will be affecting the a material we can see now that we have d sat fract already available within a underscore material and we can desaturate it like that or we can bring back the saturation we can over saturate it make it look absolutely crazy and if you're wondering why this isn't being desaturated is because this is using the tray tri-planar material right now so yeah i mean that's how easily customizable this material is so just within what like a couple of nodes a couple of clicks we're able to quickly customize it and all of these are still exposed right now i'm not really hiding anything into too many material functions and that was on purpose that's how you know exactly where to go if you need to edit something and speaking of try planner let me show you what the tri planar nodes are i'm just going to go copy and paste these real quickly because we notice that we do have an issue where in the mountain landscape if we do saturate or desaturate it that triplanar projection isn't getting that desaturation that's because dry planer projection is using the other material function which is mf underscore a underscore tri projection so this is the exact same thing as mf square a it mirrors it except for using cell bombing or distance blending we're using tri-planar projection right here and i'm going to give a shout out to this channel right here rodrigo i'm not going to try to pronounce that i'm sorry but his tutorial is pretty great and i cannot explain tri planar projections as good as he does so this is an hour long video if you really want to know the nitty gritty of what this material function is doing i highly suggest you watch his video but because we know that this is basically a complete duplicate of mf underscore a all i need to do is copy these two breed it into here like this hook it up in the exact same way press apply and now that tri planar projection should be getting a saturation so we shouldn't be seeing that error okay and we do we're good so it is getting it so now we can just bring it back like that probably the most common question i get is how you can add your own new material your own paintable new material to the auto landscape material and that is really really simple we just go up to layer blend we just want to click on it all you got to do is press on the plus button let's go expose this and now we have a new layer so let's call this my new material and now we have a new material that's accepting any material attributes so you can literally just copy and paste in any material make sure it's a material attribute so it's everything's feeding into a make material attributes node and then you can just plug it up like this and to prove that this is a very simple material let's just add in a color let's make this orangey gosh that's kind of tannish there you go bright orange yellow put up the base color press compile and now all we have is a make material attribute one color node being fed into a new layer we just created within this node right here so it's notes kind of in the middle of the graph and press apply now within the landscape paint if we scroll down we'll see that we have we don't have a new material and that's kind of a glitch because we need to unapply and reapply this material we have right here so i'm going to go out go to select let's go press on this little icon right here that's what we browse where it's location is and then we are going to click on this little yellow icon which will reset the material this will take our material away from the landscape so now the material is gone we're gonna save this and then we're gonna reapply it right there like this so now hopefully hopefully this is working now this kind of a glitch landscape paint okay now we get it so we have my new material which is what we just created right here i'm going to click on the plus icon white blended layer normal hit ok click on it and now we have a new paintable material as easy as pie as easy like that now we do have okay so that was a glitch i was able to get rid of it if i go to m underscore r landscape by just putting a zero into specular and a zero into roughness then that nastiness did go away so yeah unreals unreal is kind of glitching on me today but that's fine that was amazing so that's pretty much that's how you would add it so if you have any materials you want to copy and paste it into here now this is a key make sure make sure make sure to make sure for all your texture samples that you copy paste into here within your new material is set to shared wrap if it's not set to shared wrap then we're going to see some black spots we're going to see some weird glitching going on in the landscape because unreal needs a certain amount of textures but if we use shared wrap then we can increase that texture amount so that's pretty much it that's a big one also if you want to create your own new texture in the style of mf underscore a b c d or e all we got to do is go to where this is located which is right here under auto landscape material sub materials and then we can just copy paste any of these let's copy paste mf underscore e and we'll just call this mf underscore f and then you're going to open up mf underscore f and pretty much go through all of these parameters and rename e to f they go down here and rename the group from e to f so just go through each one painstakingly i know it's a process but hey this is the way you do it changes it change the ease to f or whatever you want to call it make sure it's just different from other material functions that's how they're not conflicting with each other and then you can just drag this back into m underscore auto landscape once you're finished let's create a new one and let's call this mf underscore f or let's call this a material underscore f and then we're going to hook it up like this and press apply so now we get even a new material f into there just like that it is literally that easy okay congratulations this is the end of the tutorial i hope you will enjoy this asset now don't forget to like comment and subscribe to boost this in the youtube algorithm and to also hit the bell icon since i will be doing a lot more of the youtube community post and i'll be interacting with the community a lot more within those community posts so if you have any questions go on them and i might be streaming soon so maybe do some q and a's or some live tutorials if there is enough of a demand and don't forget to subscribe to the unreal sensei newsletter so hope everyone's having a good one and goodbye
Info
Channel: Unreal Sensei
Views: 261,281
Rating: undefined out of 5
Keywords: ue4, unreal engine, tutorial, landscape, material, master material, course, free, training, ue5
Id: 3hmRN8bXMM0
Channel Id: undefined
Length: 67min 40sec (4060 seconds)
Published: Fri Apr 23 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.