Unreal Engine 5 - Create a desert landscape procedurally

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello fellow unreal engine games developers yes unreal engine 5 is finally here so i'm going to show you how to create this procedural desert landscape in the new engine let's get straight into it [Music] yes unreal engine 5 is finally here last year i showed you how to make this desert landscape using the procedural landmass plug-in but that was in unreal engine 4 so today i'm going to update it and show you how to create the desert landscape in unreal engine 5. first thing you need to do is create a new project so open up unreal engine 5 i've gone into the game section choosing a blank a project and over here i'm targeting it for desktop maximum quality no starter content no ray tracing and then just give it a project name so i'm going to call it desert landscape and create and after a few seconds it'll open up by default it will um open up this open world template which we're not going to use but we'll create a new level in a second first of all you'll probably get this message saying project file is out of date that's just click update here um don't worry about the plugins for now although we will add a plugin in a minute first thing we want to do is create a new level so do file new level and i want it to be completely empty so choose the empty level create and straight away let's do control s and we'll save it so i'll create a new folder under content called maps and under there i will call my level desert okay so we now have the empty desert level now the first thing i want to do is set up the environment and the lighting and i want to show you a new way to do this if you go into window environment light mixer you can just click these buttons to create all the relevant sky and lighting elements so let's click on create skylight create atmospheric light zero which is your directional sunlight we don't need to create another one create the sky atmosphere i won't create any cloud because my desert scene is going to be uh clear sky and then create a height fog and if you close this down you now have the um all of the sort of elements here for the for the lighting so now let's start to create our landscape so go into the select mode at the top here and choose landscape and what will the most important thing here is make sure you enable edit layers because we're going to be doing two layers for our desert a main dunes layer and then a sort of a sub dunes layer to create a little bit of uh detail in between the main dunes um i've chosen to go with a section size of 127 by 127 and 2x2 sections just to create a bit more detail so just make sure you've got these same resolution you should have 203 3x2033 at the bottom here and just click create and we now have our landscape albeit there is no material on it yet so the next thing we want to do is uh put some sand on our desert and quiksil bridge in unreal engine 5 is now built in to the um is now built into the the to the engine to the to the editor engine so you can come into edit sorry window pixel bridge and if you've not used it before you'll probably have to sign up or log in but once you've done that go into the search bar and search for bright desert sound and you should find this asset here so if you click on it you you may have to download it i've already downloaded it so click on that button first and then i've gone for medium quality that's more than sufficient for this for this setup don't need to go any higher quality on that so just click on add and after literally a fraction of a second you will see in your content browser this new desert sand material with all of the textures associated with it so close that down for now we'll come back to that in a minute close down the bridge and now what we want to do is apply that sand to our landscape so for now go back to your regular select mode choose the landscape in the outliner drag the details down a little bit until you see this landscape material and then in the drop down here just type in desert and you'll find this mi bright desert sound material click on it and we now have our sand material on there so now it's we want to adjust the uh scaling of this sound but we've got no reference figure to see if this is if this sound is too small too large so i think this is probably the time to add in a mannequin just to get a reference figure so you've probably noticed the content uh explorer isn't shown in unreal engine 5 by default but if you press control and space it comes up from the bottom here and now what we can do is click add to add a new feature add a feature or content pack and we'll choose the third person feature okay so that's now added in here so you can just close that down and by default our game will still be in the uh default game mode so it won't have a character but if you go over to your right hand side and choose world settings we can change the game mode here to third person game mode and now if you do alt p to go into play there is our mannequin and we can run around on the scene but if you look at the um [Music] if you look at the sand here it's very detailed i really want each ripple to be about the width of a foot it's also a bit difficult to see these ripples so let's change the sunlight a little bit go have it lower so we can see the shadows of the ripples a bit more so to come out of the game normally again this is a change in unreal engine 4 you'd have hit the escape key now you have to press shift escape to come out of the game so do that and to change our lighting a quick way to do this is to control an l keep the control key held down and while you do that you can move your mouse and you can see that it moves that light in real time so bring the light down sort of low in the horizon like this and now we can see those ripples so again if we go into play mode now i can see those ripples there's about 10 ripples per foot length and i want it to be one ripple so i need to reduce the tiling 10 10 fold so that's what i'll do next let's shift escape again to come out and we will open up our content draw again you can click on the bottom or control space and we'll go into our mega scans surfaces right desert sand and double click to open this up it'll probably open up in its own window here if you just drag the tab bottom we can then put it side by side with our desert landscape so we can see as we change the material what effect it has on the landscape so the first thing you want to do is change the tiling so click the little triangle here to open up the tiling variables make sure you check this tiling and offset at the moment it's a tiling of one and one let's reduce that to 0.1 and 0.1 and now you can see that that's those ripples are much further apart and while we're in here the base specular is 0.5 that's quite shiny for this um for this surface so let's reduce that from 0.5 to 0.1 and you can see that some of the shininess of the sand has gone away and the other thing you might want to do it's up to your own taste is i want to have slightly redder um sand so i'll check albedo tint and i will move it slightly to the red and you can see that it's gone a bit red in fact i'll do a bit more yes i've got slightly redder desert texture there okay so save your material instance close it down um so we've now let's go into play mode again just see yeah that's a much better scale you can see that the foot of the mannequin is around about one ripple in length okay so that's the um basics done now we need to do we need to go to the main event of the tutorial which is creating the desert dunes so let's come out of here shift escape and go back let's do a quick save ctrl shift s just to say what we've done so far go into landscape mode and when we created this landscape it created a single layer here double click on it and we can call this layer main dunes and we're going to use the landmass material brush to procedurally carve out our dunes so if you click on the you'll be in this sculpt section here if you click on blueprint and look at your blueprint brushes under tool settings at the moment there are none there and that's because we haven't yet enabled the landmass plugin which we need to use so to do that go into edit plugins type in landmass and select it it will tell you it's a beta but that's fine just say yes you want to enable it and then restart the project in fact let's do one thing before we restart the project let's come out of here let's go into edit project settings go to your maps and modes at the moment it's going to open up this open world template whenever we start this project so click on that and change it to your desert level and also make it the default map for the game as well okay and close that down this just means that every time you start this will restart this you'll come back to the desert level okay now let's go back to the plugins landmass okay select it if it's not already selected and do restart if you've made any changes like this make save the selected changes before you restart and shouldn't take long a few seconds later you should have the project reopened okay and now we will go back into our landscape mode we're on our main dunes layer choose our blueprint brushes and now underneath here you've got three landmass brushes the first two are spline based allow you to create shapes or rivers and the third one is a material brush which we're going to be using in order to apply a procedural material across the whole landscape so if you select this one then you must click on the landscape to apply it okay and you see something's happened there if you want to move up right click on your mouse press the e key so the q and e keys while you're right mouse button is pressed go up and down and then you can use wasd to move around you can see that it's created some bumps in the middle of the landscape and this is because this material is using a default brush called the simple brush so you can see over here on the outliner it's created a custom brush here if i select it and i go down to let's see i've got to go back and make sure you go back to details i'm still in world settings if you go down to the brush settings in what under number one open up material you can see that it's got this m simple brush at the moment that's what's applying these bumps in the middle of the landscape what we want to use is a noise brush that is included within the engine so if you click down here and if you search for noise then you will see various noise ones now if you don't see any noise brushes and you probably won't the first time you use the engine it's because you haven't enabled in the settings here show engine content and show plugin content so make sure that you've clicked these and then it shows all of the content in the in the engine because these noise brushes are in the engine content i believe so let's go back here and the one we want to use here is gen noise zero one so select that one and nothing will appear to have happened um but let's change some of these settings here let's change the tiling to 10 and you can see a few little some little bumps have appeared and but the elevation's very low at the moment and let's put the elevation all the way up to say six thousand okay and now we've got a very rugged landscape not very desert looking at all but one other thing we can change here is this octaves octaves is the um the noise um amount uh in in the frequency range so if you change this from seven to one you'll see that these bumps become very smooth and granular and so if i go into let's go down a bit here and go into play mode what we've got here it's kind of desert-like but it's not the sort of desert that i want if you if you um look at images of places like the sahara desert they're not smooth and bumpy like this they're they have ridges that um tie the dunes together so we want to change this noise so that it uses ridges rather than bumps and there is a noise texture or a noise function called voronoi that generates exactly the sort of shape we want so what we want to do is take that genoy01 and adapt it for the texture that we want okay so let's um shift escape to come out of play mode um let's just tidy up here a bit let's call this brush here but in f2 i'll call it main june's brush just so we remember which brush is associated with which layer and now what we want to do is we want to take this gen noise and copy it and amend it so click on the browse to to find it here drag your explorer up to the top level content level and then drag this gen noise 0 one material and put it into the content level and make sure you do copy here you don't wanna move it because you don't want to lose it from your engine content so click copy here and now if you click on content you've got this gen noise o1 here let's rename it and we'll call it gen noise desert okay and it's saving and doing the shader compilation for that okay now open this up and we're going to make a change don't worry about there's a lot in here don't worry about all of the nodes there's only one that we're particularly interested in and it's this custom noise so this is the main the heart of this uh material what it's doing is it's generating uh noise and then it's applying that as the height map and you can see that the type of noise is created at the moment is based on this function if i click on this it's currently set to three which is gradient noise but the noise we want is voronoi noise and they've actually put in the description here five equals paranoia so let's change that three to five and save and then for the next 30 seconds or so you will have this dialogue that says it's applying changes while it's recompiling the shader so let it uh go through and do its recompilation and that'll disappear once it's finished okay and once that's disappeared you should see the ball turn red on the left here we can now come out of here and what we want to do now is go to our brush our main dunes brush and change it from gen noise 01 to gen noise desert so type desert here gen noise desert and you see straight away that we have those classic large desert ridges so we fly around so this is this is looking good now you could leave it there if you wanted this sort of smooth desert look but personally i think it's a little bit too perfect what i want to do is add another layer to the landscape with some sub dunes that break it up so what we'll do now is we will right click on the main tunes layer and do create and we'll call this new layer double click sub dunes and what i want to do is i want to use my voronoi noise again but i'm only going to use a little bit of it on the second layer so choose go to our blueprint brush and choose our custom brush material only click on the landscape and first thing it does is it applies the um simple brush which we don't want so come over to the brush that's created on the right hand side where it says simple brush search for your desert gen noise desert and apply that and what you'll notice is that it's gone flat again we were expecting this to be added on top of our existing um [Music] our existing layer underneath let's see if we do the if we change the scale let's let's do this that changes to 10. so it's working oh actually let's make this 5000 so i can see what i'm doing it's working this brush but it's not applying it on top of the layer if we zero out everything here like the elevation and the octaves we would expect to see this layer underneath you see if i toggle the layer visibility it's still there so this is because the brush is missing a set of nodes that adds it to the existing height so we can fix that so let's leave this for a second let's just tidy up before we leave it let's rename this brush here the new brush to sub june's brush even though it's not doing what we want yet okay and now go to your content drawer open up the gen noise desert okay actually now close this down for a second what we're going to do first of all is open up the content draw we want to find the original gen noise o1 so if you click on all and search for um oh no the sorry simple brush the one we'll be using first of all okay and it's this one here the one that says um m underscore simple brush it's in the blueprint precious materials open that up and again this has got a lot in it but there's a bit that is um missing from our current brush and this is this height render texture so in the um simple brush what it's doing is it's taking the existing height unpacking it and then adding it to the newly generated over here it's it's um it's actually lurping it um but we can we can do a an ad on our existing brush so take these come back to these three nodes and do control c to copy them close that down then in your content draw go to the content level make sure you click x on the filter so you can see everything open up the gen noise desert and then what we want to do is just near the end here above this clamp just do control v and what we'll do is we will add click add we'll add what's coming out of this divide node and then plug that into the clamp node so you'll end up with this so effectively it's doing it's calculating everything but instead of just going straight to the generated noise it's adding it to the existing um height map before it before it puts out there so it should combine the two together now so let's save and again wait for 30 seconds or so while it recompiles okay and now it's done let's close this down and let me just to get this to do something you just need to um put in a new uh parameter here so let's put elevation scale of 100 okay and immediately we can see we've got the if we hide the sub dunes we can still see the layer underneath and then if we click on sub dunes it's still there so that's good it's now adding that to it but now what we're going to do is play around with these elements let's um move up slightly so we can see this dune and what we'll do is we'll play around with the tiling first of all so let's make the tiling of the original brush the main jeans brush was 10 so if we make this tiling 30 and let's make the elevation let's try 500 okay and can you see what's happened is that what you've now got is in between the main dunes you've got these um sub dunes they're not elevated as much as our original elevation was something like 6000 so we're just creating these gentle sub tunes in between and if you want to you could also use the octaves to create a little bit of noise in between those tunes as well so let's change the octaves to three for example and can you see what it's done is it's created a little bit of noise in between so this may be too much the only way you'll find out is by going into play mode so let's do that go into play it actually looks pretty good to me so i've still got the general might be a little bit intense um it looks maybe slightly rocky so let's maybe reduce the elevation slightly but the effect is pretty good it's broken up the smoothness of the craters in between the dunes so let's come out of play and maybe i'll just reduce the elevation scale by half to 250 yeah that's much more subtle and now we're going to play mode i've still got a little break up but it's smooth it's much more of smooth like a desert while still having a little bit of break up of the patterns okay so that's all the hard work done let's finish off this tutorial by playing with lighting and some post process effects to really sell the whole desert scene so i'm going to come out of play mode i'm going to go back into select mode and maybe now it's time to do a save as well ctrl shift s to save okay so i want to start off by looking at lighting don't worry about these artifacts by the way as long as you get those those sort of triangles generated while it recalculates so let's go into lighting first of all um first of all let's look at our main sun our directional light you can change some things here if you want obviously you can change the angle i often change this um y angle which is the main one that affects how close this to the um horizon horizon or not so you might want to change that to say -5 to bring it down a bit more like sunset you get slightly redder sound there the other thing you can do if you want as well um is you can go down to the light shafts and enable those and it's a subtle effect but what it does is it creates a little bit more contrast there'll be if you're in these shady areas you'll see the light shafts going above the above the dunes and it creates a little bit more contrast so it's up to you whether you want to include that or not you could even have light shaft bloom you'll probably have to reduce the scale of it but again depending on the effect you're going for so that's the sunlight taken care of let's also look at the atmosphere so you've got various um ray scattering here there's two types of um scatterings there's atmospheric scatterings this rarely scattering and this me scattering so you can play around with those um now quite an impact i mean if you change the rally scattering to say it's 0.03 at the moment that's 2.1 it um has really changed the um redness of the sand and the sky it might be a bit too much so 0.5 i'm not 0.5 sorry 0.05 okay that's sort of halfway in between and the me scattering tends to affect sort of uh sort of the uh particles that affect the blueness of the uh atmosphere so it's point zero zero three at the moment it's very low if i do point one actually it might be a little bit too low let's try 0.1 you can see it's really made it colder and darker and flatter to a certain degree i don't like that effect so much let's go back to 0.03 um and have it as a sort of a warming fight even that's a bit too much that's 2.003 yeah back where it was i like that sort of harsh harshness of the um [Music] of the shadows so what else can we do with the uh main lighting side well the let's look at the height fog um so what we can do here is we could create a little bit more depth by having more um uh fog in the distance so at the moment our fog then default fog density was point zero two i could change this to point one for example and that creates a sort of a more like a sandstorm in the distance and it's half the figure and go .05 you can change other things in here as well like you can change the fog color to make it maybe redder i won't change it here another thing you could try doing is you could try uh enabling volumetric fog and you can see that sort of uses the atmosphere the the sky atmosphere to cast fog details i quite like that so i'll leave that on okay so we've improved the ambience of our desert here by changing some lighting and fog effects and the last thing i want to do today is to put in a post process volume and do two or three final effects really to finish off so i will go into let's do a quick save i will go into window place actors search for post process volume and drag that in doesn't matter where now i can shut that place actors down and with that process volume selected in the outliner first thing i want to do is search for inf infinite extent and select that that means that this post process volume will apply across the whole of the level okay once i've selected that um go out of the search and now i'm going to look at a few things i can change so i'm not going to change the bloom first thing i'm actually going to do is going to clamp the exposure it does this adaptive exposure when you go into the game some people like it some people don't i personally like to have my exposure clamped so what i'll do is i'll select my minimum maximum brightness and make those both a figure of one okay and you can see that's already darkened the scene a bit if you want to you could um if you don't like this to be in this dark you could pick your directional light i'll go to the angle here which is minus five and maybe i'll make it a bit higher minus eight okay that's lighten up slightly i actually quite like it a little bit darker so maybe minus six okay right back to our post process volume so we've fixed the exposure um let's go down a bit more and the next thing i want to do maybe a lens flare so just check on tick on the intensity here and i've got a lens flare you can adjust the intensity to suit but i'm going to go with this default value of one and then depth of field what i want to do is i want the distant dunes to be blurriest if there's a sort of heat haze so i'll take the focal distance and the depth blur radius and i'll make the distance 5000 units and then i'll up the depth blur which applies after that focal distance 210 and you can see what happens is the foreground is still nicely in focus but the tunes in the distance are blurred even the sun has enlarged and blurred as well okay and there's all sorts of other things you could do in here you could do vignettes and color grading but i think i'm kind of finished for today so let's do a final um test let's go into play mode and actually let's go full screen as well with f11 and you can see i've got a lovely contrast between the orange of the desert and the blue sky you can see in the distance the dunes are blurred because of that post process blur i applied i've got lens lens flare and generally speaking it's looking pretty good so that's what i'm going to finish off for today i hope you found this useful this is now template for you to add whatever you want you can add your own oases desert towns whatever whatever you want um so uh have fun and stay subscribed and i'll see you in the next one bye for now
Info
Channel: UnrealityBites
Views: 159,329
Rating: undefined out of 5
Keywords:
Id: 0vDnDErh_2Q
Channel Id: undefined
Length: 34min 48sec (2088 seconds)
Published: Mon Apr 11 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.