Advanced Godot | Importing Real World Terrain Data into Godot

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey guys this is mitch with five point cgi and today we're gonna talk about creating a terrain inside of godot so we're gonna go through the process of downloading our terrain add-on we are going to go ahead and kind of go through the tools that you have and then i'm gonna show you guys a really cool way to export real world maps from the open map project out to godot so that way we can use real world terrain inside of godot so that way we don't have to go through all the work of actually creating our own terrain we can just use what's out there so that's what i have in store for you guys today so let's go ahead and get started okay so the first thing that we need to do is we need to go ahead and download our terrain tool so let's go ahead and go to asset library and let's type in ter terrain t-r-a-i-n and go ahead and grab the height map terrain by zaylin he's an awesome developer go ahead check out his github he's an awesome guy he has some really cool stuff out there so go ahead and install that let's go ahead and install it all right so what this is going to do is it's going to allow us to um create height map terrains inside of godot so first we're going to create a 3d scene we're going to right click on our spatial note and add a child node and click on our spatial node and you'll notice that our terrain doesn't actually exist now why is that well the reason why is because we didn't activate it so we have to go to our project project settings we need to go over to plugins and then enable the plugin here all right now let's go ahead and hit close and right click on our spatial node add a child node we are going to click on our spatial node and we are going to come down to terrain h terrain here so go ahead and double click on that and you will see it yelling at us saying hey you need to have a data directory so we go ahead and click on our h terrain and we come down here to our data directory right here we click on our little uh file browser here and let's just go ahead and create a folder and call it train data now you want to make this something unique if you have multiple different levels that have different terrain data you'll want to make sure that something unique because all of your train data for that specific terrain is going to be put into this folder so you want to make sure that you have something special but in my case i'm just going to call it train data and we're going to say select current folder awesome so now that we have that it's a huge object you can see right here just how big this object is so that's sweet so if we come over here you can see we have some tools up here so the first one is build up so if we click you can see it's building up the next one is build down so if we click it is now building down and you can see how it's subtracting from our train we have this one which is smoothing so if i click on it you'll see it smooths out my height and smooths out my cavities so it makes our drain nice and smooth this one is our level so what it does is it actually levels it flat based off of the averages around it so if you click down here and you start flattening it it'll flatten it based off of basically the averages of the entire circle and then this one flattens to a specific height so you can actually pick a height here and it'll flatten it to that height so if you were to say something like you know 30 right and then you were to do that you can see it flattens it directly to that height which is good and bad it's super useful for creating something like a plateau so now if i go ahead and flatten this all to zero you can see how it kind of kicks it all down to zero simple enough if i just go ahead and increase my brush size right here and i just kind of start flattening that out there we go now we also have erosion so if i were to create a small you know hill here or something right and then i were to click on erosion you'll see how it kind of cuts it like a uh creates a point out of it it almost erodes away at it hence the name erosion right which is kind of cool because it creates small little details so if you want to create like little sand bars or if you want to create like peaks of a mountain or something that's what this is really good for now this one is texture paint i'll go over that in a little bit this one is color paint and it allows you to color paint it so if you're doing something like a low poly style project or something like that this would be cool for that detail paint which allows you to paint grass and things like that and finally cut holes which allows you to legitimately cut holes into your drain mesh which is useful i know it doesn't seem like it'd be useful but it is extremely useful if you want to create like a river or something like that and you want to just kind of cut a hole in it or if you want to make your terrain a specific shape like if you're trying to do you know a circular map or something you could do that with this now what are some other options here so if we look over here we have terrain and we can import maps we can generate maps we can resize it we can bake a global map we can update our editor collision we can generate a map don't do this unless you really know what you're doing export out our height map we can do some look dev stuff and then some documentation stuff and by the way the documentation here is fantastic so make sure that you check out the documentation as well now if we go to generate generate allows us to legitimately generate out a train based off of some noise so you can actually see if you randomize the seat a bit and you kind of mess with your base height let's say i wanted to be kind of like a i don't know like there's some water here or something and i want to adjust my height map range to something like this and up my base height a bit more and then give myself a bit more a little less roughness i think let me up my scale a bit something like this and let me adjust my curve a tiny bit give me some octaves which will help increase the detail of the vol or the detail of the noise i'm using and then there's erosion which will erode away you can see how it creates those really cool peaks and then we can give ourselves a higher weight if we want which will kind of give it a little bit more peakness and we can also adjust our slope which will kind of smooth out our peaks a little and then we can actually erode our slope direction so we can actually change this to something like you know 100 and you can see how it moves everything to the left if i do minus 100 it'll do the same thing but move it all to the right and i'll set that back to zero because i don't need it if we invert it it'll actually invert our erosion slope which will make it tighter and then we can do dilation which will actually kind of smooth everything out so if i hit apply you'll see suddenly bam it's worked now you really can't tell because there's no shadow in this scene so let's go ahead and create some shadow so let's add in a child node and add in a direction light and we just kind of drop that in and there we go now we got a little bit of you know light and i'm going to actually add in some shadow and i am going to go ahead and click on directional shadow and do max distance just kind of increase my max distance to a pretty high number so that way i can actually see what i'm doing but you can see kind of what it's doing it's making your scene well it's it's kind of generating out a nice little terrain for you and let me zoom in here and let me adjust this something like that so it's a little bit more like daytime and you can see kind of what it looks like but what if we want to use real world map data to generate our terrain that is where a small tool called cs height map scar sky dark dot pl comes in so you guys can see right here if i expand this out for y'all you guys can see it's a pretty cool little thing it shows you a map and it shows you these little squares now there's a lot of changes that should be made to this and i'm gonna talk to the developer and see if i can make those changes and maybe release it on my website for us to use for terrain data but right now we're just gonna use this how it is we're gonna have to work around it a little bit but what we can do is we can pick a location so in my case i'm gonna pick let's see i'm gonna go ahead and pick the grand canyon because everybody likes the grand canyon it's one of the big things in the united states that everyone seems to enjoy so let me go ahead and go find that now the controls here are pretty simple if you just click it'll snap it to that location so here's the grand canyon right here and there is a very popular section here called the horseshoe here in the grand canyon it's right here so you can see right here where the horseshoe is located you can see how it kind of cuts and then it cuts back either that or i i'm mistaken it's probably like somewhere over here and i probably have it wrong and people are going to be like no mitch you're dumb it's it's right here you know but um regardless i'm just gonna pull it from right here this is a good location so we'll drag this up and we'll say i want all of this so the entire thing is going to be exported here and in uh this tool the green is like the playable area in um city skylines and then this is like the backdrop but in our case all of it will be usable for what we're using it for so we'll want to hit on the info icon and we're going to want to hit auto settings and what that's going to do is it's going to automatically adjust this for our use and then we are going to go ahead and download our png or raw file it's up to you on which one you want the raw file has a little bit more data but i'll just pull the png down because i'm a little lazy and i want to go through the process of editing this later so let's go ahead and click on the png file and we will save this height map out now if we open up godot and we click on our terrain and we click terrain import maps and we click on the three dots and we go out to our downloads location so downloads and we go find our heightmap.png we open that and we are going to set our min height to 0 and our max height to something like 200 i think 200 will be a good number now if we want we can use a splat map or a color map so if you go in and you take this height map and you go and color it you can actually go in and color it with different colors and then that'll associate it with materials but in this case i'm just going to go ahead and import this so if we click import what it's going to do is it's going to go ahead and pull that data and try to import this as a height map you can see bam suddenly wow like our scene looks really cool look at that you know um now i'm gonna speed up our movement if you hit uh if you're flying and you scroll up on your scroll wheel it will speed up your flying speed so you can see look at that that looks fantastic now something that you'll notice the first thing that you'll notice is a the size of our s of our height map only got us to here see how it cuts off and it drops down immediately now this is kind of a bug but not really and also you'll notice that our view is getting cut off so let's go to view settings and then let's change this to something like 3000 and that'll let us see our whole scene here now you can see it literally did not go all the way out and the reason why is because we need to go to our terrain and look at our terrain size you can see our terrain resolution is 2049. now unfortunately 2049 is not the resolution of the image that we pulled in if we actually open up krita and we go ahead and we say file open and i need to resize this for you guys hold on one second and we pull in our height map data here you'll see that while this all works great the size of this image if we go to properties is only 1081. so if we look at our screen here you can see that it's only 1081 so it only takes up this little segment here now now if we want this to cover the entire screen here we would need to scale the image up but that might distort our little project here so we have a choice do we want to scale this up and potentially distort our project or would we rather just dealing with it and calling it a day and that's a question that you guys need to answer for yourselves in my case i'm going to go ahead and scale this up might as well so that way it matches with what we're trying to do so i'm going to go to image scale image to new size and i'm going to say 2048 by 2048 we're going to go ahead and scale that up like that and then we are going to go ahead and go to file save as and we are going to name it as height map underscore rescaled and that's going to go ahead and output our new height map so now if i come in here and i go terrain whoops i don't want to generate import map and i go height map rescaled and then i go ahead and i import it it's going to take a little bit but you will see that it now regenerated our entire level as a new height map now we might want to uh expand our height here because it looks like it's a little bit on the low side here now but you get the idea so if i come in here train import maps and i set this to something like 300 we go ahead and import this let's see if that will make it look a little bit more exciting right a little more like oh my goodness this is a huge you know level there we go now one of the things that you'll notice is that we have all these little bumps here and we're gonna need to clean those up so unfortunately we're gonna need to come through here and just kind of smooth out all of our little bumps and grooves and make it nice and nice and you know smooth and pretty you know what i mean but i'm not gonna go through all that for you guys i don't think that you guys need to to watch me just kind of sit here and smooth things out for an hour um but you guys definitely can if you guys want to you can see how smoothing it out is necessary now one of the things that we can do to help this out first of all is change our directional light so let's make our directional light there we go make our directional light kind of a higher a higher shot let's move it this way just a touch there we go and that should help us make everything look a little nicer let me scale this up to move faster but you can see that everything's still kind of blindingly bright so let's come in here and let's add an environment node and go ahead and add in a new environment and you'll see suddenly everything starts looking a little less bright and we are going to go ahead and add in some ambient fog just to kind of help it out a little bit and we will add in a background let's add in a sky and let's add in a procedural sky now you'll see that suddenly everything's way too bright again so let's come down here and add in a tone map of aces it's too bright so filmetic maybe let's bring down our exposure a tiny bit maybe i don't really like it so let's see if i just go to linear how does that look we're going to have to adjust our exposure i think so let's see if we adjust i'm doing all this on the fly by the way i did not plan this out so i apologize in advance so if i change this to aces and let me oop that's way too bright not good enough that's good enough for me i'm not gonna complain too much adjust the lighting so it looks a little bit more dynamic something like that there we go so you know you can create a pretty cool little alien planet here maybe we can color grade it a tiny bit to make it look nicer or something like that but you guys get the idea right and actually let me change the directional light to be slightly orange as well now i'm letting my art skills dictate the uh scene a bit but that's okay um anyway so now that we have our terrain built let's go ahead and do some texturing of it that's where this little um painting tool comes in handy now we don't actually have a texture to paint you can see by looking right here there isn't really a texture for us to paint so let's go ahead and download some textures that we can use to paint so for this case i'm going to be using cc0 textures and it says our tumbler version let's click here and go to ambient cg it looks like they changed it to ambient cg so let's go ahead and explore their assets and let's grab some ground textures here so you can see here's a bunch of different ground textures so i'm gonna pull down this one let's say so let's pull that down i'll just grab the 1k version i don't need anything special so let's pull that down and then let's pull down this one to help us with some variation and then let's pull down a cliff texture of some kind so let's see do we have a cliff like texture we'll pull this one down i guess so we'll pull this down here and we need one more texture so let's go ahead and pull down i don't know uh let's do a little bit of green i guess so let's pull this one down all right so now that we have those pulled down let's go ahead and extract them and i'll just fast forward through this but you got to go ahead and extract all of these all right so now that i have all these extracted let's grab all four textures let's bring up good dough tab back over and drag these in to our project what that's going to do is it's going to allow us to import all of our textures so you'll see it's going to pull them all in and now that we have all of these textures pulled in let's go ahead and import them into our project or into our so now that we have these textures let's go ahead and import them into our terrain engine so if we hit import you can see it allows us to grab multiple textures here let's hit the little plus icon hit load ground and let's pick our ground color load grab our bump map load grab our normal map and load grab our roughness map and now let's go ahead and hit the plus icon load peel this up and let's grab our ground 29 let's grab our color map and you'll see it automatically pick those up because it is using a unified color language or unified texture language click load peel up and go to ground 35 and let's pull that one and it looks like that one worked as well and then let's finally pull in texture three and let's pull in our rock texture here let's grab that color and there we go so let's go ahead and import all those into texture sets and you will see it's going to do some calculations and some magic it's a compression and some stuff to make it super efficient and it'll say importing is completed awesome so now that importing is complete let's go ahead and click on close and you can see that i strategically did this so that we have our first texture our second texture our third texture and our cliff texture and what is a cliff texture well a cliff texture is a texture that uses tri-planar mapping so tri-planar mapping is a way to stop stretching from happening so if you look right here you see how this massive stretch right here that doesn't work for most uh games right you see that and you're like well that's ugly right well that's what tri planar mapping kind of comes in and cleans that up and makes it look good right so first things first let's click on our sand texture i'm going to show you if you just go ahead and click and paint well that's weird nothing seems to happen right so how do we fix the painting issue well what we can do is we can go to terrain we can go to resize and we can go ahead and click on the center and hit apply and doing that if we click now we can go ahead and paint now remember how i told you about that cliff texture right if we come over here and you can see how this is all stretching if i paint here will the texture stretching right why is that well if we come down here you can see that there is a u triplaner here under our shader shader parameters if i click that on you'll see suddenly that starts to work so we can actually paint in our cliff texture here see that now some other things that are over here that's really cool is we can actually change our shader type to like low poly if we want like a low poly texture so you can see how it looks like a low poly or if i change just something like classic four which gives us like a roughness map and all of that attached to it or i can just go with straight classic light which is kind of like for you know phones and mobile devices but i'll go with classic four it makes everything a little bit nicer and um if i want to and i think this is a little beyond the scope of what what i'm discussing here but you can also go into like array multi splash 16 in multi splash 16 light multi splat 16 is 16 textures array is theoretically unlimited textures and uh multi splat 16 light just doesn't apply roughness or um shininess to stuff now some other things that you might notice is this blends awful look at this we put some sand here right so we said hey this is sand but you can see it just kind of ends well they also have this really cool thing called depth blending you can see how depth blending instead of just fading out it actually blends in a little bit to help it look nicer see that so that's something that's really super useful and also something that we've noticed is if you drag this in here for a cliff texture you'll notice that it's affecting this area as well and we might not necessarily want that so we have this thing called slope limit and what slope limit allows us to do is we can pull this back to like here let's say and we could paint and it will only affect areas that are that specific slope which is super useful when you're creating cliffs on the side of a of a terrain you can just kind of paint it and it looks good and if i want i can come in here and it works the exact opposite as well so if i drag this down like this i can paint you can see it kind of blends that back up into itself now you can look at this and kind of see there's a pattern here so let's go ahead and fix that with tile reduction so we can actually turn this and it will reduce our tiling of our scene here you can see how it pops everything and reduces the tiling of it so that's really all i have for you guys today i know that this tutorial is kind of scatter shot but i mean it's a pretty scatter shot topic um so hey you know if you like this video go ahead and hit that like button hey if you dislike this video go ahead and hit that dislike button because i'm here to make content for you guys now this video was a viewer's suggestion so i do listen to your guys's comments and i do listen to your guys's suggestions so please let me know also if you guys have any questions or just want to join a cool community drop by my discord the links in the description below so you guys can go ahead and check that out but that's all i have for you guys today so thank you so much again for watching and i will see you all next time [Music] thanks [Music] you
Info
Channel: FinePointCGI
Views: 1,670
Rating: undefined out of 5
Keywords: godot, terrain, godot engine, godot tutorial, world, godot terrain, godot 3, real world, godot game engine, godot inventory tutorial, godot engine tutorial for beginners, godot inventory, how to make an inventory in godot, godot beginner tutorial, godot inventory system tutorial, godot tutorial inventory, how to make a user interface in godot, terrain generation, terrain genneration, godot engine tutorial, godot user interface tutorial, godot tutorial user interface
Id: NSY0PyT0Z-g
Channel Id: undefined
Length: 26min 39sec (1599 seconds)
Published: Mon Sep 06 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.