Unreal Engine 5 Landscape Material - UE5 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone in this tutorial I will teach you how to create realistic Landscapes with my landscape material Landscapes are important because they are everywhere you are always looking at a landscape which is why I'm making my landscape material completely free you can download it right now Link in the description below the features of this landscape material include nanite displacement so you can Leverage The Power of nanite to add near infinite detail I stamps to quickly create realistic Landscapes directly and unreal without sculpting or using another program Auto texturing which applies different textures depending on the landscape slope cell bombing which can hide repetition in any texture with one click virtual texture blending which will blend any object automatically to the landscape giving it that extra boost of realism procedural folish placement so we don't have to manually paint foliage we can have the material do most of the heavy lifting and tripler projection to high texture stretching and all this is easily customizable so you can make your own version of this material this this is the ultimate landscape creater for Unreal Engine 5 for the rest of this tutorial I will cover all the features in depth so you know exactly how to use this material for your own projects you'll be up and running in no time creating amazing Landscapes so let's jump into it this is what you're going to see when you open up the project for the first time now it is important that after you download the project make sure you unzip it because if you don't unzip it you won't see this level and your content folder will be completely empty so after you unzip it and you open up the project this is the first level you're going to see which is this massive Mountain this mountain is a simple example of how to use the landscape material and if we go into the outliner double click on the mannequin here we have a human as reference for the landscape so generally whenever I'm creating a landscape I like to add in a human just to know what the scale is so that's why we're able to tell that this mountain is pretty large now let's jump into the landscape material and go over some of the basic settings now if you are new Unreal I recommend you first watch the u5 starter course before continuing this video because otherwise you will be lost I do assume that you know the basics of unreal so to jump into the landscape material select the landscape and then within the details panel double click on landscape material right here and this is what it is going to open up right here in the details panel is all the different parameters we have access to to change the landscape material to our liking now this preview is pretty useless so what I like to do is I like to undock the details panel by holding down the left Mouse button and dragging it out like this and then I will drag out the rest of the windows off to the side so that's how I get the details panel right here ready for me to edit in real time and now if I make any changes for example The Tint let's make this super red we're able to see those changes within the viewports so press control Z cuz obviously I don't want that another tip that's how I'm just f focusing on the landscape and the parameters of the landscape is to press F10 so F10 will dock all these windows to the side and if I ever need those windows again I can just select them right here or press F10 key to get them back so first off just like every landscape in unreal the different materials like the cliffs and the grass are divided up into layers so the first layer is the a layer and we can already see that it is the grass layer the second layer down here is the B layer and this has Cliffs the third one is C which is another grass layer we're not using currently the next one is a d layer which is snow and then we have an e layer which is empty and we can see all these layers if we go into the landscape editing mode by clicking up here and Selec the Landscapes or the shortcut is shift and two to get it so within landscape if I go to paint we now see all these different layers so the C material right here is the C layer layer within the landscape editing mode and if I want to use this layer I am unable to paint it unreal will give me a warnings saying I need to assign it a landscape layer info so I can paint b so let's paint right here I'm able to paint b which is the cliff and I'm able to paint a which is the default grass because they already have a layer info assigned to them so to create a layer info for the C layer just press on the plus button and then you want to select weight Blended layer normal so this will create a c layer within this location that's okay and press save so now that we have this layer if I select C again and paint it down we see that we get brand new grass if I zoom in that grass is different from the default grass I use the same process for d& whenever I'm creating layers but you notice that there is a special layer all the way up here and that is the auto material layer and this layer is great right now now the vast majority of this landscape is just using the auto material this means that it will automatically assign different layers depending on the slope so when we have a really sharp slope like right here which is this Cliff then it's going to use the cliff material and when the slope isn't sharp like right here it will use grass and this is all Dynamic so if I go into sculpt select the sculpt brush and I start sculpting right here let me increase the brush size by using the bracket keys so right bracket key increases it left bracket key decreases it I am able to paint and you'll see that it automatically assigns these layers and then if I ever let's say I don't want Cliff right here I want grass then I could just go back into paint go into the grass layer and then paint the a layer on top of the auto material so that will override the auto material in case it's not giving you what you want let's briefly go over how to create a landscape material instance so in order to find the master material for this landscape you want to go into content Landscapes materials and then we have two materials we have M Landscape which is what this mountain is currently using and then we have landscape height this adds Nite displacement which we're going to go over in just a bit so let's double click on mcore landscape to see it so our entire landscape is being driven by this graph do not worry you don't have to know exactly what is happening in this graph in order to use this landscape material because we're using an instance all we need to know is how to change the parameters of the landscape material not exactly how the landscape material is created now if you do want to know how to create this material from scratch you could check out the unreal master class which explains all these different parts in detail to create an easy to use instance of this material is like create an instance of any other materal material it's just to right click on mcore landscape and create a material instance we can call this my landscape and then if I double click on my landscape I get all the parameters I can quickly edit just like in the landscape Mountain material and then to apply that material to a landscape just select the landscape and then within the details panel you can drag your new landscape onto it like this but I want my original landscape so I'll press control and Z to undo that change now the entire reason why we have a landscape material is to bring it into our own projects and use them there so the way we migrate this landscape material out of the landscape project is to migrate this landscape folder so the only folder and assets you need to bring into other projects is the landscape folder right here we don't need the example folder because that's just examples and we also don't need the mega scan folder because those are assets that are being used by the examples so in order to copy this landscape into another project of course you just have to rightclick and select migrate this will only select the landscape folder which is what we want and press okay and then navigate to the content folder of your project and select it now if we go into your own project you'll see that we have the landscape folder right here and the materials ready to be used by Crea a material instance of now we know how to get this material into our projects it's time to go over exactly what these parameters do and how we can customize it to create the landscape that you want and for this part to better see the landscape I'm going to press f11 to make my viewport full screen so that's how we're just focusing on the level now the first parameters are the a material and you'll notice that the parameters for one layer for example normal roughness specular are the exact same for another layer so all these parameters just repeat for each layer so what are the parameters for the layers first up we have the texture settings so this is where we're going to put our color texture our roughness or our normal texture and we will go over how to get those in just a second these are the three most important settings because they will Define exactly what material your layer is and below that we have albo controls so you want to make sure you select this triangle in order to get the controls and the default for all of them is one I've already changed some things so of course with saturation if I bring this up we get a more saturated layer and then if I bring this down we get less saturation and then if I just do zero then it is black and white so I'm going to leave that back at 1.3 there you have brightness obviously this controls how bright our layer is leave that at 1.3 and contrast controls as you can guess the contrast so if I bring this up to two then our landscape is looking pretty interesting so we'll just leave that at one for now and below that is tint if you want to change the overall color of the layer then this is where I'm going to do that so if I want to make this let's say maybe more like fall so less green a little bit more brownish then I'll change the color to like right here and press okay so now we have brown grass and press contrl Z to undo that and then we have normal strength this one is self-explanatory it controls the strength of our normal map which is the shadows of my texture so instead of one we read it up to two actually 10 so that we can better see it and now we get more noticeable Shadows that interact with the lighting so bring that back to one right there and whenever you want to use a setting you want to make sure that you activate it first before changing it because otherwise it' be grayed out and there will be no change roughness is how how rough you want the material to be and roughness is tied with specular strength so in unreal the specular strength by default is 0.5 for all materials and obviously now you're going to see that we get a weird reflection on the landscape it's almost like this grass is plastic and not actually grass so little tip we do for all our landscape layers is that we bring down this specular strength to something really small like 0.02 and that gives something much more natural the landscape doesn't feel like plastic anymore but because we bring down to 0.02 that means this roughness doesn't really have much of an effect but if I did leave it at 0.5 then roughness would control how rough the landscape is so if I bre down to zero then we get an extra shiny landscape so let's set those back to their default values and if I ever want to set something back to this default value I can just click on the reset button right here so turn that off and normal strength off and now we have the different blending options so right now we're not using the blending option for the grass so let's hop into the cliff to check out the blending options right now the cliff material is using distance blend distance blend is a way to hide repetition and repetition is when our texture is noticeably tiling which can immediately break immersion you probably no this in a lot of video games where you're looking at texture and then you realize wait that texture is the same it's just repeating itself so if I uncheck this to see what I mean now you'll notice that uh-oh this Cliff is very noticeably tiling look we have one texture continually repeating itself and what distance blend will do is that it will blend in between two different sizes of the texture so we have a really large size of the texture and then if I zoom in you'll see it transitions to a smaller size so we have the really big one and then when we get closer and closer it transitions until the texture is smaller and to change the size of a texture so we have our normal size and then we have our far size if I decrease the sizes for example make this 0.005 then the texture is a lot bigger or if I increase it to 0.1 then the texture is a lot smaller so you're going to want to experiment with these values to see which one is better so at least for this one a value of 0.01 was good for the far size and then the size that's up close I land it on a value of 0. 08 if I want this to tile a little bit more when the player is up close to the texture then I can do 0.1 or even 0.5 but now that transition between the far texture and the near texture is very noticeable and the start offset and the blend falloff control where the textures transition between each other so that is one way to hide repetition another way to hide repetition is what I'm using on the grass down here so if I scroll back back up to the grass layer we have cell bombing so if I turn off cell bombing now you notice that uhoh this is very noticeably texturing if the player is walking around the landscape they know that's just a texture repeating on itself but then as soon as I turn on Cell bombing down here boom that texture is immediately removed what it's doing is that instead of tiling the texture is going to randomly scatter that texture around and blend the textures together realistic Bally so that is another way to hide repetition the only downside with cell bombing is that when we turn it on the landscape materials performance decreases so it might slow down our game so just keep that in mind when you use cell bombing you might not want to use it on all your material layers because that can add up and masks are primarily used with mega scan assets which we will go over in just a second so I'm going to skip that and then we have spec from color which will vary the specular highlights based on the color texture this can add a little bit of realistic roughness variation so generally I like to leave that on and then we have size unlike the cliff material where we have two sizes we only have one because we're not using distance blend again if I bring this down to something small like 0.1 then our texture increases in size or if I bring it up to something like 0.3 then our texture decreases in size now those were all the main parameters for each of the material layers so the parameters for a material are the same as B and C essentially you're able to customize your landscape exactly how you want with just these simple settings and there's one more parameter that only applies to the B material and that's because generally at least for this landscape material we will use the B layer as the cliff layer for the auto landscape and the additional setting for the B layer is tripler projection so if I turn this off you'll you'll see what I mean and that is we get really bad texture stretching so whenever we have textures on really sharp angles those textures are going to stretch it's even noticeable right here where the rocks are stretch going up and then as soon as I turn on tripl projection that will fix the texture stretching to make the landscape a little bit more realistic so that's an additional setting for the B material those are all the settings for the layers now let's go over settings that apply to the entire landscape as a whole so if you make a change there it won't just apply to one layer it will be applied to the entire landscape and you can find those settings all the way down here under the layer settings and we're going to start off with zv variation at the very bottom so zv variation is three different textures that we're overlaying on top of the landscape to just make it look a little bit more realistic and maybe hide some texture repetition so we have color variation right here which is a texture of color splotches overlaid on the landscape this adds just a little bit of color variation so right now it's at 0.3 if I bring this up at 2 one you will now see those color splotches so this is 2 a t0 then I bring it down to something like 0.3 so that's how it's making a little bit of an effect and below that is macro variation macro variation is like the color splotches except it is black and white so if I bring this up to one you can see that they're just black watches that is darkening the landscape also bring down to something like 0.3 just to add a little bit of an effect and then we have a normal variation strength so this will artificially add Shadows to the landscape so you can see without it and with it and if the camera gets closer to the landscape then the variation disappears so just like beforehand it doesn't have to be this intense I find it's just a little bit of normal variation at 0.3 to be pretty good for most Landscapes and of course you can switch out these Textures in case you don't want them and above that we now have the slope blend so this controls the auto material if I want to increase the angle at which the cliff material is being spawned then I can increase the fallof amount to something like three or even four to get a lot more Cliffs or I can bring it down to one that's how only the sharpest of angles has the Cliff texture or if I think the transition is a little bit too much then I could increase the angle contrast to something like even 10 so now we have a pretty sharp transition between the two layers so I'll reset both of them and if I want to make the transition more realistic so it's not a smooth transition like this I can increase the normal blend right here to let's go something like 0.2 and now it is using the normals of the cliff do transition between the two layers so if you add a little bit of a normal blend this can make that transition just a tad bit more realistic so I'll keep it at zero for now and let's say if you want a transition material between the grass and the cliff maybe before the grass transition to Cliff you want it to be dirt in between the two layers then we can check extra material blend and it will use the C material right here between the a layer and the B layer now right now the C material is another grass so it's hard to tell what is happening if you are going to transition between grass and cliffs then I recommend using a dirt material for the sea layer so that is a nice option to have just in case above that is foliage this is for procedural foliage placement we will go over that later and then we have ground breakup ground breakup is a great way to layer on top of the landscape a material without having to go into the landscape layers and paint it so if I turn turn this on you'll see that it is currently taking the D material layer which is snow and then overlaying it on top of the landscape according to this texture which we can change so if you want quick variation between the different material layers without having to paint it then ground breakup is a good option and above that we have height blending so let's say you have material and you only want it to spawn at the very top of your landscape or at the very bottom then we can either activate top material or bottom material so they're the same let me activate top material and this will overlay layer D all my landscape at a certain height so right now this snow will spawn at a height of if we go to top material start 2,000 now I can increase this to 10,000 that's how it spawns only at the very top but you'll notice that the transition between our normal grass landscape and the snow is a little bit too sharp if we want to increase that transition or the falloff then we will activate top material fallof and change this from, 1500 to 10,000 which will give it a smoother transition now our landscape has snow at the very top of the mountain and let's say if we do have a location at the top of the mountain where I don't want snow to spawn then I can jump back into landscape editing mode and down here we have the material layer no height map so let's create a layer info for this and make sure when you're create this instead of selecting weight Blended layer which is what we would normally select for materials we select non weight Blended layer create that and now if I select this bring up the tool strength go into paint right here I can paint away the snow if I don't want it at an area so even though we are assigning layers within the material parameter I still have control over where I want that to be now let's let's go leave landscape editing mode go back into the material parameter and deactivate top material so that is all the major parameters for this landscape material so with all that knowledge you can go ahead and start creating your own Landscapes very quickly with these simple settings now that we know how to use the landscape material let's go over how to get material textures to fill up Landscape layers luckily for us we have mega scans which is a Free Library of thousands of text we can use immediately in our landscape to get mega materials is pretty easy you just want to click on the plus button and then select quickel bridge now in the future quickel bridge will be called Fab so you want to select Fab instead of quickel bridge and then we can go to surfaces and we have all these different surfaces we can use for the landscape now my case I think I want a sand texture so I'll type in sand and then I can find a nice texture that I want to use for example this one right right here dry sand and then download it so right now it's downloading with medium quality which is 2K low quality is 1K high quality is 4K and highest quality is 8k so do keep that in mind when you're selecting the different qualities now this says downloaded I'll press add and here we get our 2K textures now you notice that there's this VT on this texture that tells us it's a virtual texture we don't want that we want normal textures which is what the landscape uses so to switch this back we could hold down shift and select all three textures right click and go to convert to regular texture just like that and then we can save everything the first two textures are self-explanatory we have our color and then we have our normal but this texture right here looks pretty strange and if I double click to go inside of it we will see that it is a weird color and that's because this texture is actually three different masks so if I uncheck G and B we have the red Channel which is ambient occlusion uncheck red check green the green channel is roughness this is the mask that we want to use for roughness and then the blue channel is displacement which we're going to use later for nanites now I don't want the blue Channel or the red Channel all I want is green so we can exit out of that and now we're going to add my textures to the E layer and that's because the e- layer doesn't have any textures currently assigned to it so let's go into content drawer Mega scans surfaces dry sand which are the textures we just downloaded and make sure that these three are turned on so of course the color texture goes into color the normal texture goes into normal but you'll see that our roughness is asking for a single mask this is why down here on all our material layers we have this mask parameter so if I turn this on it'll switch the roughness to a mask so that's what we want to do whenever we have a mask mask texture like the ones from Mega scans make sure you have mask turned on right there and then we could drag in The Mask which will be used for our roughness now if we jump back into the landscape mode we have the E layer down here I can create a brand new e layer and start painting it anywhere on my landscape and we'll see that the texture looks pretty bad right now I think this is more noticeable if we fly to where the mannequin is right here so whenever I'm adjusting the sizes of my texture I like to do that next to a human reference which makes it easier to know exactly what I have to change okay so I think that the texture could be a little bit bigger so go to size and bring that down to 0.5 okay that is better and there's also very noticeable tiling so one thing I can do is activate either cell bomb or distance blending I'm going to activate cell bombing and now that tiling has been removed and this texture is way too bright So within our beo controls we could bring down that brightness to let's go 0.7 okay that is great now I want this layer to basically be a sand layer at the very bottom of my landscape and I could go through within the landscape mode and paint it or within the material instance scroll down here to bottom material and turn this on okay so now that will automatically spawn that and it's spawning it in the middle of the mountain we don't want that so go into the bottom material starts and instead of 2,000 change this to 177,000 okay so now we have a sand material at the very bottom of my landscape so if I add in water then we turn this mountain into an island which goes to show the flexibility of this material now it's time to cover the best feature of this material and that is Nite displacement which is brand new in ui5 it gives us the ability to add extra geometry that deforms to the layers basically we get near infinite detail and because it is nanite there is very little performance cost to using it I made set up nanite super easy on the landscape so let's go over how to use it in the downloadable project I added an example of how to use n Landscapes so we go to example maps and we've been on the mountain map this entire time instead we're going to open up the nanite examples map and this is what you will see when you go into the Nite examples map and that is if I come up to these rocks they are real geometry they're not being faked with normal Maps or Parallax occlusions this is geometry that exists in the world and this is incredible that we get this amount of detail on landscapes cuz normally Landscapes are not this detailed detailed we even get Geometry on cliffs so you see that they're real three-dimensional Cliffs or if I come over here this is a good Showcase of nanite displacement if I move the light around you can see the landscape casting Shadows onto itself which looks insanely cool so nanite Landscapes opens up a whole bunch of options that weren't possible beforehand this basically means we have near infinite detail for our landscape and we don't have to rely that much on foliage or static meshes to detail our Landscapes we can have the displacement maps of the textures do most of the heavy lifting now how do we get nanite Landscapes with displacement so number one if I open up this material instance scroll all the way down we'll see that this parent is it mcore landscape instead it's mcore landscape height so landscape height is the exact same as our basic landscape except this one adds height blending and displacement and if you ever want to convert a basic landscape to landscape height then within your basic landscape select height right here to convert it and all the parameters will be carried over because as you can see it is the same the only new parameters are right here we have height blending parameters and then we also have displacement mapping which is being handled right there now the other thing you have to do besides using the correct material is to make sure your landscape is using nanites so all the way down here you want to select enable nanites and then press build data and we can double check that this environment is using nanites by now going to nanite visualization and triangles as you can see it's updating in real time now as of Unreal Engine 5.3 nanite Landscapes only work for spa Landscapes like this one if you try to use it on the mountain it won't work of course that change change in the future and nanite displacement is disabled by default because displacement is still experimental you will not have this issue if you're on Unreal Engine 5.4 or future versions of unreal for everyone on Unreal Engine 5.3 to enable Nan displacement go into mcore landscape height and down here you'll see for U 5.3 add to default engine.in renderer settings these two console commands so highlight r. nanite allow testation equal 1 and r. nanite tessellation equal 1 so make sure you have those copied and then within the project folder we'll have this folder called config double click to go inside of it and then we need to go into default engine you can use any text editor I'm just going to use notepad and within here under script engine renderer settings you want to make sure you paste in these two values so I already have the values pasted in if you don't have those values then you can copy them anywhere within this list but make sure that it is under renderer settings and then after you do that make sure you save the default engine and restart Unreal Engine and then you're going to get Nite displacement so again that's only for Unreal Engine 5.3 because this is experimental in the future you won't have that issue now let's go over what the new parameter settings are so first off off for our mask parameter if we uncheck this so we're no longer using mask we now have two different textures so we still have our original roughness texture but we can ask for an individual height texture so if I double click on this this is what the height texture will look like when it's not biged into a mask so all the white parts of the texture will be elevated and the black parts will be lowered this is very important with high textures and that is for compression settings make sure you select HDR compressed this will give unreal a a lot more data to use when creating the displacements if you use something different like default then you're going to see weird Jagged geometry when you zoom into the landscape so to get rid of that select HDR compressed which will be a more accurate height map now in our case I'm going to turn on mask because the height texture is stored in The Mask since this is a mega scan texture height is always stored in the B channel the other new parameters are height blend offset power and strength we will go over those in just a second because I want to cover displacement first down here underneath cell bombing so all our layers get displacement and of course the first is a toggle on and off so if I toggle this off then we don't have any displacement and then if I turn it on of course we get displacement and all the options that it comes with so let me go ahead and let's reset them to their default values and we will start off with strength so strength is how strong you want the displacement to be of course so if we want this to be two times what it is right there then we just type in two and now our displacement is looking a little bit interesting and it's actually flat at the top right here and that's because there's a limit to how far we can add displacements so if I do two you'll see that it is hitting the limits so if I bring this to 1.5 actually Let's Go 1.2 then it is a little bit stronger than beforehand and you notice that I had to move the camera back and forward in order to update the shadow Maps that has a glitch with unre 5.3 you will not have that issue in the future so keep that in mind when I move the camera back and forward that's just to update the shadows and then we have contrast which controls the displacements contrast so if I bring this up to 1.5 then we get much sharper displacement so now the rocks are really coming out of the ground and they're a lot more noticeable so if I bring this down to something like 0.7 then it will smooth out the displacement so that's not as harsh so you can think of contrast right here as displacement smoothness and then we have displacement offset so displacement offset is how far up or how far down this entire layer as a whole will be compared to other materials so right here we have the grass material and then if I bring down the displacement offset to negative 1 and then if I move back and forward you'll see that now The Rock layer is below the height of the grass and is below the height of other layers like right here and then if I bring this up to positive one now this Rocky layer is way above the height of the other layers the reason why this is an option is because whenever we're playing with the strength or contrast it can adjust the entire height of the layer so by adding in the offset we could bring the height back down or back up to the same level as the other layers and finally let's say you really like the values of your strength and contrast but you want to bring down the displacement as a whole without messing up these values then that's what the displacement amount slider is for so right now it's at one so it's full displacement but then if I want a little bit less I can bring this down to 0.5 so this is half of what the displacement was or just bring it down all the way to zero so now there is no displacement so let me go leave it at 0.8 for now and those are all the parameters for displacement and those parameters are exactly the same of course for each layer for example with the D material layer I notice that compared to other layers like the grass layer this is lowered way too much so to fix this we go to the D material then all the way down here to displacement and for the displacement offset I can try to bring this up to let's do 0.5 and immediately that fixed it or if I want to add a little bit more displacement I can increase this to one to make the geometry pop more I'm back in the original example project because it's easier to show exactly what the Hy blend parameters do because if you remember we skipped over them to talk about displacement and for the most part the highight blend parameters are pretty similar to displacement except they don't affect displacement instead they affect how the different landscape layers are Blended in with each other because now that we're using a High texture we want to use this High texture to affect the different blends so when we are transitioning between two materials for example the rocky material and the grass material it is more realistic to make the Rocks appear first before it transitions all the way over to the rocky ground so you notice that right here we have grass and then we see the Rocks first they're coming out of the ground and then we transition to the full layer it makes the landscape just a little bit more realistic and that is controlled right here so for example let's say if I don't want that transition to be that noticeable instead of 1.3 we can set that to one and now those rocks are a little bit less or I could just set this to zero and we don't get any of that transition between the rocks and the grass this is the kind of transition we would get on the basic landscape material with no height map so if I bring this up to one then we get a little bit more rocks or I can increase the blend power and also increase the strength at the same time to make that transition more noticeable so if I go into the landscape layer and let me go decrease my brush go to paint and select the rock layer which is D decrease that tool stength size if I just make light touches we start to get the Rocks first so just very light touches we get a little bit of rocks until we start to get the actual material so this is a nice way to get a realistic blend between the different material layers so you can adjust the height blend for all the layers until you get something that you like and then you could go through the world and add rocks without it completely transitioning to the main layer so that is what the Hy blend parameters are for that is how we can use nanites with the landscape another new feature added in u5 is landscape patches which will let us use highight textures to deform the entire landscape with patches we could quickly add a lot of height detail to the landscape without having to sculpt it to see the highight patches you can jump into the patch example map so go to example maps and double click to go inside of it so these are the height patches that this pack comes with and height patches are great because they allow us to quickly get in height detail from textures and the ability to move around around that height detail like it's a 3D object so it's really fun to manipulate your landscape this fast and we could even scale it down or scale it up make it really big to Encompass the entire landscape or make it super small so it's only in a portion of that landscape and all the detail within this map is handled exclusively by patches so there is no sculpting whatsoever let's go over how to add patches to a brand new project specifically this environment that we created in the starter course so first things first you need to make sure that the proper plugins are enabled so go to settings plugins and type in landmass make sure landmass is turned on and also make sure landscape patch is turned on now it is beta so you are probably going to counter some glitches of course in future versions this will not be in beta now we have two Landscapes we have this main one right here but then we also have this landscape so we will add patches to this one and you will have to migrate the landscape folder into this project I've already migrated that folder and the patches will be under landscape patches the patch will be bbor landscape patch and drag it out to let go it will ask us if you want to insert a new landscape edit layer press accept and that will create if I go into landscape mode a new layer right here called landscape patches so if I select layer I'm still able to sculpt like normal the landscape patches are going to be added on top of our sculpts which means it is non-destructive don't worry the patches are not going to erase any of the hard work you have already done on the landscape another thing that was created if we go into the outliner and type in patch is this landscape patch manager which will handle all the patches make sure you do not delete this actor because if you do your patches will break you also want to make sure that the correct landscape you want to put the patches on on is selected so in my case it's selecting landscape 2 which is this landscape which is where the patches should go now for some reason it did not create the patch when I dragged it in so I'm going to have to drag it in again and then let go and also press the G key to turn off game View mode so I can see my widget so here's our patch right now it's not doing anything and that's because I have to assign it a texture now I can't just go over to the details panel and start messing with the patch settings I have to select landscape texture patch component right here within the components tab so make sure this is selected and then we get access to all the settings we need so specifically I'm going to go down to Source mode select texture asset and we're going to place one of these textures right here so I'll select land Mountain 2 and then let go and immediately this is making effect now before I move this patch around or or before I scale it or rotate it I need to make sure that I have bpor landscape patch selected because otherwise if I have this component selected and then if I move it around then you'll see that the patch is in a different location from the blueprint so don't worry if you do do that nothing will break that is perfectly fine but it'll just make it harder for us the developers so before I move my patch I make sure I have this component selected now I can move this patch around then I can scale it up so we can actually see this mountain move it off to the side and then scale it down that's how it just makes a slight effect on the landscape and just like any other object in unreal I can duplicate this patch by holding down alt and dragging and we get another patch so I'm going to change the texture on this patch so let's go back to landscape texture patch to get the settings and instead of the mountain I will use this erosion High texture and place it right there so I like this one because I can basically make a valley right here so just scale this up scale that down and then make it so it encompasses this entire landscape now you will notice that the patch is now cutting into the other patch so in case you don't want that then within the settings right here scroll up to blend mode and select Max so this will make it so that the patches are better blending in with each other another change that I can make is that you notice when I lift up this patch it lifts up the entire landscape so in case we don't want that to happen come down here under zero height meaning and change this from patch Z to landscape Z so that will prevent the patch from elevating the entire landscape and if I select away from the patches if I ever want to select them back it can be really hard to find the origin point of the blueprint then I can come up to the outliner type in patch and then select the patches right here that is an easier way to select the patch I have this patch I'm going to make it really large but before I do let's go back into the texture patch settings and change this to Max and we're going to select the blueprint rout of the patch and then just scale it up to to make it pretty large and something cool about landscape patches is that if I go in with the foliage mode and I start painting a bunch of trees then if I jump back into the patch and I scale this up the trees will remain on top of it so it is a very non-destructive way to edit your Landscapes and of course you're not just limited to the high textures that are included in this pack feel free to download any High texture online or use high textures from other unreal Marketplace assets to add to the patch my favorite feature besides nanite is virtual texture blending virtual texture blending has been around for a while and I pretty much use it on all of my environments it allows us to seamlessly blend objects with the landscape it is best to show why it is great with an example so let's jump into the texture blending map and this is what we will see it's just a basic small landscape and in the middle we have some rocks but what's unique about these rocks is that they are blending with the landscape to see what the Rocks would look like without texture blending we can open up the material and then within the details panel scroll all the way down here and we have virtual textures if I turn that off then this is what the Rocks would look like if they're just placed on the landscape and obviously this doesn't look realistic we have a grass texture and then all of a sudden it just transitions to rock normally you would expect grass to grow on top of the rock where there' be a slight transition and this is where virtual textures come in handy they allow us to get that transition so before I jump into how we set up virtual textures because it is a process let me go over the different settings we have right here so first setting is the falloff if I want the transition to be longer then we can increase that to 200 so now more of the grass is on top of the rock or if I want there to be a sharp transition we can lower that to something like 10 so it's only a slight transition and of course we have virtual blend height which will increase the height at which that transition starts so we can play with the height and then we can play with the fall off we also have remove sides the reason why this is an option is because if I uncheck it then the grass would grow on this side like right here but it gives a really nasty texture stretching so by turning this on it will just remove it from sharp angles so we don't have that stretching and then we also have a noise texture which will add a little bit of noise to the fallof that's how the transition between the mesh's texture and the ground texture isn't that obvious because in reality the transition wouldn't be a smooth fallof you would expect to see little splotches at the landscape on top of the rocks and that is exactly what the noise texture will give us now I remove the virtual texture to show how we would set it up and do keep in mind that this is a process so first off you want to make sure that your project supports virtual textures so go into project settings scroll down here until we get to rendering right there and then make sure enable virtual texture support is turned on once it's turned on you want to create two virtual textures so I'm just going to create it here within this folder right click go down textures and select runtime virtual texture call this rvt height and then copy this crl c contrl v and call this one rptor material so the height of my landscape will be stored in the Heights and then the material of the landscape will be stored in the material and we need to jump into the height texture and change it to height so change it to World height and then for rvt mat we can leave it as base color normal roughness specular so all four these channels will be stored within this runtime virtual texture which is exactly what we need for a landscape now that we have our two virtual textures we need to tell unreal the area that those virtual textures will cover and to do that we need to come up to the add button go to volumes and then add in a runtime virtual texture volume at the very last one right there and drop it into the World Press G that's how we're actually able to see it okay here it is and we're going to scale this up that's how it encompasses the entire area that I want want captured now instead of scaling up I will have unreal do it automatically but before we can have unreal do it automatically we need to First assign it a virtual texture so let's first do the height so drag height right there and now that I've assigned it I can select a landscape so select the Picker icon and select the landscape and then press set bounds this will automatically scale the bounds that's how it encompasses the entire higher landscape now in my opinion I want to make this height taller just in case if I go in with a sculpt brush and I sculpt above the bounds then that means our virtual texture is no longer capturing that part of the landscape so to make it taller within scale instead of 1300 let's make this 10,000 okay that's better now what I will do is contrl C and control V this so we're duplicating it that's why we have another bounds on top of the previous one and this one instead of capturing the height we will capture the material and notice how both these virtual textures are black that means it's not capturing the landscape just yet because I have to tell the landscape hey these two virtual textures are trying to capture you I know there is a lot we have to do to set this up but trust me it is worth it so select the landscape scroll all the way down till we get the virtual textures we need to add in two so press the button twice and it will be the two virtual textures we already have so height and material and now if I save it we can see in the previews that it is capturing the landscape so now that our runtime virtual textures contain our landscape data we need to put this landscape data on top of any meshes we want to blend with a landscape and by default most materials aren't blending with virtual textures so let's go ahead and let's open open up this rock material which is the default Mega scans material instance we need to open up its Master material all the way down here and this is what Mega scans will give you for your basic Assets Now I want to add on at the very end of this material graph a function that will overlay the virtual textures on top of this material and luckily for you I've already created that if we go into landscape material functions it is MF VT blend so just go ahead and drag that in and it is asking for a material attribute which is good because that's exactly what this line is so all I have to do is plug it up like this and that is it now in case your material looks like this which is the material we created from the starter course what you want to do is right click and go make material attributes and then you're going to hold down control and then drag those lines into the make material attribute so go metallic to metallic roughness to roughness and normal to normal right there and now the output will be a material attribute so Within These settings for this material select use material attributes and then we can hook it up right there and this just gives us the ability to add in the MF uncore VT blend right here like this to allow this material to blend with the landscape once we add in that blend it will give us a new Option within the material parameters down here called virtual textures we can just enable them right here by pressing that button now the mesh will turn black don't worry that's just because we need to put the virtual textures we created right there so let's go to where the virtual textures are drag height into height and the landscape into landscape and there we go now we have a working blending object so that is the process to enable virtual textures I know it is a lot but it is worth it I used it heavily in this Creek build so if I hide the foliage we can see that all the static meshes especially the natural static meshes are blending in with the environment it looks very natural for these meshes to be here and then as soon as I turn off virtual textures all of a sudden these assets look really out of place it is noticeable that I'm just plopping down at different objects that aren't related to each other so virtual textures really allows realistic asset placement that blends with the environment which you can turn an environment from looking like this to this and finally the last feature is procedural foliage it gives us the ability to dynamically add objects on each of our layers so we don't have to use the foliage tool or manually place them so our grass layer can spawn grass and our Cliff layers will spawn rocks automatically to show off the landscape procedural foliage tool I am back in the creek world and I got rid of the law the small objects so there's no grass flowers ferns or Pebbles instead all that will be handled by the landscape and you might be wondering why I also didn't get rid of the trees and that's because trees should still be handled by your traditional foliage placement since the assets placed by landscape do not have collision and also the way it works is that it spawns in assets that are close to the player so if we have grass that is all the way over here it won't be spawned in and we want to see trees everywhere and if trees are being handled by the landscape then it's going to be noticeable when they're spawned this procedural foliage tool should only be used for really small assets like grass Ferns and Pebbles to start adding the foliage assets if we go into the landscape folder which is the folder that we migrate into all of our projects and then go into materials we have this folder called landscape grass and it is here where we Define what objects should spawn based on the layer so our grass right now is layer a so I could double click on this to get the layer a procedural Foliage for example if I want to spawn ferns on my grass then I can press on the plus button and within the drop down let's select burn and we also get a bunch of other settings feel free to play with them and see which settings you like really the most important setting is the grass density which controls how many assets are spawned so now that we have this selected if I move this off to the side you notice that there are no Ferns and that's because within the auto material under foliage you need to make sure material a is turned on and then press the on button right there and now we get a bunch of fern everywhere and honestly this is too many ferns so we can bring that down right here to let's try 10 okay that looks like a better amount and if we want to vary the size of these ferns that's how some ferns are small and others are larger then down here we can make small ferns let's go 0.7 for smaller and then the largest ones can be something like two so we get really small ones and we get really large ones also the reason why I have this mannequin in here is to make sure that the sizes of the foliage makes sense so in this case it doesn't really so let's bring that down to 1.25 okay that looks a little bit better and of course we need grass on this landscape so let's go ahead and add in another one by clicking the plus button again and then down here we will select grass Clump and now we have a bunch of grass everywhere and this is all spawned automatically and you'll notice that this is only being spawned on the ground grass layer it's not be spawned on this layer or it's not spawning in the middle of a pond which is using this Pebble layer and this is all Dynamic so I notice that the grass is going into the water that's not supposed to happen so by jumping into paint mode I'm able to paint away that grass by painting in the pebble layer just like this and it is all highly Dynamic and each of these layers can have their own set of spawnable meshes I went on to fill out some of the other layers and I also added more meshes to grass so now we have a little bit of rock spawning with grass also dead brush and different variations of the grass that are spawning and if we come over here you'll see that for the C layer we have rocks and twigs spawning so each layer has their own set of meshes being spawned and let's say we don't want foliage being spawn at a specific place like this road which is currently being covered then we can go into landscape mode paint and down here we have foliage remover so let's create this layer by clicking on the plus button and make sure you select non-weight Blended layer instead of weight Blended layer normal which is what we would use for the other layers so select non-weight Blended layer save that there and now in order to get back my path that's how there isn't grass and rocks in the way of where people would normally walk I could paint it down and now get rid of that actually let me go increase my tool strength and also increase the size so now I'm painting away that foliage to make room for where people walk and if I ever paint away too much foliage to get it back hold down shift and then start painting to bring back that procedural foliage so this is a really cool way to get a a bunch of meshes onto your landscape without having to use the foliage tool or manually placing it often times when creating a landscape you want the foliage to be the same across the world and also different for each layer this is an easy and quick way to do it automatically this tutorial only covers how to use the landscape material not how to create it from scratch if you want to unlock the full potential of unreal then you could check out the unreal masterclass which is a collection of exclusive courses I made made for u5 there's an advanced material course in it where we build the landscape material from the ground up if you want to take your own real skills to the next level check out the masterclass link in the description that is how you use this landscape material it makes the process of creating environments a lot easier and it is a lot faster than creating your landscape material completely from scratch have fun with it and I will see you in the next video
Info
Channel: Unreal Sensei
Views: 51,552
Rating: undefined out of 5
Keywords: Unreal Engine 5, UE5, Lumen, Nanite, UE5.1, Unreal Engine 5.1, Foliage, Landscapes, Epic Games, Unreal, Engine, Tutorial, 3D, 3D Game, Game, Development, landscape, landscapes
Id: 5ju7wyvZGBI
Channel Id: undefined
Length: 59min 49sec (3589 seconds)
Published: Wed Nov 08 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.