How to Use Terrain with URP in Unity 2020 | Beginner Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

.

👍︎︎ 1 👤︎︎ u/skellytongs 📅︎︎ Aug 25 2020 🗫︎ replies

📌

👍︎︎ 1 👤︎︎ u/Dvrkstvr 📅︎︎ Aug 25 2020 🗫︎ replies

Great showcase of the terrain tools! I learned a lot!

👍︎︎ 1 👤︎︎ u/ExaltedBagel 📅︎︎ Aug 25 2020 🗫︎ replies
Captions
[Music] hey guys in this video we will learn how to use unity terrain system to create a fantasy environment in unity's universal render pipeline so let's get started all right i have opened up unity and already implemented the universal under pipeline if you are new to urp then please watch my video about urp introduction for this tutorial i'm gonna use a slightly different approach than my previous video basically in this video i'm gonna use terrain tools to create a new terrain and also give you a basic overview of it so let's go ahead and import the terrain tools to do that go to windows and package manager and in the packages section make sure the unity registry is selected this will list all the packages available for unity next i go to search option and search for terrain tools and as you can see the terrain tools are not visible in the search result and that is because at this moment terrain tool is a preview package and in unit 2020 by default preview packages are disabled so to enable preview packages for package manager i go to edit project setting and in the package manager section take this enable pre-packages option and as you can see now the student tools are visible in our search result and you can also see this is a preview package then i click on install to install the tools then i also go ahead and download the sample asset from ss store this package includes some additional brushes for sculpting and some high quality texture for terrain then i click on add to my asset and click on open in unity this will bring me back to my package manager and since i have already downloaded this package so now i just need to import it and now to access the terrain toolbox go to windows terrain and turn in toolbox we gonna use the student toolbox to create and manage our terrain and also we have additional textures and brushes to quickly get started with terrain next i'm also going to import this fantasy landscape pack for trees grass and ground textures so let's quickly import that also so as you can see right now everything is pink and that is because these materials are not supported in unit center pipeline so let me quickly convert all the materials to urp if you want to know how to convert materials in urp please watch my video about urp introduction all right now i have converted everything to urp so i create a new scene and i save it called urp terrain okay so let's create our terrain in my previous tutorial i showed you that you can create a new tutorial by right click go to 3d object and create a terrain but this time i'm going to use terrain toolbox so i go to windows terrain and open up this terrain toolbox and here you can define various parameters for your terrain so right now i keep the width and length to 500 meters and height to 100 meters and without changing any parameter just simply click on create and you can see it has automatically created our terrain and it also created a group object and this is our terrain which we have just created this turning tool box has some additional features some of which we will use throughout this video let's start scripting our terrain to do that select your terrain and go to painter in section and here you can use this raise or lower option to sculpt your terrain i also want to show you a few shortcut keys if you hold a and move your mouse you can basically change the strength if you press s and move your mouse you can change the size of the brush and if you hold d and move your mouse this will rotate your brush and now you can just simply mouse clicks scrub your terrain very easily just like that but this time i'm going to show you a slightly different and quicker approach to sculpturing so for that i go to sculpt and use this noise brush if i go down here this is the texture that this brush is going to use to sculpt this terrain so now if i click and you can see it quickly adds some variation to my terrain to modify the texture of this brush simply scroll your mouse in this preview section and now you can change the texture of your brush and here are some other parameters you can also use to modify this texture so in the noise type i'm going to choose ridge okay and slightly increase the size feel free to play with these options to get different kinds of results and start scrubbing even though it's looking more like a sand dunes but since we are getting a fantasy environment so this may will work next i create a 3d cube and set the y value to 2 and place this in the center of this terrain then select the camera and press ctrl shift f to align the camera in the scene view i'm going to use this cube as a reference to a human object to maintain a proportion between grass texture and trees and that's why i set the y value to 2 that is approximately equal to a human height let's also quickly apply a texture to the ground so that we can better see our terrain to do that select the terrain go to the painter in section and here go to paint terrain section then go down and in the layer option here you can add and remove texture layer of this terrain so i'm going to create the first layer of grass so i call this my grass and i click on create and this will ask you to choose a texture so i'm going to choose this ground grass texture that comes with this fantasy landscape pack and now you can see the texture is applied to this whole terrain now you select your texture and here you can also assign normal map i have already prepared a normal map for this material by the way this normal app is not included in this package you can create this normal map in materialized software i've also created tutorial about that and now if you select your terrain go to windows terrain and turn tool box and in the terrain utility in section turin layer click on import from terrain and it will list all the textures that are applied to this terrain now you can manage your texture from here so let's go ahead and also scrub the center part of this terrain because right now it's quite flat again i'm going to use noise brush to scrub the center part of this terrain so i go to the sculpt and go to the noise brush again this time i choose a different brush okay reduce the scale and also going to choose a different type of noise something like this and see how this looks i don't want to create too much detail into the center area by the way you can hold shift to smooth the area you can also sculpt your terrain later once you apply your textures and trees so i think for now this is enough we can later scrub this terrain if we need it let's also slightly adjust the lighting of the scene because right now it's looking too dark and if you also have this kind of issue and that is because right now there is no ambient light in the scene so to create ambient light in our scene you go to lighting section and if you are using unity 2020 you need to create new light setting so i click on new light setting then in the mixed lighting disable this big gi because we don't need it and then simply click on generate lighting i'm also gonna slightly adjust the intensity of my direction light maybe 1.5 okay next i'm going to create a path on this terrain to do that select your terrain and again go to paint texture section and also gonna add one more layer of ground this time i call it my ground and click create and this time i'm gonna choose this ground road texture i have also prepared a normal for this texture so i simply apply it and set the normal map to maybe like 4 something now to paint a path on this terrain select the brush and select the ground layer and start painting as you can see right now the texture is looking a bit pixelated and that is because there is not enough resolution for our texture to fix that again go to windows and train toolbox and the terrain setting go to texture resolution and change the control texture resolution so right now it's set to 512 so if i set this to 32 and select apply the terrain you can see it is now much lower quality so i control chat so for now i choose one zero two four and hit apply and you can see now the texture is looking much better let's also increase two to zero for it and hit apply to terrain and now you can see the texture is looking a bit better around the edges so next i'm going to quickly create a path on this terrain [Applause] [Music] [Applause] [Music] all right i have quickly painted a rough path on this terrain it's time to add some trees on our terrain so to do that select your terrain and go to paint trees section click on edit trees and choose entry and here you can choose your tree prefab so the fantasy landscape package comes with a few tree prefabs which i'm gonna use so i select this first tree click on add then again click on add trees and this time add the second tree now to paint the trees on terrain simply choose the tree you want adjust the brush size and simply click to place the tree on terrain but it's really very painful to place tree all over the terrain using this method so to quickly scatter tree on this terrain you can use this mass place trees option what you can do is just set the number of trees you want for example i choose 500 trees and i don't want to keep existing trees so i untick this option and simply click on place and you can see it has automatically placed trees on this terrain as you can see that these distance trees are looking a bit weird and that is because there is no lod assigned for these three prefabs so i think that unity is automatically tried to create an lod based on these textures to fix this issue you can create a low polygonal version of this tree and assign that as an lod to this prefab that will fix these problems and provide you even better performance however there are some other solution which you can use but they are not as optimized as using an lod so the first solution is you can use fork to hide these trees so if i go to lighting and in the environment section i enable this fork i also enable the fog in the scene view and now you can use a fork to kind of hide this distant trees and you can see now the trees are not that much visible and when you go close to them it will automatically convert to the original tree prefab the second option to fix this issue which is not a recommended method but however you can use it select your terrain and go into the terrain setting and increase this billboard distance like 500 and now you can see that these distance trees are also looking perfectly fine but i won't recommend this method because this will increase your cpu overhead so if you are having any optimization issue try using the lod method but for this scene i keep this value as you can see that some trees are spawned in our path so to remove them hold shift and click to remove the unnecessary trees now you can sculpt your terrain a bit more to create some ups and down on this terrain [Music] [Applause] [Music] [Applause] [Music] okay so now with some slopes our path is looking a bit better let's go ahead and add some grass on our terrain so to do that select your terrain and go to this paint detail section and in the adidas section you can use grass texture or grass mesh so let's first try adding a grass texture so i click on add grass texture and simply choose a grass so i choose this grass set the color something like that and hit up add and now you can scatter the grass on the ground okay even though it's not grass it's a flower texture but you can also use different texture for grass for example this one and set the color to match the grass texture next i choose add detail mesh this package comes with a nice grass mesh so i'm gonna choose this one and set the color hit add and then click on scatter as you can see the grass is looking a bit tilted so to fix that again go to terrain settings and in the bending option set this to 0.1 or 0.2 okay now to adjust the grass parameter again select the grass go to edit and here you can define its color choose a color that matches with the ground texture minimum and maximum width and height i choose that lower opacity increase the brush size because i don't want denser grass so first i remove the grass by holding shift and clicking mouse then you can scatter the grass wherever you want but don't go crazy with this grass because this may affect your game performance and as you can see now the color is looking a bit different so to fix that issue again go to your terrain setting and in the grass tint option set this to a mid-gray just like that [Applause] [Music] now you can also use the same method to scatter different type of flower on this terrain which are also included in this package [Applause] [Music] [Applause] [Music] so [Music] so our terrain is almost ready next i quickly place this rock prefab to add some more interest in our scene [Applause] [Music] [Applause] [Music] all right now our terrain design is ready so let's add some lighting and post processing to further improvise our scene so first of all i'm going to add sky to our scene for the sky i'm going to use this fantasy skybox pack which has some really nice sky so i quickly implement it in unity then go to lighting section and in the environment tab in the skybox material here you can choose different kind of sky for your scene i also enable the auto generated lighting so that i can see the effect of a skybox lighting in our scene so now you can choose different kinds of sky i'm going to choose this one i slightly adjust the direction light all right next i'm going to add some post processing in our scene for that i right click and go to volume and create a global volume and create a new profile and first of all i assign to unmapping and set this to ac es and it will add some contrast in our scene next i'm going to add some bloom also want to increase my direction light okay next i'm going to add lift gamma gain to add some tuning in our scene okay and you can also use this white balance okay and then i'm gonna add some we need and as you can see after adding post effects our scene is looking very much better and you also go to main camera and make sure that post processing is enabled and in the anteriorizing you can choose the fast or sub-pixel and as you can see after applying all the post-effects our scene is looking really nice and we also getting decent fps so now it's your time to use these skills to create beautiful environments for your games if you have any issues you can ask me in the comment section or on my discord server if you like this video give this a like and subscribe the channel for more tutorials you can also visit our patreon page for more exclusive tutorials and finally i would like to thank all of my patreon supporters especially hannah simkonan di medu brendan manion jb hungin mj lee silas renagal fubi liu heath close stephen christie mamuru yashida chill carrier stefan siddhiro and dan kin so that's pretty much it for this video see you in the next one bye bye
Info
Channel: UGuruz
Views: 81,770
Rating: undefined out of 5
Keywords: unityguruz, uguruz, terrain in unity, terrain, how to make a terrain in unity, terrains in unity, unity terrain tutorial 2020, unity terrain tutorial beginners, grass in unity, realistic grass in unity, unity terrain texture, unity terrain grass, unity landscape tutorial, terrain tutorial unity, unity terrain tools, unity 2020 tutorial, unity trees and grass, unity terrain trees, unity stylized grass, unity terrain tips, unity grass mesh, unity 2020.1, unity urp terrain, urp
Id: Fhx7t0REfMI
Channel Id: undefined
Length: 20min 14sec (1214 seconds)
Published: Mon Aug 24 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.