Frame at 0.00s

Today, I'm going to show you the basics of working with terrain in Unreal and Unity. Let's go! Alright, so we're in the middle of a series of videos about terrain in Unity and landscapes in Unreal. So far, we've created all kinds of techniques for creating realistic and optimized terrain shaders. But in the comments, several of you asked if we could go over the basic steps for using the terrain systems in general. So that's what we're going to cover today. All right. Now, if you're building a large outdoor environment, you need a way to create the ground in that environment. And that's what terrain systems do. They allow you to sculpt the shape of the landscape, paint materials on the landscape such as grass or dirt, and then add small details to the landscape like pebbles, blades of grass, or ferns. They also enable you to add larger details like trees. Terrain systems are designed to make the process of creating the terrain fast and easy. So let's get started in Unity today, and then in a few minutes we'll switch over and I'll show you how to do it in Unreal as well. Now before you begin, you need to make some type of a plan. Draw a top-down map for yourself that indicates where your major landmarks are going to go and figure out the size of the terrain that you need. Because as soon as you jump into the game engine, the first thing that it's going to ask you is how big do you want this terrain to be? And if you get the answer to that question wrong, later on you're going to have a major hassle on your hands redoing a lot of things. So you want to make a plan to begin with. A big mistake that some people make is to just jump right into the engine without making a plan first. So if you have no idea how large your terrain needs to be, you'll probably make it too big or too small. You can skip that planning step if you're just learning how the terrain system works and you want to sort of do some practice exercises. But if you're starting to build your world, you definitely want to make a plan first. All right, so let's go ahead and make a brand new scene and I'll show you how to get started. So I'm going to come down here to this new folder that I created called Terrain Basics. and I'm just going to go file new scene and we're going to create an outdoor scene for URP. So here's our brand new scene. I have a camera. I have a global volume. I have some lights and some geometry. Let's select our geometry here. You can see that by default I have a plane and I have this material ball here. I'm just going to delete this plane because we're going to make terrain for that. So the next thing that I need to do is right click in here and pick 3D objects terrain. And it's going to create a terrain for me. And the interesting thing about how it creates the terrain to begin with is it puts the corner of the terrain at the point where my camera is or at the origin. And that's actually not what I want. I want the terrain to be centered at the origin. So the first thing that we need to do is resize it. Now when you're working with terrain, let me just make a little bit more space for us here. When you're working with terrain and you have the terrain selected in the hierarchy panel, over here in the inspector you'll have this series of buttons. Oh you know what, before we talk about those buttons there's one other thing that I want to talk about, and that is the Terrain Tools package. So what we need to do is come over here under Window, Package Management, Package Manager, and I'm going to select Unity Registry and scroll down to Terrain Tools, and I need to import the Terrain Tools. Now on my machine, I've already done it so that import button doesn't show up, but I need to make sure that Terrain Tools is imported because that is going to bring in a whole bunch of new tools for working with terrain that significantly increase the power of the terrain system in Unity. So make sure you have terrain tools imported or your user interface is going to look a lot more simple and it'll be missing a lot of the things that I'm going to show you today. Okay, so with our terrain selected, you can see if we come over here under terrain we have a bunch of these tabs across the top of our control panel. This first one here is for creating neighbor terrains. Now by default our terrain just has one large tile but you can see that there are outlines that stretch off into the distance here which indicate that I could add neighbor tiles and that's a really good way of working with terrain if you have a very large terrain. By default, our terrain is a thousand meters by a thousand meters and just one single tile. And a lot of people make the mistake of just leaving their terrain that way, but I believe what you should actually do is make the terrain tile smaller and then add new tiles as you need them. So let me show you how to do that and I'll get to that in just a minute. The next tab here is for painting terrain, and this one is for painting the shape or the height of your terrain, and also for painting materials on it. And then we have two tabs here. This one's for adding trees, and this one's for adding details like grass and pebbles and ferns and that sort of thing. We're not going to cover trees and details today, but we may get to them in next week's video. And then this last tab here is for settings. and I believe that the first thing that you should do after you create your new terrain is go to this settings tab and update a couple of the settings because it defaults to some settings that I believe are not as good as they could be. So what we're going to do is I'm just going to show you these settings. So the first one is terrain width and terrain length and it defaults them to 1000, meaning your terrain is a thousand by a thousand meters. And like I said, I really believe that terrain should have small tiles. So I'm going to make my tile 100 by 100. And there you can see, you can actually see the boundaries of it. And if you need more space than that, what you ought to do is add additional tiles. So if you kind of get to the edge of it and you find out, oh, I need to build a section that's further that way, and I don have enough then you can come over here to this Create neighbor terrains and just click and add tiles right next to them so that you can continue expanding your terrain If you just create one really big terrain, then it's a lot harder to work with and there are certain features that don't work as well. So what I'm going to recommend is that you create smaller tiles like 100 by 100 meters and then add new ones as you need them. The next thing that you want to do is control your terrain height. And this is the maximum height and depth that you're going to go. So by default, it's 600 meters. But if your tile is only 100 by 100, the maximum low all the way up to the maximum high is probably not going to be 600. And so I'm going to decrease this one as well. and that's going to give me a little bit more precision in my height map because the maximum range of my height map is only going 400 meters instead of 600. So I'm going to set this to 100 by 100 by 400. And then I'm going to come down here to the resolution. So I have my height map resolution currently set to 513 by 513. and this is controlling the number of pixels in my height map. And what this means is that I've got about 5 pixels per meter because my terrain is 100 by 100, and then it's 500 by 500, so about 5 pixels per meter, which is a pretty good detail. Now, controlling these is determining how much texture memory my terrain is going to be using, And so the lower I can go to get away with, if I can get away with like one texel per meter, if I set this to 129, that's going to use significantly less texture memory. 512 is probably a pretty good spot. So that is controlling the height map or the shape of the terrain, how much data I'm using. And 513 by 513 is very reasonable for that. All right, the next one here is the control texture resolution. And the control texture is the mask that's determining where my materials are going. And so the amount of definition that I need for controlling the boundaries between my grass and dirt and rocks and that sort of thing, that's what the control texture resolution is controlling. and again 512 is probably plenty but if you find that you need to increase this later on you probably can do that just fine and then the last one here is base texture resolution and that is the amount of detail that is included in the terrain in the distance the terrain system actually has two different render systems one is very detailed for close up and then one is basic and cheaper for rendering in the distance. And you can control where that basemap distance kicks in with this basemap distance slider up here. So what I'm going to do is set that to 50, so that 50 meters into the distance, like the first 50 meters around the camera are going to be nice and detailed, but then further away, it's going to switch to the simpler, faster to render detail map. Now to make that detail map look nice, I can increase the amount of memory that I'm using to render that detail map. And I'm going to set that to 4096 by 4096. And that's going to make it so that, you know, my terrain will look really pretty here close in the foreground, but then it'll switch to a background cheaper version into the distance. Okay, the last thing that I want to do is center my terrain in the middle. So I'm going to come up to the position here, and I'm going to set it to negative 50. And the Z, I'm also going to set to negative 50, so that the center of the terrain is right in the center at the origin and it's no longer at the corner like it was. I always want to center my world around the origin so that I can have the maximum amount of precision possible because the further away from the center I get, the less precision in floating point numbers that I'm going to get. So if I work centered right around the origin, it'll ensure that I have the maximum amount of precision. All right, so I've got my terrain all set up. The next thing that we want to do is talk about painting height. So I want to come here to my paint terrain tab, and I want to drop this down and pick a raise or lower terrain. Now all of the tools under this paint tab use brushes. So let's talk about brushes for a minute. There's kind of this palette here of brushes and they use images. This one is a nice kind of Gaussian fall off and it has a nice soft edge. This one has a hard edge. And if I select that, if I put my mouse over the terrain, you can see that hard-edged circle. And if I paint, wow, that was a little bit too strong what I just did. So what I need to do is change my brush strength to something very small, maybe 0.01. And if I just click here, you can see now I've raised the terrain just a tiny bit. And as I keep clicking, you can see that I'm changing the shape of the terrain. so I have this value slider called brush brush strength and if I slide it there's a visual indicator of how much it's going to affect the terrain so the stronger I make this brush the higher it's going to raise the terrain on each click and so I probably want to keep it kind of around 0.01, just so that it's not too powerful. And then I can control the brush size with this slider here. Right now it's around 2 meters. By the way, this checkerboard is set to be a meter, so every square of the checkerboard is a meter. And you can see my brush is about 2 meters. I can increase my brush size so that I can paint really large areas like this, or I can decrease my brush size so I can paint really small areas like this and it looks like the smallest I can go oh it looks like it about a meter so I can paint just really small details all right and then some of these brushes have images Like if I pick this image here let just make my brush kind of big And you can see I'm now painting an image. Let's make it a little bit larger. So if I click, you can see that I've kind of got this image going on. And that's an interesting effect, but probably not super useful for everyday use. Usually what I do is I just use this Gaussian falloff brush, and that's kind of like the most useful, best for general use kinds of things. But I can control the rotation of the brush if I have some kind of other image. Like if I'm using this star, for example, I can rotate this star and get different star patterns. But for natural terrain, that's probably not super useful. Then, you know, as I drag this, you can see that it kind of creates these shapes like this. And this scatter setting here, scatter and spacing, are going to control the amount of space in between each stamp. So when it's set to zero, it just stamps like an infinite number of times as I drag. But if I want it to kind of be spaced out a little bit, I can add that. And then it's going to stamp down just every couple of units as I paste. Again, not super useful. But I just wanted to kind of go over these brush settings here. So we have strength, size are the two that you will most frequently use. and you can also set them up here. So here I have brush opacity, which is the same thing as brush strength. Here I have brush size and I can reduce the size here. Just like I do down there here, I have brush rotation, spacing, scattering. So all the same settings that are over here are also showing here at the top. And the reason that that's there is so I can work with the scene maximized and not need to use that inspector view over there. Okay, so generally what you do at this point is you want to block in your large terrain features first. And so you set your brush size to something kind of large, like maybe 30 or 40, and paint in where your mountains are going to be and paint in like streams or rivers and then that kind of thing. So you start out with a large brush and then as you work your brush will get smaller. So you want to paint all your large details first and then make your brush smaller and start painting tiny like well not tiny but more detailed things kind of in another pass to put in medium-sized terrain details. And then later on in the project, as you get more detailed, you'll make a smaller and smaller brush and start dealing with really tight close-up details. But you want to start big and then get smaller as you work. Now I want to show you something that's interesting about the terrain, and that is here it says hold control and click to decrease the height. So if I hold control and click, you can see that nothing is happening. And that's because this terrain is at zero. And it won't let you paint the terrain below zero. And so a good thing to do if you know that you're going to need to carve things in and push your terrain down, a good thing to do is to use this mode called set height. And here you can set the height of your terrain. I'm going to set the brush size to something really big, like 40. And for brush strength, this is going to be the height that I'm going to set it to. So I'm going to set it to something like 15. And now when I paint, my terrain is getting raised to exactly 15. It won't go any higher or lower than that, But everywhere I paint, it's going to exactly 15. And so now, if I just kind of paint the entire terrain, I'll have it set to a value of 15. And now, if I set my terrain tool to raise and lower terrain again, and I hold down control, now you can see it's reducing the size. I can't go any lower than zero, but now that I've raised it to a certain height, I can take it and push it down. So you have to push it up first before you can push it down. So at this point, you're going to go through and sculpt your terrain and add in all of the features that you want, rivers and canyons and mountains and that sort of thing. There are two ways of creating the terrain, by the way. You can paint it by hand and raise and lower and sculpt things like this. Or you can create a height map in another piece of software like Photoshop or like some kind of external system for generating terrain. And then if you come over here to the terrain settings panel and scroll down, you can see there's this section for importing raw. So if I create an image that's 513 by 513 in some external software, I can then use this import raw to bring that height map in and apply that height map to my terrain. So if I have software like Gaia, for example, some software that's dedicated specifically for generating terrain height maps, I can use that and then use this import raw feature to bring my height map in instead of painting the terrain inside of Unity myself. All right. So that is the basics of creating the terrain shape. Now I want to show you the basics of creating terrain materials. So if we switch over here to this paint tab again, paint terrain, then I'm going to use this drop down and I'm going to pick paint texture. So right now when I first create a terrain, it doesn't have any materials or textures assigned to it. You can see if I scroll down here, I have this, it says list is empty. this is where my terrain layers go and I have buttons here for add remove and remove selected so what I need to do is create and add some terrain layers and if you just starting out and you don have any terrain layers created yet and you just want some to play around with if you come up here under Windows, Package Management, Package Manager, and pick Terrain Tools, there's this button here for Download Asset Samples from Asset Store and also Download URP Demo Scene from Asset Store. both of these two sets of assets will bring in some terrain layers for you that then you can apply you can use those to apply to the terrain well i happen to have some terrain layers already so i'm just going to use those but if you don't have any that's what you could do you could use those two import features to bring in some some terrain layers so i'm just going to click add layer and here I have some layers added already and I'm gonna pick this dry soil layer let's see let's just add dry soil and now you can see since I have one layer it's applied this dry soil material everywhere to my terrain because that's the only layer that's available and if I add another layer, let's add the ground grass layer. And now I can select between these two, and if I click and drag, it'll paint that layer onto the terrain using the same types of brush tools that I was using to paint the height. So I have brush strength, for example, and I can crank that up and paint it, you know, really strong. Or if I just want the effect to be subtle, I can turn the strength down and just paint really subtly onto the terrain. And I can also add in more layers. So here I can click add layer again. And this time I'm going to pick this ground rock, grass, fells, dirty. And then I'll add another layer. And this time I'm going to add our stone ground. So if I select stone ground and then paint, you can see now I'm painting in the stones. And if I select these layers, these layers have properties. So here you can see layer properties and it's currently collapsed. But I can open this up. I have my stone ground layer selected. And here, down here, you can see I've got the size, which is currently 3.7. but if I wanted to make the details smaller I could set this to one for example now you can see I have these really small stones or you know I had it set to 3.7 before so I can use this to determine the size of the details of the layer here I have the textures that are applied to the layer here I have the strength a setting that controls the strength of the normal map so if I set this to something like eight, you can see that now my normal map is really strong. Maybe we'll set it back to two. And I can also tint the material. So if I knew I wanted my cobblestones there to be red, I could add a red color like this. Now these settings are things that you have to implement in the shader. So if you're using a custom shader for your terrain, you have to be sure that you go in and implement these color settings. And I can show you how to do that in a future video. I'm not going to show you that today. I do want to show you one other thing though. Here I'm going to come up to my tabs and go to my terrain settings. And here is the material that I'm using for terrain. And by default it's set to terrain lit. And that shader is written in code. It's one that comes with Unity, but it's also possible, and I've showed this a lot of times previously in this series of videos, you can set this to be a shader graph shader. New in Unity 6.3, shader graph is supported on terrain, so you can create your own shader graph shader. And kind of the point of all of the videos in the series that I've shown before now, before today's video, have been to show how to create a shader in Shader Graph. But by default, it's just set to Terrain Lit. And you can, you know, very happily use Terrain with Terrain Lit. Or you can create your own and add new features and create optimizations and make things better if you want to use Shader Graph. You can totally do that. And if you want to, I've put the link down in the description to all of the previous videos in this series, the whole playlist that'll show you how to create your own custom terrain shaders. Okay, so I showed you how to sculpt the terrain to raise and lower the height. I showed you how to paint materials onto the terrain. I showed you how to set up layers here with different terrain materials in them and then paint. One other thing, this terrain material that I have applied allows me to set if I want to use height-based blending. So if I turn on height blending, now my terrain blending, you can see it has that really hard edge, but it's using the height map in the material to blend the materials together. And so you can see if I just slowly paint here, it's going to blend the materials based on the height. And I want to set this transition to something that's not quite absolutely zero. You can see as I scrub this, it's kind of going from a smooth blend to more of a hard height-based blend. If I set it to zero, the edge between the two materials is going to be absolutely hard. But if I send it to something slightly more than zero, it'll have just a little bit of a smooth blending there. And I can blend my materials into each other based on the height. You can see that the tall cobblestones are the ones that stick up first. so as I kind of click here and blend these two materials together there's just kind of a more natural blending that I get because the high parts of my material are what show first. So if I were to look at this mask that I'm painting you would see here it's going to be white for my cobblestones and black for my cobblestones but then there's kind of like a smooth gray gradient. And as that gradient gets applied, it's using height based blending so that the tallest parts of my material are what show first. So that's how height based blending works. It does cost a little bit more, and here, I can turn that off, but you can see it's a little bit less natural looking when the materials are using sort of transparency or alpha blending to combine with each other. So I like to use height-based blending just because it looks a little bit more natural and nice. I think that's about it in terms of our terrain tutorial for today. Let me see if there's one more thing that I can show you. Oh, yes. The new terrain that I created went into my Assets folder, and it's right here. So if I click on New Terrain, you can see it there. And if I want to move it, I'm doing my terrain here in the Terrain Basics folder. So I'm just going to click that and drag it into my Terrain Basics folder. And you can see here my terrain has this triangle out to the side. And if I click on that and open it up, you can see that I have this other object here called Splat Alpha Zero. And that is actually the height map, or sorry, the material map that I'm painting when I'm painting where my materials go. You can see that it's red, which means that my entire terrain is filled with the first layer in the stack, the first material layer. But I have this little dot of green here, and that's where I've applied my second layer. So if I select my terrain again, and I select my second layer, let's just make a really big brush this time. I'm going to set my brush to like 5 or maybe 12, and just paint a big section of this kind of mossy grass here. so uh this is going to show up a little bit better uh when i select my terrain again so i'll select my splat map alpha here now you can see i've got that section where it's uh actually we can just preview it here so you can see that my splat map is green where that second layer shows up it's red where the dirt layer is appearing, and then it's green where the grass layer is appearing. And if I wanted to make a custom shader, I could grab that SplatMap Alpha and just drag it into the shader, and then it would become like any other texture that I was sampling. So that's kind of nice to know. There's my terrain object, and the terrain object has the SplatMap associated with it, which is the mask that's determining where the different materials are going to be applied. So if I apply my kind of mossy, rocky material here, that's going to show up in my splat map as blue. So anyway, just thought you might like to know that about terrain. Okay, so I think at this point you're ready to make your own terrain and add some mountains or rivers or whatever details you want to them, and then use the built-in terrain tools to paint where the terrain materials go. All right, so that's the basics of terrain in Unity. Let's switch over to Unreal, and I'll show you the same thing there. All right, here we are in Unreal, and just like we did in Unity, I'm going to show you the basics of creating a landscape. By the way, I've been using landscape and terrain interchangeably, these two terms. In Unreal, they call them landscapes, and in Unity, they call them terrain, but really, it's all the same thing. All right, so what we're going to do is just create a new level. So I'm going to come under File and pick New Level, and here I'm just going to pick a basic one, and I'll hit Create, and here now we have our new level. It has a sky, It has a ground mesh and a couple of other elements. So I think the first thing that I'm going to do is get rid of this ground mesh because we're going to create a terrain instead. So here I'll come up under the modes drop down and I'm going to pick the landscape mode. And that's going to give us this green grid. Now the important thing to note at this point is we haven't actually created a landscape. This green grid is just like the ghost outline of what we will create once we hit this create button. And it's showing us a preview of the configuration of that landscape. Okay, so in Unreal, landscapes are made of sections. And they're made of components. and then the smallest unit is just these individual tiles here. And so what we need to do is figure out how many sections we're going to use, how many components we're going to use, and that sort of thing. So we've got a couple of controls here for controlling the number of components, the number of sections per components, and the size of the sections. And the question at this point is, how do I decide what these settings should be? Well, one thing to know is the more components you have and the current terrain that we create, if we hit create right now, it's going to create a terrain with 64 components. And the more components you have, the more expensive your terrain is on the CPU to render. So one objective here might be to reduce the overall number of components that you have. So for example, we could just set this component number here. Right now it's set to 8 by 8, and we could just set it to 4 by 4. So we've reduced our total number of components from 64 down to 16, but we've also made our terrain smaller. So how can we deal with that? Well, at this point, we can fix that by setting our sections per component to 2x2, and now we're back to the original size. So we still have 16 components, but we're back to the size where we were before. Now, if we want to reduce this even further, we can come up here under section size, and instead of 63 by 63 quads, we can set our section size to 127 by 127, and then set our number of components to just 2 by 2. and now we have the original terrain size, but our component count is reduced to four by four. And you might be saying, well, we can reduce this all the way. We could just set our number of components to one by one and we could set our quads up to 255 and now we just have one component with two by two sections and we set This is going to be the cheapest ever on the GPU Well, the problem is these section sizes with more quads are more expensive on the GPU, And so what we've just done is we've traded CPU cost for GPU cost. And the thing that you have to do with these sections and components and such is find a good balance between GPU and CPU cost. And it is a little bit confusing. But the nice thing is that Epic has provided us with a nice little table on their website that we can look at. So here we are on the Epic website, and I'll put the URL to this page down in the description. There's all kinds of really nice documentation here about creating landscapes. But here we have a table that describes these things. So if we look over here on the left in this column here, we can see the size of our overall landscape. and then based on that size we can see how many quads per section sections per component and landscape component size and then the total number of components we'll end up with so this table gives us a good kind of balance depending on the the size of landscape that we want for the number of quads per section the number of sections per component and then the landscape component size. So when you first start out, you should decide how big of a landscape do I want, and then find that size in the left column here, and then set your settings accordingly for the optimal number of components and a good balance between cost on the CPU and cost on the GPU. So we're going to go ahead and set this back to the default settings, which are 63 by 63 quads, a one by one section, eight by eight components for an overall resolution of 505 by 505 and 64 components. So this is going to give us a landscape that is half a kilometer by half a kilometer. Now you might be saying, yeah, but I want to create this giant, massive world that is 300 miles by 300 miles and just build the whole planet. And my advice to you is, if you're just getting started, it's best to start out with kind of a smaller bite-sized chunk just to kind of learn the system before you try to go off and create something massive. So that's what we're going to do today. We're just going to create a half a kilometer of landscape. So I'm going to hit the create button here. Okay, let's go ahead and zoom in here. And we're going to switch to, and I'm going to select my landscape over here in the outliner. And we're going to switch to wireframe view so that you can see. One of the really neat features of a landscape is that it automatically increases the amount of detail as you zoom in. So at this zoom distance, what you can see is I have vertices that are every meter. And that's kind of like my detail. And then as I zoom out, you can see that it's kind of consolidating and reducing the number of vertices so that I have less detail the further away I am. And that is a really good strategy to use for any real-time application. You want to have nice, tight detail close to the camera, and then further away in the distance, you want to reduce that detail so you're not paying for costs of detail that you can't even see that are further away from the camera. Now, right now, our close-up vertex density is one vertex per meter. And that may be fine for you, but I actually like to make my landscape a little bit denser close up. And when you're first creating the terrain, there's no way to do that. You have to make a terrain or a landscape that is one vertex per meter. But once it's created, now you have the opportunity to alter it. And so what I'm going to show you now is how to alter it so that it's denser close up and not as dense far away. So we're still in our landscape mode. We're going to switch to our Manage tab. And then I'm going to switch to the Resize tool. and here we have the option of changing some of those settings that we changed when we first configured our landscape and it's really important when you're doing this to set your resize mode the very first thing you want to do I think it defaults to expand actually what you want to do is set your resize mode to resample and so this is going to keep your landscape the same size in meters but it's going to change the number of vertices per meter. And so I'm going to drop down my section size and instead of 63 by 63 quads, I'm going to set this to 255 by 255 quads and hit apply. And what you can see now is the density of our vertices has increased significantly. But the problem with this is it's still really dense, you know, far out into the distance. So this is going to be a problem because, you know, I have this really nice tight density close up, but it's still adding like tons of density. This solid orange color out here is a definite problem. And so what I need to do to fix that is I need to adjust the LOD settings on my terrain. So with my landscape selected here, I'm going to scroll down to my LOD settings. And here you can see my LOD settings, LOD 0 screen size, LOD 0, and other LODs. So I want my density to be higher than one vertex per meter close up, but then I want it to fall off so it not super dense far away like it is now And so I going to set my LOD0 screen size to 1 and I going to set my LOD0 to 1 and I going to set my LOD 0 to 1 and I going to set my other LODs to 1 and what this is going to do wow you can see that all of that incredible amount of density that I had has been removed and now as I zoom in you can see that we've got a nice amount of density close up but then as we zoom out we have a reduced amount of density far away and obviously you can play with these settings to to get what you would like but these are the settings that i'm going to use and i might tweak these a little bit you know i think i might like to set my led zero screen size to maybe one so that it stays tight uh and then maybe back out here and adjust these other settings here. Maybe 1.6. So you can see there's a little bit of a process here of just kind of finding a good balance between a nice tight detail close up and then a reduction of detail further away. All right, now that we've got our LOD settings set, we're ready to talk about painting materials on our landscape and also sculpting. So let's take a look at that next. In order to shape our landscape, we can switch to our Sculpt tab. And you can see we've got a bunch of different tools here for sculpting. And the Sculpt tool, the one that's selected by default here, it says we can click to raise. So all I have to do is just click and drag to sculpt my terrain. And then if we hold down shift, it's going to lower the terrain. So just like in Unity, I can raise my terrain and then I can hold shift to lower my terrain. Another really useful tool is the smooth tool. and this is going to take uh you know really sharp edges and smooth them out so as i'm dragging over the terrain it will just kind of smooth things out and make things that are really jaggedy kind of smoothed out and make things that are uh you know pointed uh just just kind of more smooth And so kind of what I like to do is make my brush really large and set it to the Sculpt tool. By the way, you can set brush size here. Right now it's set to 2 meters. But if I set it to 500, that's going to be 5 meters. Now I can sculpt bigger sections. So what I like to do is set my brush size to something really large like this and just kind of block in the big features. you know, both by raising and lowering the terrain. So I'll draw mountains and rivers and valleys. And then I'll switch over to the smooth tool and just kind of smooth things out. And by the way, you can reduce the strength of the smooth tool here. So I kind of turned this into marshmallow goo. This is like really smooth. But now that I've set my tool strength there, I can smooth it a little bit less. So if I turn this way, way down, I can just use the tool to just kind of subtly take the edges off things and just smooth it out just a little bit. Alright, so you can use these tools to sculpt things, to raise and lower the terrain, to smooth out the terrain and get just the details that you're looking for. there's a bunch of other tools here you can use the flatten tool to set the terrain to a specific height you can see that I've got my target set to negative 1000 so it's going to set the terrain to that specific height I can also create erosion so I can kind of erode out my hills and my valleys using erosion. I can also add noise. So in this area here where I've smoothed out my landscape, I can come back in and paint in some noise and I can control the strength of the noise and the scale of the noise. If I want to make it really small, I can just kind of add in some noise like this just to add some extra detail. And if I make my noise scale really small, it's just gonna like kind of bump out individual vertices and just add some extra kind of close-up detail and sometimes what I like to do is just add some noise in like this and then switch back to my smoothing brush and smooth it out just so my landscape isn't perfectly flat but it's just like a little bit bumpy. That smoothing tool along with the noise tool is really good just for adding, you know, just a little bit of interest so everything is not completely flat, but it has some interesting shape. All right, so those are the tools for sculpting the landscape. And like I said at the beginning, it's best to start out with a plan, kind of decide where you want your mountains to be, where you want your paths to be, draw yourself a map before you even get started, and then just block things out with a really large brush to begin with. You know, here I'm using a five meter by five meter brush, and then set the brush smaller and smaller as you get large features blocked out, then set your brush smaller and kind of start doing a little bit tighter details to get the more interesting features and the more close-up features of your landscape. All right, next we're going to talk about how to apply material layers. And our material is just called terrain, so I'm going to apply my terrain material here, and everything turns black because I haven't actually added any terrain material layers yet. Let's do that next. So if I switch from my selection mode to landscape and then go to paint, I can come down here and you can see I have zero target layers. And so I need to go ahead and add my layers next. And so I can just hit this Create Layer button. And actually an easier way of doing this is if I just use this Create Layers from Assigned Materials it going to look at my material and see which layers I using there and create layers to match So let go ahead and do that. And now you can see it's created four layers for me, river stone, moist stone, mossy stone, and mossy ground. And then under each of these, I have this none drop down. And what this is looking for is a mask or an asset that will contain the data for what's painted onto that layer. So I need to create these assets for, they're called Layer Info. So I'll just hit this plus and hit save. And I'm just going to go ahead and do this for each of them. Actually, I'm going to double click and open up this Layer Info object here. In here it says no weight blending. And I actually do want weight blending, so I'm going to drop this down and pick advanced weight blending for each of these. And then I'm going to give it a blend group. I'm just going to call it one. And I'll hit save. And I'll do that for each of the four of these. I'm going to set my weight blending to advanced weight blending and set the blend group to one. Now, what this is, is when my layers are blending together, if I have Advanced Weight Blending set to On, what it should do is for each of the layers when I paint one layer it should remove weights from the other layer so for example here I have my river stone and let's just set our brush size something really big I'm just gonna set it to like 80,000 and now we can paint that layer and you can see I've painted it to the entire thing. And so let's set this back to small again. And if I paint another layer, what it should do is it should take this moss and replace the river stones with the moss. But what it's doing instead is it's showing half and half. And that's wrong. And this is actually a bug that Epic introduced with Unreal Engine version 5.7, that it's not doing this weight blending correctly. If I want my moss to look correct, I have to go back to my cobblestones and hold shift and click. And now it's actually removing the cobblestones. I'm erasing the cobblestones so that the moss will look good. And here, you know, if I paint my moss in the areas where the cobblestones show up it has a nice 50 50 blend between the moss and the cobblestones but in order for in order for me to just have the moss i actually need to hold shift and click and erase the cobblestones layer so there's kind of a bug going on right now i'll let you guys know when it's fixed uh in a future video but for now if i want to paint a layer i have to paint that layer, but then I have to erase what's on the other layers. And it's not really a great workflow, obviously, when I have to come in here and erase these layers in order to get things to show up correctly. But anyway, so that's how painting works. So I have these four layers. The way the layers are named, can you see how it says Riverstone, Moiststone? These names have to match what's in the material. And the material that we've been creating in all of the videos that I've created in this series so far looks like this. So I have four different material layers here, and then I have this node here called Landscape Blend Layer, and I have four layers assigned here, and here you can see that I've got those names that match the names on the landscape itself. And I've set each of these to height blending. And when I set them to height blending, it exposes the second pin. So each layer has a layer input and a height input. And then I just bring in the material data and the height data for each of the layers. And then this node is supposed to handle the height blending correctly. But as I said, it's not because of this bug. And I have to manually, if I paint this material here, I have to then go and manually erase all of the other materials in order for it to show up correctly. But anyway, so that's how it works. So you'll sculpt your landscape using the sculpt tab, and then you'll paint the materials on your landscape by adding the material layers and using the same painting tools that you use for sculpting. But this time you use them for adding and removing the various materials. So you can paint down whatever materials you've added in your terrain material in your shader here. All right, so we've gone over the basics of sculpting landscapes and adding material layers in both Unreal and Unity. I hope this was a useful tutorial. Like I said, several of you were talking in the comments about wanting to know just the basics of how to use the landscape or terrain systems in both engines. So there you go. All right, next week, I think what we'll do is talk about adding details. Both Unreal and Unity have a system for adding blades of grass and ferns and small bushes, pebbles, as well as trees. So next week, I think we'll do a video that covers the basics of how to use those systems as well. Thanks for watching everybody and we'll see you next week.