How to make Terrain in Unity!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
one of the most fun parts about creating levels for a game is making your own terrain luckily unity has tools designed specifically to sculpt paint and detail terrain within the unity editor and these tools have recently been updated with a lot more features now we're making this video fairly early on in the development process of these features since we think it's a nice way for you guys to try out the tools and help improve on them in fact after we did a video on the new input system we talked to some folks at Unity and they've really taken a lot of the feedback from the comments section and are already implementing a lot of it into the next version which is just super cool so without further ado let's start making some terrain also this video is sponsored by unity now let's get to it so first of all you need to make sure that you're using unity 2019 point 1.5 or later now with that we can go to window and open up the package manager here we need to make sure that we have all packages selected and go under advanced and select show preview packages at the time of recording this video the terrain system is still in preview and we should be able to search for it here and find terrain tolls as you can see I'm using version 1.1 point 4 now let's go ahead and install this unity is going to import the package and that's pretty much all the setup we need to do however unity has also created a package on the asset store with some sample terrain assets in fact that's what they're linking to right here now I'm not gonna click this instead I'm just going to go directly to the asset store tab remember you can always find this under window asset store and I'm simply going to search for the terrain sample assets the package right here as you can see it's free I'm simply going to download that and the cool thing about this pack is that it features more brushes that you can use while sculpting and painting as well as some cool sample textures that we can try out now let's hit import and import again and we are now completely set up as you can see in our assets here we now have a folder called samples with all of the terrain tools including brush textures terrain brushes layers and so on super cool so now it's time to create a new terrain and we can do this really quickly by simply right-clicking a hierarchy going 3d object and selecting terrain and right away this is going to spawn in a huge piece of terrain into our scene now I'm just gonna go ahead and disable the example assets in our sample scene here since we're not gonna be needing them so that is one way to very quickly create terrain however there is another way if we delete this piece of terrain and instead go to window terrain we can use the terrain toolbox and the terrain toolbox is a new window that allows us to easily set up terrains with specific settings change settings on multiple existing terrains at once and just overall smooth out the process of working with terrain so I'm simply going to take this and dark it next to the inspector over here as you can see we have some parameters here for the width length and height of our terrain you can set these to whatever you want I'm just gonna leave these as is and remember everything can be changed later so let's go ahead and hit create and as you can see right away it creates the terrain within our scene I'm gonna go back to the inspector here and let's have a look at what has happened here so if we go to a project first of all we now have a terrain folder and within this we have a terrain data object this stores all the information about our terrain such as where there are hills and slopes and what textures we apply you can also see that it's gone out and created an object in the hierarchy in fact it's both created a two-ring group and within this a terrain object this object has two components the terrain component which is used to configure our terrain and used to change our sculpting and painting settings as well as a two-ring Collider which creates a Collider so that physics objects will interact with our terrain so at this point we are ready to start sculpting our terrain I really recommend that when you're working with your terrain you go to the top of the scene here and make sure to disable fog so you can see everything clearly and that you also go to lighting and make sure that auto generate light Maps is turned off so with that let's get painting so the first thing that you want to do is go ahead and select the paint terrain tool here and with that selected we get a bunch of options first of all we want to make sure that we have raise or lower terrain selected here we can choose between all of the different brushes that we can use I'm just gonna choose an ordinary soft brush and if I just hover over my terrain now and try and press we can see that I can start sculpting to the right here you can change brush settings such as strength and sighs or you can do so using shortcuts the shortcut for strength is a so if I hold down a here I can adjust how much strength I want to apply with my brush in other words how much do I want to sculpt the terrain by holding down my mouse I can also adjust the size of my brush by holding down s and simply dragging here now I have a much larger brush and can make much larger changes to the terrain let's try out a bit more of an interesting brush here and if we hold down D we can also rotate it in any way that we'd like you can see just how easy it is to add in detail with brushes like these and of course all these shortcuts can be changed using this shortcut editor another cool thing is that if we hold down ctrl we can invert which allows us to lower it the terrain I'm gonna go ahead and reduce the size of my brush here and if we go ahead and change the spacing we can change how much distance we want between each individual brushstroke we can also use scattering to add random scatter to our brush which can lead to some pretty interesting effects now all of this is just by raising and lowering the terrain we also have other paint modes here such as set height which allows us to set the terrain to a certain height down here we can see the height that we're setting to let's try and change this to something like 90 let's do a soft brush let's increase the size of this brush as you can see we're now setting everything that we paint to this height really cool we also have another mode called smooth height this can also be accessed from other tools by simply holding shift because it's something that you use fairly frequently and it simply allows us to well smooth out parts of our terrain now this here is pretty extreme we can of course adjust the brush strength as with anything else to reduce the impact but it will definitely smooth out the terrain really cool another cool mode is undo sculpt and it's called noise and as the name suggests this simply allows us to paint noise onto our terrain we can go ahead and adjust settings for the noise down here most importantly we can adjust the scale of our noise let's translate it to something like 20 by 20 by 20 and as you can see I can now start to paint in this noise on top of our terrain this really easily allows us to add cool detail to our terrain especially if we go ahead and ink the strength of it you can see just how easy it is to create interesting results in fact under these modes you have a lot of really cool options to achieve certain effects so just add life to your terrain for example under sculpt here we also have the bridge mode which allows us to control click on a start point let's choose this one and then click on another place of our terrain to create a bridge across it this is super easy for creating world bridges or roads and can lead to some really interesting effects another cool thing is Terrace which as the name suggests will divide our terrain into terraces or layers when adjust the terrace count in order to change the appearance of this effect but it's definitely really handy if this is the look you're going for there are also some really cool brushes called erosion brushes you can see there's hydraulic thermal and wind I'm gonna select hydraulic here which erodes the terrain according to fluid simulation you can of course change some settings about that simulation down here but if I just go ahead and paint you can see how this is kind of smoothing and flattening out the terrain just like it would be if it was exposed to water over a longer period of time really cool and this is just some of the modes honestly there are so many more that I definitely recommend you play around with now if you're working on the terrain and realized some of your settings are off well you can always go to the last card tab here which is the terrain settings you can adjust a bunch of different things including our mesh resolution again the width length and height of our terrain and in fact one thing that I recommend is scaling your terrain to be larger while working on it in fact I've found bumping up your resolution on the width length and height to over 2000 while working on the terrain is really really nice and then you can always go ahead and decrease it later and it will still keep a lot of the detail remember if you need to adjust settings on multiple terrains you can always use the terrain toolbox to do that you don't have to go to each one individually now another cool thing about the terrain system is that it allows us to string together multiple terrain tasks this is cool because you don't always want your terrain to be completely square so if we go to the first button here we can create neighbor terrains and we do this simply by clicking and I you can see the really cool thing about this is that height data is going to transfer seamlessly onto the terrain in fact we can go ahead and create neighbor terrains on all sides here and if we go in here we can now start to paint across all of these different terrains so if you're just going and race and lower the terrain you can see that I can do so on multiple terrains at once awesome now for this to work you need to make sure that all of your terrains are sharing the same group ID as you can see all of these terrains have a grouping ID of zero and they also all need to have the same resolution just a heads up so I'm gonna go ahead and delete all these new terrains here and just try and focus on this thing of one so the next part of the process is painting and we also do that of course using the paintbrush but we need to change the mode to paint texture and when painting onto terrain we are working with what is called terrain layers and as you can see currently there are no layers here so let's go ahead and hit edit terrain layers and here we can either create a layer or add an existing layer let's try and create one this is going to open up a panel where we can select a texture I'm just gonna go it and select a symbol of dirt texture this is from the terrain samples pack I'm gonna double click on it and right away you can see that it's added this texture as a terrain layer you also see that we now have an object in a project called new layer let's go ahead and call this one dirt layer and in here we have settings such as the diffuse map we can also input a normal map so I'm gonna go ahead and input the dirt normal here as well as a mask map where I'm gonna put the third mask we're gonna just stuff like metallic Ness and smoothness in here and you can see it applies to our entire terrain and of course also texture tiling and if we zoom in we can see that the texture is actually here it's just being tiled a whole bunch so we can go ahead and of course adjust the tile size here to kind of change that around but of course right now we only have a single layer let's go ahead and add some more so I'm gonna hit add layer here and I'm gonna select some of the ones that are already in this sample assets I'm gonna select rock I'm also going to add a sand lair Squealer let's add some snow and some moss and at this point we're ready to just start painting so I'm gonna increase the size of my brush here you can play around with the opacity and I'm gonna start adding rock to my mountains I'm also going to add some moss in here just kind of scatter it around again guys this is not gonna be pretty just showing off the tools I'm gonna add a tiny bit of screen here let's add some sand along the sides don't ask me why this end on the top and finally we're gonna paint in some snow just a tiny bit at the top of these slopes here in fact I'm gonna go ahead and use a different brush so that we can kind of scatter this around again not going for any awards here and there you go it's that easy to start sculpting and painting it terrain with these tools as you also mentioned that the unity environment team is working on a brush pack for texturing that is scheduled for 2019 point two so we'll have more cool brushes and I know I haven't touched on these two icons here they are for painting trees and foliage onto your terrain now this is for another video just know that the option is here and that it works very similar to painting textures and finally I just want to show you one of my favorite features which is the ability to create a terrain from a height map now if you don't know what a height map is I have an example of it right here as you can see it's a black-and-white image that stores height information white parts are high black parts are low and there are a lot of free height maps online I would definitely recommend just doing a quick search for height map and just by going to images you can see just how many are readily available here now the format of your heart map needs to be dot raw you can use a photo editing software like Photoshop or to export this raw in case you find a JPEG or PNG or any other format in Photoshop it's as easy as going file save as and selecting Photoshop wrong in fact I've gone it and prepared a height map draw right here let's simply drag this into unity to import it we then go to the terrain toolbox let's create a new terrain but let's do so by importing a height map so I'm gonna check this checkbox right here I'm gonna select a height map file simply clicking this I'm gonna browse to the height unless you can see we can change the height resolution this doesn't have to be the same as the height map you can make it a greater resolution if you want I'm just gonna keep it at 512 we can then remap our height map in any way that we'd like I'm just gonna make it less tall here so I'm going to decrease the max we also need to make sure that we aren't creating this in the same grouping ID as our previous terrain so I'm gonna set this to 1 and let's now try and hit create and as you can see it's going to spawn this right on top but we've now created a terrain based on that height map and I think it looks really really cool and hard maps are just really great to use they are really easy to get inspired by and just gives you a really solid base to work off of finally what you've created the terrain that you'd like simply go back into lighting and re-enable Auto generate and it's then going to generate a light map for your terrain awesome that's pretty much it for this video if you liked it make sure to subscribe and bring that notification bell so you don't miss the next one also if you want to learn more about terrain we will of course have a link for that in the description on that thanks for watching and I will see you in the next video thanks out the awesome patreon supporters who donated in May and especially thanks to Tucson of ski Daniel de Sonic Nokia Vaisakhi Shane Cleveland Chris Sullivan Konstantinos currents us infinity PBR face Samara Phi Lela set Ronan Gregory Pierce simmer folded back curiously the ski and Erasmus you guys Rock
Info
Channel: Brackeys
Views: 982,369
Rating: undefined out of 5
Keywords: brackeys, unity, unity3d, asset, assets, model, texture, models, textures, material, materials, beginner, easy, how, to, howto, learn, course, tutorial, tutorials, tip, game, development, develop, games, basic, basics, C#, terrain, terrain system, new, sculpting, brush, terrace, erosion, bridge, sample, beta, layer, layers, color, paint, heightmap, sculpt, landmass, landscape, land, level, design, world, building
Id: MWQv2Bagwgk
Channel Id: undefined
Length: 14min 42sec (882 seconds)
Published: Sun Jun 23 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.