Create a Photorealistic Landscape in Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone my name is cape tandy in this video we are going to create this grassland environment we will cover topics such as using the paths racer inside of unreal engine creating and animating a camera inside of sequencer and learning how to create place and render foliage so that it looks realistic now before diving deeper into this tutorial i want to briefly touch on the software that i used to make this environment i used unreal engine gaia speedtree games and davinci resolve of course other software will work in place of the programs that i'm using however these are the tools that i feel comfortable with but if you have something else in your pipeline do feel free to use it at the beginning of the video i mentioned that i was using unreal engine 5's path tracer in this little segment i want to go over what the path tracer is why i use it and how i use it the paths racer is a rendering mode inside of unreal while it is not a real-time feature it provides you with physically accurate global illumination reflections and refractions the reason that i'm using it for this environment is because i have a lot of foliage in my scene just for my own trial and error i have found that foliage rendered with a path razor looks incredibly photorealistic and the second reason is i'm getting physically correct shadows from my plants all the way into the far distance of my environment it's all there right out of the box when you open unreal engine 5 you will be prompted to create a new project for this project i'm going to use the film video template with the blank level i'm also going to make sure ray tracing is enabled because the path tracer shares the same ray tracing architecture inside of unreal engine ray tracing has to be enabled in order to use the path tracer of course once our project is created we can later go in and enable ray tracing but i'm just going to do it at the start once i'm in my project i will delete all the default lights i'll then create my own using the environment light mixer the next thing i'll do is i'll go into my place actors tab and add a post process volume the first thing i want to do inside of my post process volume is fix my exposure and the way that we're going to do that is we're going to clamp my exposure values what i will do is type in exposure and clamp the min and max to a value of 1. next we need to make sure that infinite extend is enabled if we do not check infinite extend the post-process volume will only apply to our scene when we are inside of it so to fix that i'm just going to type in infinite and it up pops infinite extend and when i check that box you can see that the post process volume is being applied to the entire scene regardless of if i'm inside the post process volume after our basic lighting has been established it's time to start creating our terrain for this process i'm going to use a program called gaia however you can still make very believable trains inside of unreal engine tools such as the landmass plug-in or landscape brushes can quickly give you realistic landscapes that you can iterate on throughout your project before heading into gaia i'm going to go over my reference you can see that the terrain here is quite smooth and the main source of erosion comes from creeks and rivers that go through the train the terrain that i created inside of gaia for the grasslands project is very very simple i first started with a purlin noise to get my base shapes from there i added a river node to act as my main source of erosion i then sharpened up the e-terrain with a thermal shaper then extracted masks from my terrain such as this growth mask this flow mask and this arboreal mask now this arboreal node is new to gaia it simulates the placement of trees and shrubs on your train i'm using this node in this situation to generate a mask for my material so later on when i go to paint my trees on my train i can use the mask from this node as a base color for use inside my landscape master material more on this later lastly i'll export all of my textures as pngs for use in unreal once our terrain has been exported from gaia it's time to bring it into unreal i'm going to go into my landscape mode and import the height map from gaia once the map has been loaded it's time to properly scale our train going back to gaia you can see that the height of our train is 2600 and the scale is 5000 this information is important because in unreal one meter is represented by one pixel so in order to scale our terrain properly we need to multiply our terrain by 5000 and then divide it by our height map resolution which is 4033 for our z-axis we need to multiply it by 2600 then divide it by 512 and that will properly match the scale of our terrain from gaia the next step in our terrain process is creating the master material that we will apply to this terrain my landscape master material is kept very very simple the base color of it is driven by three constant threes lurked together using the masks that we generated from gaia i have a landscape coordinate node with the correct size of my landscape plugged into the uv channel of my masks so that they are mapped onto the terrain properly at the very end i have a static switch parameter that allows me to swap between my base color and my arboreal tree mask that i will use later on when painting my trees my roughness is being driven by a mega scans texture plugged into a multiply and a constant to control the intensity then a texture coordinate with a very small value is plugged into the uv channel to control the tiling and lastly my normals are also driven by a mega scans texture tiled across my landscape i then have it plugged into a flat normal a one minus and a constant to control its intensity once our material has been applied to our landscape i'm going to create a cine camera and piloting my camera i'm going to fly around my scene looking for a pleasing composition once i find a composition that i like i'm going to bring a mannequin into the scene now a mannequin is very important because it helps you with the sense of scale in your scene and later on in the process when we go to start painting our foliage it'll help us determine how large or how small our foliage should be before we start painting our foliage i wanted to quickly show the trees that i made inside of speed tree going through this tree it is in fact very simple a quick disclaimer i made this tree based off a tutorial by a man named daniel perez you can find the link to his tutorial in the description down below looking at the main tree itself it's very very simple you just have a main trunk with some branches coming off of it and then some dead branches towards the bottom one valuable thing that i've started using inside of speedtree is using reference you can see that i just downloaded a image from google brought it into photoshop convert to black and white and then brought it in as a leaf mesh and i use this reference image just as a silhouette to build my tree off of once i have the initial shape of my tree done i will add in my leaf cards each one of these leaf cards was made inside of speed tree in a different project file speed tree has some good tutorials as well as daniel's tutorial on how to create these leaf clusters like you see here so i'm not going to dive super into it because i don't want to steal daniel's thunder but that's a great resource if you guys want to learn more about creating foliage inside of speedtree the rest of my foliage that i will be using comes from quixo mega scans for now i'm going to start painting my trees onto my landscape i'm going to open up my material instance and toggle on my static switch parameter which will then display the tree mask that we got from gaia from here i will go into the foliage mode and add my pine trees so this process usually takes some trial and error trying to find the correct size and density of your trees as a general rule of thumb pine trees are at least in the setting that i'm painting them generally around the same size so for the min value which is how small the pine trees can be i'm going to do 0.8 and for the max which is how large the pine trees can be i'm going to do 1.1 and this is just the scaling value if we just go and do some painting now you can see my paint density is way too high so instead what i'm going to do here is i'm going to turn down my paint density 2.1 and see what that looks like that's still incredibly high so i'll go down to my secondary density and turn that down to say value of one and that looks a lot better going into our cine camera i'm going to move this foliage tab off screen for the time being i'm going to start painting down my trees and i can see just from my cine camera the area that i need to paint on my trees so my first painting of these trees is not going to be super dense because i don't want to paint down more trees than i absolutely need so you can see right here the trees look quite good but i think i could turn the density down a bit more so now it's just a dance i'll paint down some trees i'll go back into my camera and check then i'll paint some trees then go back into my camera and check and i will just continue this process until i've painted down all my trees and i'm happy with how they look now an important thing to note because we're designing this scene with gameplay not in mind is purely for cinematics i'm going to push the visual fidelity of my scene quite high which will result in low fps numbers this just something you need to be aware of and i will in fact toggle on my fps right here so you guys can see it i'm guessing that at the end of this project it'll be around 10 fps for my way of thinking as long as the scene looks photorealistic and it looks beautiful the fps does not matter in this case once i'm happy with my trees i'm going to turn off my tree mask and go back to my normal base color now it is time to start painting our grass before we begin our painting i'm going to quickly change out the material in the foreground you can see right now that the landscape master material is quite atrocious when viewed from this close of a distance it's more so meant to be viewed from afar so what we will do is we will go into the landscape mode and in here we can click on manage and we can select little quadrants of our landscape that we want to apply a material to so what i will do is i will jump into my cine camera and select each quadrant until i am happy with all the quadrants that i have selected which these this amount looks okay and then what i can do is i can go over here to this override material and apply whatever material i want to in this case i have a mega scans material that i am going to apply and you can see that it is now applied to these quadrants on our landscape for any of you guys that are wondering the foliage because it shares the ray tracing architecture it actually calls foliage over a certain distance so to prevent that there is a helpful console command like the one right here i'll put it down in the description of this video so you guys can just copy and paste it it's a value of zero and that will prevent your foliage from being cold away for my grasses what i usually like to do is paint the smaller grasses first and then progressively paint larger and larger grasses so for this base first pass i'm going to paint down some quiksole megascan grasses for the scene i'm using the wild grass and because we still have this mannequin here we can ensure that our plants are scaled to the correct size once i'm happy with my plant selection i'm going to increase the density of my plants and start painting them down the patch racer does render foliage a little bit differently so it's always important throughout this process to toggle on the path tracer and just check and see if the foliage is looking correct now is a good time to talk about termination lines when painting your foliage because you don't want your foliage stretching all the way out into the distance because one you won't get good performance in your scene and two it won't add any extra detail to justify the poor performance that you'll experience for the rest of your project you need to find good termination points to end your foliage for instance with my scene after the crest of this hill the foliage is not even visible so this is where i'm choosing to terminate my foliage now that i'm happy with my base covering of foliage i'm going to increase the size of my plants and go back over for a second pass to add some height variation and an important thing to remember when painting foliage as the size of the object increases the frequency of it decreases so as a general rule of thumb smaller grasses will be more numerous throughout your scene while larger grasses will be less numerous this process is very very similar to painting the trees it's just trial and error once i'm happy with the grass in my scene i'm going to start painting some shrubs and some bushes throughout it's also important during this step to consult with your reference look at how plants are clustered figure out what species of plants grow in your environment where they grow how they grow all these little details are very important when recreating nature now that i'm happy with the foliage in my scene i'm going to start tweaking my path tracer settings you can notice that my progress display down here for my patch racer is moving along very very slowly and that's because my path racer is set to a very very high sample count so for working in the scene i'm going to turn down the bounces to a number of about 12. i'm going to turn my samples per pixel down to 150 and as you can see it's rendering a lot faster now the filter width i find that a value of around 2.5 is what i prefer uh play around with this value and see how you like it but but basically the filter width uh sets the anti-aliasing for the paths racer so the smaller the number the sharper the anti-aliasing will be and the higher the number the more blurry your scene will be the reference depth of field is a high quality depth of field mode that you can access with the path tracer it looks very very nice and lastly i'm going to disable the denoiser for these foliage scenes the denoiser will only cause problems because of how fine foliage is the denoiser will recognize the fine leaves and needles of these grasses or the pine trees and it will interpret those fine objects as noise and it will blur them together and it will not look appealing at all so i would highly recommend turning off your denoiser the last step is matching the base color of our train to our foliage because what we're trying to do here is we're trying to sell the effect that the foliage is going all the way into the distance when in reality it's not this process too is also very much trial and error often times what i'll do is i'll swap to the unlit mode so i can go in and i can sample the colors when there's no lighting affecting them and another thing that we can do is we can bump up the intensity of our normal so that we can see it clear and what i'm going to do is i'm just going to mess with the normal intensity and the tiling of the normal until the normal map can somewhat look like the grass here in the foreground this too is another process that is just trial and error however i think this is at a good place for now and i'll probably end up tweaking this a bit more once the lighting of my scene is at a point that i'm happy with for this scene a large part of my lighting will be made up from my hdri now the hdri material that i made up is quite simple i have a constant three two constants and an absolute world position plugged into a rotate about access with an add and a normalized node all plugged into my textures uv channel now what these nodes do here is they control my rotation of my hdri on a sphere and these nodes here are from the kwixel mega scans master material and all they do is they allow me to change the saturation the brightness the contrast and the albedo tint of my hdri texture my material itself is set to unlit and two-sided next i'm gonna go and i'm gonna add a sphere to my scene and scale it up to where it is large enough to cover my entire environment now that my sphere is covering my entire environment i'm going to add my hdri material to it and lastly you need to go under your sphere and type in cast shadows and make sure cast shadows is disabled from here i'm going to go in and disable my directional light my sky atmosphere and my skylight and then i'm going to toggle on my path tracer now you can see that the path tracer still works even without a skylight now i'm not sure the exact science behind this but to my understanding depending on how bright your hdri material is i have found in some of my scenes that i haven't even needed a skylight next i'm going to go into my material instance and mess around with the rotation of my hdri until i find something that i like now that i have something that looks pretty good i'm going to turn back on my directional light my sky atmosphere and my skylight i'm then going to exit my cine camera and i'm going to align my directional light with the sun from the hdri once they're both aligned i'm going to go back into my camera and my path tracer and see how it all looks i think i'm going to also experiment around with some different hdri textures just to see what i can get this lighting looks okay however it's a bit too yellow for me so i think i'm gonna mess around with the angle of my directional light a little bit close enough to the origin of my hdri sunlight so it doesn't seem completely off but enough to where hopefully i can achieve some more pleasing lighting on my landscape now with this lighting it's already looking so much better i'm getting a lot more contrast and highlights in my plants i have deep shadows stretching over my terrain it's looking really really nice now one thing you're probably noticing is all these fireflies now this is a result of the path tracer and i don't know exactly the math behind why these fireflies appear but one thing that we can do is inside our post process volume inside our path tracing settings we can turn our max path exposure down to a value of about 10 and 10 might still be too high so i'm going to try five and we're still getting some fireflies so i'm gonna try three and three looks like it should do the trick so i've done some more set dressing in my environment and i'm happy with the results at this point i'm going to head into my post process volume and do some basic color correcting to my scene before rendering and bringing it into davinci resolve going to go into my post process volume collapse my lens and right here you can see color grading so this step i'm going to go by what kind of feels right i'm going to start by adjusting my white balance i'm also going to turn down my saturation ever so slightly i'm going to lift the gain of my scene a little bit just to make it a smidge brighter and i don't believe that i'm going to touch any of my film settings such as my slope my toe or my shoulder cool and that's all the color grading that i am going to do now that my color grading is at a point that i like it's time to create a animation sequence add our camera to it and animate our camera so the first step is creating our animation sequence i'm going to right click find animation and go down to level sequence and i'm going to name this such as say camera 1 from there i'm going to open it up and add my cine camera to it now you'll notice that while i've been working i've had my cine camera locked that way i can't accidentally move my camera in order to unlock it i'm going to right click go to transform and uncheck lock actor movement now the initial idea i have for this camera sequence is to have the camera start pretty low towards the ground and then slowly move up thus revealing the rest of the environment go into my camera click on it and move it down a little bit something about right here now for now i'm just going to keyframe my location and my rotation then going to change my fps from 30 to 24. 24 is more cinematic and it's also less frames that we have to render out i know i want my sequence to be around 10 to 12 seconds long so 10 times 24 is 240 so i'm going to type in just 300 here which is the the span of my timeline and then these brackets control how long my animation actually is and i'm going to move this one to 240. so now we have a 10 second long animation i'm going to go to the end of my animation and i'm going to make sure that i'm on a very very low speed and i'm going to just move my camera up ever so slightly and then keyframe my location and my rotation again now let's see what that looks like there we go we can see that our camera is now moving upwards now that's not too bad but it's pretty lackluster so to spice things up i'm going to add some camera shake so in order to create our camera shake we're going to go back into our content browser right click and select blueprint class from here we're going to toggle this down and we're going to type in shake and then select camera shake base and then i'm going to name this shake 01. we can double click to open this blueprint and up pops our typical event graph you want to close down this window and reopen it and this gives you a new ui which is easier to work with from here we're going to go back into our sequencer we're then going to click on track camera shake and add our shake you can see it's right here we're going to move this over to the entire course of our timeline now going back into our blueprint under the root shake pattern we're going to choose purlin noise and then toggling this down we can now start tweaking our noise pattern so first you want to go to timing and duration and turn the duration to zero this means that the animation will loop indefinitely next i'm going to head to my rotation and i'm going to turn my rotation amplitude multiplier to a value of 0.1 just to start what we can also do is we can toggle down the pitch yaw and roll and individually tweak these values now pitch makes our camera go forward and backward yaw makes our camera go left and right and roll makes our camera roll from side to side here are the final numbers that i came up with i chose location amplitude multiplier and location frequency multiplier a value of 0.25 my rotation amplitude multiplier a value of 0.1 my pitch amplitude a value of 0.5 my yaw amplitude a value of 0.5 and my roll i kept the same i'll now press compile and we are done with our camera shake now generally this step in the process is where you would add wind to your foliage you can add wind to the plants they made in speech tree but you'll need this specific console command which i will leave in the description down below however in my tests i have been unable to make the world position offset wind that is built into the quiksill master material work with the path tracer so for this scene i will not be animating the quiksil grass because at this point in time i do not know how to make it correctly work on that note it's time to render out our scene and for this step i'm going to use the movie render queue i'm going to click on this icon right here which will then open up my movie render queue i'll then click on unsaved config and here we can start adding in the needed settings for our render for my image setting i'm going to go with jpeg i'm going to delete deferred rendering and instead add path tracer next i'm going to add my anti-aliasing and when your rendering mode is set to path tracer the anti-aliasing tells the path tracer how many render samples there will be now the way that i'm going to test how many samples i need for this environment is i am going to simply toggle on my path tracer go over to my post process volume type in path tracer and see exactly how many samples i need so i've decided that this scene needs about 750 samples in order to look clean so to get 750 samples for my scene i'm going to turn my spatial sample count to 15 and my temporal sample count to 50. i'm then going to check override anti-aliasing and leave anti-aliasing method to none lastly i'm going to add a game override now what this game override does is it overrides lods and replaces all of them with the highest lod it uses high quality shadows which in our case i don't believe is needed because we're using the path tracer this game overrides is more so suited for real-time rendering however i still include it with my path tracer settings because i don't believe that it hurts anything lastly i'm going to go to output i'm going to leave my file format sequence name to default my output resolution i'm going to leave at hd you can render this out at 4k however keep in mind that it's going to take quite a while in order to render it i'm going to uncheck override existing output and everything else i'm going to leave default lastly i'm going to choose my output directory and then after that i'm going to click accept and render local once our frames have been rendered it's time to bring them into davinci resolve for our final step color grading i'm going to navigate over to the color tab and i'm going to create two nodes the first node i'm going to name exposure and i'm going to go under my lift gamma and gain and tweak the values until i get something that i like for this scene i'm going for something with a bit more contrast and a bit more punch once happy with that i'm going to name my second node colors now there are two things that i want to change in this scene i want to make the sky a bit more saturated so i'm going to go under my hue versus saturation and increase the saturation of my sky ever so slightly next going under my hue versus hue i'm going to select my grasses and make them a tiny bit more orange next i'm going to go into my effects library and search chromatic aberration removal this node allows you to add chromatic aberration to your video now i'm going to keep the values very very low here because i want it to be a very subtle effect there's nothing worse than seeing a cg render with chromatic aberration all over it it needs to be a very subtle effect and my last step is going to be adding a little bit of vignette now of course you can add vignette in unreal engine however i prefer to keep it in davinci resolve because i have a bit more control over the vignette again this effect i'm going to keep very subtle with a value of .05 and that looks good thanks everyone so much for watching this video it was my first video uploaded on this youtube channel and i am super stoked with how it turned out i hope you guys learned something and if you have any questions comments or concerns feel free to leave them in the comment section below until next time cheers
Info
Channel: Gabe Tandy
Views: 405,395
Rating: undefined out of 5
Keywords:
Id: WhZxDpvxMwY
Channel Id: undefined
Length: 27min 55sec (1675 seconds)
Published: Sun Aug 28 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.