Save Days! Procedural Content Generation Framework (PCG) - Photoreal Landscape Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello in this video I'm going to be giving you an intro to the procedural content generation framework which is a way to create a very large natural environment with just a few clicks first why would you actually want to do this when we're creating very large natural environments like forests grasslands actually any natural environment there's going to be a lot of assets a lot of pieces of grass rocks trees whatever it is and we don't want to have to hand Place each one of those individual assets we want to create a set of rules that we give to the computer and let the computer populate our whole world with those assets for us of course we can still hand Place hero rocks and trees and things like that but this is a way to get you almost all the way there when building your natural environment and by the end of this video you should be able to use it to build this flowery grassland in just a few minutes so let's jump into it I'm going to be starting with this landscape with a grass material already applied to it this is something I do just to make sure that when we actually simulate the grass on top of it if you see through those pieces of geometry of actual grass you'll see a grass material so it gives a fuller feeling to our grassy environment I'm going to come over to the folder I've made for PCG in order to create a procedural content generation volume which is the first thing we need to make we need to enable the plugin so if I come up here to edit plugins and I type in row C Journal we should see procedural content generation framework as a plugin go ahead and enable that and restart the engine if it prompts you now I'm going to come back here to my folder and right click come up to PCG and choose PCG graph I'm going to call this flower power version 2. now all you have to do is drag it into my environment so I'll drag it straight on here my volume snapped the size of 25 by 25 by 10 but you can always adjust this later yourself as well the main thing you want to make sure is that it is overlapping with your landscape I'm actually going to make mine a little bit bigger okay so once you have your procedural Content Volume overlapping with your landscape we're going to double click it it to open it when you first open your PCG graph it's going to look like this we're going to have an input and an output for the purposes of this tutorial we're not going to worry about output and you'll see why in just a minute because we don't actually need it to simulate on our surface what we do need is the input and this is what we're getting from the landscape itself so any landscape that this volume is overlapping with it's getting data from and if I expand this node here I can see that there's a landscape output so I'm going to drag off of that landscape and I need to make a node that's going to sample that data which is called a sampler and the sampler that I want to use is called the surface sampler and this is going to be getting Point data from the surface of the landscape in order to view what this node is actually doing we need to start generating our PCG volume which we can do by selecting it in the world outliner and coming over here to the right side where it says generate we're going to hit that button and then come back to our graph and select the surface sampler node and hit the D key the D key is short for debug and it's going to be displaying whatever that node data is and in the format of these cubes these cubes represent the point that's being sampled on the surface of the landscape and the size of the cube is the bounds of that point so since the first thing that we're going to be simulating is grass we need to make these points a lot smaller and make a lot more of them over here surface sampler and lower the points extent and I'm going to lower it to one by one by one and we can see that the points got very small now I can come back to the points per square meter and increase it let's try 10 that's pretty good maybe we can try 20 or 30. so now we have a bunch of points on the surface of the landscape which we can use to spawn grass but I need to do one or two more things to this first right now if I spawn my grass they're all going to be facing the exact same direction so I need to add some Randomness to the rotation and to the scale of these points in order to do that I'm going to drag off of the out of the surface sampler and type in transform and the one I want is transform points I'm going to hit D on the surface sampler to stop debugging it and now I'm going to hit D on the transform points to start debugging that node and the first thing I'll do is come over to the rotation Min and Max on the right hand side here and this is a random range between these two numbers and these three boxes represent X Y and Z so what I want is to rotate the grass randomly in the z-axis so in order to do that I come over here to the z-axis and I type in 360 as the max rotation so it'll be a random rotation value between 0 which is this first number and 360 which is the second number and you can see over here in our points display that those little cubes are rotating randomly next we can also add a little bit of scale Randomness I will keep the max at 3 maybe and see if that looks good we may need to adjust this when we actually have our meshes of grass in there so now we actually need to spawn some grass based on this point data so I'm going to drag off of the out here and type in static or static mesh spawner click on that and this is where you're going to add in the meshes that you want the points to be spawning so for me I have already gathered a few grasses which I'm going to use for this example actually just two here in the static mesh spawner on the right side here there's a little plus button next to mesh entries I'm going to click that twice to bake two mesh entries in index here next to it I'm going to rotate it down rotate down the descriptor and drag my first grass mesh into the static mesh input and then contract descriptor and then in the next descriptor here I'm going to drag my second version of grass into it it may take a minute to load because the first time it's loaded the mesh into the PCG volume so now if I move my camera up here okay so this grass is looking really cool but it's extremely dense it might even be too dense my computer is starting to slow down a little bit so I need a way to filter out some of these points so there's not quite so many of them to do that I'm going to drag my transform points over here click on my static mesh spawner and I'm going to disable this particular node while I'm working so that the meshes are not spawning each time I make a change and to do that I'm going to press the E key to unenable it so now that node is disabled and my grass should disappear and now I'm left with just the points again so in between the Surface sampler and the transform points I'm going to be adding two nodes I'm going to hold alt and click on the out here to disconnect it drag these two nodes over and drag off here and I'm going to choose density noise and if I undebug the transform points here and I debug the density noise I can see what it's doing these colors of each of these cubes here represents density so what I'm doing is I'm adding additional layer of noise on to these points which is adding more noise to the color which represents density like I said because the next note that I'm going to be using is called density filter and this node if I debug this starts to filter out certain levels of density and we have a low bound and an upper bound here so we can now use this to control how many points we have by filtering out different layers of density so now that we have this control we can plug it back into the transform points stop debugging it and enable the static responder by pressing e and now we can come back to density filter and lower the density quite a bit that's much better so now we have a pretty nicely filled out grassland next let's add some flowers the cool thing about this surface sampler and the nodes we've already made is we can reuse them for our flowers as well so I'm going to go ahead and grab the density noise the density filter and transform points and copy it down here and plug it into surface sampler and the density noise itself I'm going to go ahead and adjust the seed so it's not exactly the same as the grass and the density fill filter we will leave the same for now and adjust when we actually have the flower meshes in there which is what we'll do at the end here we'll drag off and make another static mesh spawner and for the flowers I have quite a lot of meshes here which I'm just going to go ahead and add in here really quick okay so I've added all my grasses to the new static mesh spawner and we can see here that it's already populating great if I wanted to adjust the size of my flowers for example I feel like they're growing a little bit too big right now all I have to do is come back here to the transform points node and I can adjust the minimum and maximum scale here if I lower this down to one maximum scale they will all be a scale of one maybe I will increase it to 1.5 and the scale mint lower to 0.5 now I should have a range of different sizes that are a little bit smaller but now that I have that smaller size I want to add more flowers so I can just come back to the density filter here and increase the upper bound and lower the lower bound to let in more points from the filter and now I have a full field of flowers with just a few nodes and you can just start layering the complexity on top of it if you found this video helpful hit that like button and you can also find below this video of free training which I put together for those of you who want to use Unreal Engine as a filmmaking tool take you through that full process start to finish how to make your first short film using Unreal Engine you can find that below and I will see you in the next video which could be right here if you're into building more stuff with me
Info
Channel: Aziel Arts
Views: 26,451
Rating: undefined out of 5
Keywords:
Id: s41GdoN2QGg
Channel Id: undefined
Length: 9min 35sec (575 seconds)
Published: Mon Jul 10 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.