Landscape Material Tutorial Part 1 (Unreal Engine 4)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Thank you for sharing!

btw your character models look amazing!

👍︎︎ 2 👤︎︎ u/nitoso 📅︎︎ Dec 06 2016 🗫︎ replies
Captions
everyone my name is Lucas Colts and one of the arches he had mind games interactive and this video is going to be a short tutorial about our landscape material that we see in the viewport right here we released a short entry on our dev blog last week actually our dev blog if you want to take a look it's saying the game dotnet will share a lot of information about the game we're going to be working on and one of that is that breakdown that we shared and a lot of people requesting a video tutorial for it so that's what this is going to be it's probably going to end up a multi-part tutorial first part is going to cover the basic material creation and how to create a layer for it and the second part is going to cover how to add the potholes on top of it and I'm not sure yet where I'm going to add the distillation the strong parts about this material let me give you a quick rundown of what's going on here is that we have multiple materials blending on top of each other using a head height map and procedural puddles that get layered on top of it all of them we have displacement so take a look at our where via frame it's really dense it's because we're using dynamic translation you can see how it fades out ignore the yellow lines it's just it's just a skybox in the background so if you get closer you can see how the grid gets finer that's the translation at work and we of course also displacing that base on the terrain height map so let me quickly demonstrate of course the the blending works as you would expect it to do to work put in the value of one so actually something's changing let's paint in some mud and for the puddles and of course remove them and then we can add them in again as you can see I can just paint them in Andheri conform to the under the underlying height map I don't have to worry about one where we have where should I place puddles it's just regular paint painting them on top and then we have quite a few quite a few settings in our material instance we can use to influence these so and see we have we have the basic settings for roughness and tiling of different materials and then we have some settings for tessellation and this is the interesting part the paddles we have of course the paddle size so if you increase this actually make some smaller split backwards you might change that in this tutorial and then the way around we can increase the size of these puddles or just Riku and we also have a color which is laying the deft opacity so if I change this you can see the color changing on the dirt I undo on the puddles and let me just leave it a crazy color like that so that I can show you what the Deaf does because this one basically just defines how much of it is going to get this color so when I paddle is deeper it usually ends up being harder to see through so we change the color and the opacity is basically the same thing just not depending on the distance between the surface and terrain underneath of the item well it's basically just working with the texture right but you get the idea so let's change this back to reasonable color and let's get started so let me change my mode I can actually select something and let's do this over from scratch so creating a new material owning it and scape material and I call it tutorial so just so that I know what's going on here let's open that up so first thing we're going to change is we're going to click in an empty area go to scroll down a usage make sure we're selecting used to landscape sickness saving a loading or compiling processes are going to take really long I'm just gonna cut the video real quick so and now to actually see something on this material let's bring in some textures already prepared some I'm just going to use the same ones I used for this material there's actually more texture Center actually used but for now let's just take our dirt layers bring in your textures let's look on and I'll give you a quick run-through for how these all these textures are set up this is April albedo texture or your color texture and that's basically all it is it's actually not completely true because in albedo texture wouldn't have any shadow information and as you can see there is some ambient occlusion information in here that's just because that's this basically an artistic choice because I like to cheat cheat a little we found that the ambient occlusion slot in the material in unreal well it's only supposed to work on static lighting and on the side doesn't receive light but we find it just almost nothing so what we end up doing this make some of that ambient occlusion right now I'll be doing up making kind of a diffuse map I guess but we are very careful about it it's more like putting the curvature with a really low opacity on top of that so we get a good balance I guess that doesn't look off in game under different lighting conditions but you might want to avoid that if you're going for a true albedo map then if a normal map and that's a pure normal map make sure it's set to no map in the compression settings and we should do this automatically but just make sure it is and then this one is interesting you can set this up in a different way but the way we have it is we combine three textures in one we use the channels so in the red channel we have our roughness the green Channel we have our height map information and in the blue Channel our ambient occlusion and some curvature later on top of that and for a texture like this where you put different but different textures and different channels make sure you set your compression settings to masks otherwise it's going to use as rvg compression and that's going to mess it up so what we're going to do now is real basic with the color and the base color normal map and the normal map and then for DS masks that's where it gets a little bit interesting we have our roughness and the red Channel if you remember we could just plug this into the roughness but what I'd like to do is use a alert node you get your plate use it as an alpha and use two constants between 1 and 0 put that in the roughness later on we can convert these into parameters and then adjust through our roughness value our Max and min roughness value between which we learn with that alpha in in runtime why we actually see the material which is really handy I think and we have our height map in the green Channel we're just going to ignore it for now we have our ambient occlusion the blue Channel so another thing that's really important here is actually mapping this material to our landscape properly what we're going to do for that is we need to set up some movies we're going to use the word position so absolute word make sure you don't put absolute in your search because it's not going to give you the results you need to put in world position and from this note what we're going to do is we're going to multiply it and if you haven't used the material editor and angry all that much the way I get these notes it's just pressing and holding one and then pressing on the canvas if you do this with a number keys from 1 to 3 you get one two and three vectors let's put our tile into one and just plug this into the UVs oh yeah right so multiplying our absolute world position with one is something we just do so that we can adjust tiling of our textures with a param parameter and it's going to give me an error because I actually forget one step and this actually gives us a free vector this node and we only need two vectors for our UVs so let's just use a component mask for the RNG channel and they would like this rather sharply gone cool let's convert this one to a parameter let's call it tiling and then let's save all of this this might take a moment because in its compiled shaders there we go now let's actually take a look at our work actually let's create a material instance of our material so that we can adjust our parameter apply to do landscape and it's just going to end up a brown mess that's my guess let's take a look like I said it's a brown mess and that's because our tiling is probably way too high at a value of one so let's put in something like this perfect nailed it on first try no I knew it the tiling value from the other material I set up before so we can actually see our and scape properly this is already looking really nice of course the result here is going to depend on your Texas and your Texas alone and what we're going to do now is add more material layers to this so let's put this right here and go in here we could just go in and add our other textures the same way and then blend it but what I like to do to kind of leave this in a clean state is use material functions as material layers and then blend them it also makes it easier to set it up so economic content browser create a new folder let's call this material layers I already have one like that because this material is already set up so I call it tutorial now in here so right click materials and textures interior function and let's call this dirt material layer and I call it tutorial so this is going to be on the arrow material layer let's open it up so I look like looks like if you haven't worked with material functions before they always give outputs and that's just a node like that and what we're going to do now is just go into our material that we already setup take all of this troll C to copy it ctrl V to paste to do ignore the output Russell - now we want to do now is take our color and get them make material attributes note that looks more like what we're used to from the usual material editor so we have our base color over normal map if our roughness and and we can practice make material attributes into our output wrestled something else we need to change is we want all our material layers to be influenced by this part right here so what we're going to do is get rid of this node and instead or actually let's leave it there but let's get an input so now if you search for input we get function input it's not like that that's what we want this is basically just these are going to end our base input pins narrow material layer where we can put information right into here and you can change if you have two node selected if it's a scalar two vector free vector or texture answer free vector actually only need a two vector because we just want the UV coordinates so let's put this in here just as a preview value so we can actually see over here what's going on this is will have no effect whatsoever on the actual material and if you want to you can use this as a preview value as default then it's not going to give you any errors when you don't have anything connected to this input but I always want to have something connected I want the engine to remind me if I miss to do so so I leave this empty and when we plug this back internal multiply so why I'm still connecting this to a multiplied with our tiling is so that I can tile the material independently of the overall tiling of the whole landscape material if you don't need this mask anymore because this already is a 2 vector now and what I would like to do now is set up some more of these outputs so for the metallic don't really need to zero I just like to do it because it reminds me of what's going on then I like to add another one for you specular this one is going to be 0.5 them and since this is a material function we can just convert this to a parameter as you would normally do in a material need another input let's create a function input let's put this as a review let's use the previous default value and actually let's get rid of it completely and put this value in right here is a scalar value and our specular so let's name it that way so now we have our specula set up and can change this later on specter of 0.5 should be fine for almost any material but just to make sure I like to add it this way we need to add more inputs for our roughness and I just like to copy this one place it once call it roughness this is our minimum roughness it's also default at zero places this knob copy this paste it this time it's our roughness Max and it's at 1 let's replace this value right here and now we have our roughness setup and can change it on the material function let's connect our ambient occlusion and for a height map value which is in the green channel of this mask texture right here we could use our word displacement which is where it's going to end up with but what I found is that using the wordt displacement doesn't work that well with what I'm going to do with this value because I like to use this s masks or blending these textures and also for the procedural puddles and using the word displacement node I'm not really sure what to make material attributes to us to this value but and I think it it converts it to a free vector it doesn't stay a scalar parameter so what I like to do is I like to create another output a function output of course so we get another output wrestle like this one let's call this one height let's plug right in there so now we actually keep this scalar value and it doesn't get converted to anything we know what's going on with it this is just a separate output okay that's everything we need to do in this material so let's save it and actually close this and now let's take this material layer we just created and drag and drop it into our material now landscape material as you can see we set it up probably I think so we have our in for our a UV coordinates if our roughness set up and our specular actually we missed one thing so let's double click it to go under our tiling is still a parameter and of course we need an input so let's add another input call it tiling such as 2/1 and let's plug it into here and while we're at it we might as well just call this movies so it doesn't just say in save it and for some reason sometimes these stoned update so let's get rid of it just drag and drop it in there one more time there we go now we have to tiling and these are called you've ease with our height and our material outputs that's what we wanted let's take our UVs and plug them in here don't need a mask and let's create some parameters so the first one is going to be the speculum which if you hover over it we can actually see the default value that we set up and we want to have the same thing and let me just place this copy and placer give a roughness min0 Oh change both of them oh so we need to change the name first or it's going to change the value of both of them they could have a typo here in roughness please ignore it which is zero look it in here let's copy and place it a roughness after name it 'first roughness Macke at one look under and finally our Tyler and for this we actually need to F a group because we already have a tiling over here let's put these into the same group let's create a group for this one too it's called this one main actually need individual names for these even if they're in different groups so let's call this tiling dirt let's set up these the same way let's call them dirt just so there have individual names and won't overwrite each other when we have more layers in here there we go now we can she go in there and remove all of this so we won't need it anymore take our landscape material and if we click this we can actually use material set it to use material attributes over here kind of gets compressed into this one node can just plug it in like that apply this and save it this might take a moment because it needs to compile the shaders there we go now if you take a look at our material it's still working which means we did everything right so we now have a material layer instead of the whole set up right here and that's plugged into our material attribute let's go in there and create another layer and for that I'm just going to copy or duplicate this layer and let's call it mud so let's open our Muttley let's replace these textures so after min the same directory I'm just gonna browse for them in the content browser and somewhere in here I should have my mud dirt grass mud dirtiest let's take these and drag and drop them in here so let's rewire these pins you didn't know if you just hold it ctrl while dragging them you don't lose them so holding control drag and drop them over here over here is you're just replacing all of these textures to MoMA changing anything else there we go created a separate but you layer form up and now we can go into and take our mud material layer drag and drop that and shower let's get material put the UVs back in here also let's comment this a little bit just to keep it clean so comment shortcut C on the keyboard or call this UVs let's call this dirt and let's copy all of these because we have two exams same parameters and let's rename it them to mud the group let's lock them into the inputs it's common to mud and now we're getting to the interesting part which is a adding a blend so we want a landscape layer blend and it doesn't have any inputs because we don't have any layers set up over here so let's add three layers actually and what free layers if you only have two at the moment and I explained it in a second let's name the second one third the third one mod and the first one du Nord and use why don't we said that set it up like that because if we're using a lot of layers and you shouldn't do that but if you do at some point under is gonna stop compiling this material and it's going to give us errors when we paint in the different material layers so if we want to use a lot of layers we need to set this up in a way that I guess it kind of tricks unreal but whatever it works so this first layer do not use it's going to use a alpha blend and second one ordered layer which is going to be our base it's using a weight blend just make sure one of your other layers is using a weight blend or you're going to get black areas on your material a third one is going to be a height blend and all of the other layers we're going to add on top are also going to be height blended like I said just make sure you have one layer that's not going to be used with an alpha blend in one layer that's having a weight blend so that you can don't get any black splotches because it's just going to use all of it actually let's input a probe you weight off one on our third layer and now let's take the result right here put it into our dirt and let's use the result over here and put it into a mud and it's used to hide to enter the height for mud you needed a separate height node or mud because this one is going to be height blended we can take to wrestle I plugged it into amateur attributes it supplied us when something that I forgot if you're going to use a light blend layer blend with a lot of different layers and you're going to use tessellation and stuff like I said you might end up getting compiling errors or just a material not compiling at all if you use too many layers on a single patch of the landscape and to avoid that we need to still not use layer and also in our material function it's going here or texture samples we need to change the simpler source at the moment it's from texture asset let's select all of these I change it to chair wrap it's going to make sure that they still compiling saved us we need to do this for all our material layers so also do the same thing for the mud layer there we go now this is compiling a lot of flavors so I'm going to save this and I'm probably going to cut this section out of the tutorial so while this is still compiling we can actually go back in you and go into landscape properties also if you haven't created a landscape yet and you actually should do so sorry so let's get rid of this landscape and it starts over right because I actually haven't shown that so on the landscape and create a new one you can actually select our layer our landscape material already and my computer struggling for some reason there we go put that in here and select how big you want it like this should be fine for our purposes and now let's create it okay so under paint you should see these free layers the do not use dirt and mud Lane but I still don't have any target layer information still size none so we need to create some so pick this little plus icon and for the tune abuse layer we want non-white blended and then just put this in whichever folder you want it I have it in this one now to use landfill it's fine I might want to remove this exclamation mark I'm not sure if it's going to cause any problems so I remove it and dirt we basically do the same thing but this is going to be weight blended really sorry for all these like this this looks really messy but this is our whole game right so it's a little bit more to that and then the same for the mud also white blended there we go we have three of them created and now the still not use them we're just gonna ignore it forever very clear you can paint that of course and for the third layer what we want to do we actually want to paint all of it since there is no flood option we're just going to do it the brute force way make a really big brush and just paint all of it let's get beggin ear and the big change in color is because of the post process volume that I have set up around here you are wondering what's going on there and now we should be able to pay them some map and we are let's remove this fall off there we go and this is also already height blended so it's amazing that's exactly what we wanted and that's actually everything for a this part of the tutorial the next part we're going to add adults on top of this that are going to be a completely procedure and we're also going to add some tessellation so that we get those nice height differences relation based on the distance to the camera and of course it's gonna displace the geometry depending on the height map that we already set up be sure to let me know in the comments if you didn't understand something or if you have more questions also if you have ideas how to improve these videos because this is going to have another part and we're probably going to create more tutorials as we go along and be sure to like and subscribe if you liked the video or if you're interested in seeing the second part in the series and I guess that's it for now so see you then bye bye [Music]
Info
Channel: Lukas Kölz
Views: 273,522
Rating: undefined out of 5
Keywords: Unreal Engine, Tutorial, Gamedev, UE4, Landscape Material
Id: NAJhppttJgI
Channel Id: undefined
Length: 35min 34sec (2134 seconds)
Published: Mon Dec 05 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.