Creating a FOREST with Geometry Nodes in Blender!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys justin here with the cgessentials.com back with another blender geometry nodes tutorial for you today so in today's video we're going to talk about how you can quickly spread things like forests onto terrain using geometry nodes so let's go ahead and just jump into it alright so first thing i'm going to do is i'm going to create my terrain and so i'm going to do that by doing a shift a and just adding a plane then we're just going to scale it up a little bit we're going to tab into edit mode and we're going to subdivide it a couple times so i'm going to subdivide it by 10 then i'm going to right click on it i'm going to subdivide it again and we'll maybe subdivide it by 5. so that ought to give me enough detail in here and one thing we have a new rule on the channel you don't delete the default dog so we're just going to move her out of the way but definitely not going to delete her so we'll set her up right here so she can watch what we're doing and so what we're going to do is we're just going to use the move tool with proportional editing real quick in order to create a terrain so i'm just going to tab into edit mode select a vertex and then i'm just going to move it up and first we need to turn proportional editing on and we'll just scroll our mouse wheel up so that this covers more area then we'll do the same thing over here the same thing over here we'll do the same thing over here that ought to give us enough right now in order to work on this tutorial and so what we want to do is we want to spread some low poly trees across the surface using geometry nodes and so in order to do that i'm going to download some low poly trees using the sketch fab add-on so i'm just going to activate this add-on i'm just going to search for low poly tree all right so we're going to go with this low poly pine by a float above the world and you can download that from sketchfab here's the model information and so what i'm going to do with this is i'm going to take the whole thing first of all i'm going to take these two pieces and i'm going to do a ctrl j to join them i'm just going to move them out of the way and i'm going to scale this tree down so one thing that's going to be really important if you don't want to have a bunch of weird errors is when you scale this tree down you want to make sure that you go into your object settings and apply your rotation and scale so now i have the tree and my surface so now we're ready to go and so what we want to do is we want to come in here with our surface and we want to start by adding the geometry nodes modifier to this surface what that's going to do is that's going to allow us to edit the geometry nodes contained or that's going to allow us to adjust this based on the geometry nodes and so we want to do is notice how if you don't have a geometry nodes window you might want to create one this is basically a new workspace that just has the 3d viewport then down here i just click the drop down and clicked on geometry node editor and so what we want to do is we want to set this up so that we can distribute this object along this surface and so the first thing we want to do to do that is do a shift a and we want to add a point distribute node so i'm going to click in here click on point distribute then i'm just going to click along this line and so what you're going to notice is you're going to notice that you're going to get a whole bunch of points in here but we already have a problem and the problem is that our surface went away and so what we need to do is we need to set this up right now this has an input of geometry and it has an output of points right what we want to do is we want to set this up so not only does it output the points it also outputs the original geometry and so what we're going to do for now is we're just going to do a shift a and we're just going to add what's known as a join geometry node we're just going to click in here click on this line in order to add that so now we have a join geometry node set up well now what we want to do is we want to drag another node from this point right here to this point right here and so notice how what that's doing is that's joining this into a single piece of geometry so and one thing i'm going to do is i'm just going to hold shift and drag the right mouse button i'm just going to clean up these nodes real quick and for now i'm just going to set this up this way so now we have points going on our surface right you can adjust the density by dragging this up and down and so now what we want to do because we don't want a bunch of points on this surface right what we want is we want objects on this surface so what we're going to do for that is we're going to do a shift a and we're going to add a point instance node so what a point instance node is going to do is this is going to put an instance of an object on every one of those points so notice how the points don't show up in here anymore well that's because now it's trying to place an object on every one of those points what we want to do is we want to use a little eyedropper in order to set the object that we want to place so i'm going to click in here and then click on this tree you'll notice how what that's doing is that's that's placing instances of that tree on every one of those points so notice how you can adjust the number of trees in here by dragging this value left or right and so there's a few things we need to clean up in here so the first thing you want to clean up is trees don't grow facing along the face like this meaning they would usually grow straight up and down so what we need to do is we need to edit the attributes of the tree that's being placed so the way that we're going to do that is we're going to add a new node before the point instance node so that is going to be an attribute randomize node so we're going to click in here and then click on this point right here and so what that node is going to do is that's going to allow us to randomize different attributes of these objects so notice how right now though nothing is happening and so the reason nothing is happening and this is one of the more frustrating things about geometry nodes right now by the way is you need to put an attribute in here that you want to randomize and i wish there was a drop down menu in here that gave you options instead you just have to type in values so let's say for example that we wanted to randomize the scale well we would just type in scale right here we'll notice what that's doing is that's randomizing the size of the trees that are in here and you can adjust the minimum and maximum size of those trees so maybe you wanted these to be somewhere between 0.8 and 1.2 like this you could use that in order to randomize the size you can also type in a value like rotation and so notice what that's doing is that's randomizing the overall rotation of our objects but it's not giving us the result that we want so the reason it's not giving us the result that we want is because this is currently randomizing the rotation or all of the different rotations in this object right so the x y and z so what we want to do is we want to click the drop down we want to select a vector value instead well a vector value is going to allow us to set the x y and z attributes in here so what we want to do is we want to come in here and we want to set all of these except the z value to zero so we don't want this to randomize the rotation of the straight up and down at all and so when you set these to zero notice what that's doing is that's no longer rotating these in order to face the direction of the surface anymore now they're facing straight up and down but you are getting random rotation in here around the object's origin point so you can use this in order to randomize that rotation and then we might also do a shift a and add and attribute randomize for our scale and so for our scale all we're going to do is just adjust our scale so that it does what we did before which is a value of like 0.8 and a value of 1.2 what that's going to do is just make your trees a little less uniform right so you're getting random trees placed in here so we're currently using those geometry nodes to place these trees and so that's great if you just want to randomly place these all across the surface right so these are just going anywhere you can adjust the density with the point distribute node but let's say that we wanted to be able to set areas where trees don't occur so the easiest way to do this is going to be to use the weight painting associated with vertex editing so what we want to do is we want to take this object we just want to tab into edit mode all right and so what we're going to do is we have all these vertices selected right so we hit the one key and we tap the a key so what we want to do is we want to go into the object data properties and we want to add a vertex group so we're just going to click on the plus button right here and what we want to do is we want to take all of these vertices that we have selected click on the button for assign so i'm just going to click on the button for a sign right here i'm going to rename this ground so what we have is we have a vertex group called ground in here well that is a group that we can then pass to our point distribute node but before we do that what i want to do is i want to jump over into weight paint mode and i want to paint out a little bit of this area so that it has a weight of zero so i'm just going to set the weight to zero i'm just going to click and drag in here and that's going to paint the vertices that are in here based on that weight that we have selected right so i've just painted these so i have a value of zero and if you wanted to you could go into your geometry nodes and turn them off just so you could see um how this is getting painted in here but now what this means is this has a weight of one this has a weight of one and this has a weight of zero well now if we turn this back on if we go into the density attribute inside of our point distribute node we can type in the name of that vertex group so if i type in the value for ground notice how now there are no trees except for this one right here because there's a random light area in our weight painted area but notice how the trees are not being placed in this blue area so what that means is that means that now we can control where our trees are being placed right so that's one way to get control over the placement of objects inside of your surface so another way to do this which can be kind of fun and i've actually talked about this in another video a little bit but another way to do this is for this object instead of painting this out physically you could also add a modifier in here for a vertex weight proximity and so when we add a vertex weight proximity and i'm going to drag that above my geometry nodes we can actually set that vertex group in order to set the weight paint based on the location of another object so let's say that we were to pass this the vertex group ground and let's say that we were to add a uv sphere so i'm going to add the sphere scale it up a little bit i'm going to apply that rotation and scale well then i can set the target target object to be this sphere and notice how right now that's making everything kind of go away which isn't necessarily what we want so we want to do is we want to change our proximity mode to geometry and i'm just going to set this to vertex and so notice how what that's doing and it's overriding the manual it's overriding the manual weight painting that we did before but it's basically weight painting this object outside of the sphere so if we were to click in here and adjust like the highest and the lowest you can set how far out from the sphere that effect goes like this so you can use this to set your fall off so if you set these to the same values so one and a half and one and a half you're going to get a very uniform look around here if you were to adjust that to something lower notice how you're gonna get a lighter fall off around the outside and you can kind of see that result by jumping into weight paint mode right here so you can actually see the effect that this is creating using our sphere all right and then finally we're going to move this sphere over here and we can actually turn it off so that we don't see it in our window but finally let's say that you wanted to spread multiple objects with your geometry node right so let's say you wanted to do the point distribute in here but you wanted multiple objects so currently in the released version 2.92 this only accepts two groups of geometry right so what we can do though is we can add multiple join geometry nodes so let's say for example i'm going to make a little more room for myself here let's say for example you had a second tree so like this one right here let's say that we made some minor changes to that tree so just some mild changes right but let's say we also wanted to spread this tree in here well what we could do is we could just take this whole thing we could just duplicate it right here right i just did a shift d in order to duplicate it well we could just add another join geometry node right here then we'll plug that into this join geometry node so what that's going to allow us to do is that's going to allow us to spread multiple different objects right so all i need to do is just drag this over here and we're going to adjust our point instance so that instead of that first tree it's that second tree so i'm just going to select this tree right here and so now notice these trees are both getting placed in here but they're right on top of each other right well all we need to do to adjust that is just change the seed of the second group and what that's going to do is that's going to add the second trees in a different location than the first trees so you can use this in order to spread multiple different objects in here instead of just the one if you decide that you want to do that now i'm not 100 sure if there is a way right now to adjust them so that they don't run into each other that's something i'm going to have to research a little bit further but you can use this to randomly place multiple objects with geometry nodes inside a blender so that's why i'm going to end this video leave a comment below and let me know what you thought was this helpful to you have you been using geometry nodes i just love having that conversation with you guys if you like this video please remember to click that like button down below if you're new around here remember to click that subscribe button for new blender content every week if you like what i'm doing in this channel please consider supporting me on patreon every little bit helps so make sure you check out that link in the notes down below but in any case thank you so much for taking the time to watch this i really appreciate it and i will catch you in the next video thanks guys
Info
Channel: The CG Essentials
Views: 7,369
Rating: undefined out of 5
Keywords: blender, blender 2.82, blender 2.8, blender modifier tutorials, blender tool tutorial, the blender essentials, the cg essentials, thecgessentials.com, justin geis, justin geis blender, blender 2.9, blender 2.91, blender geometry nodes, blender forest, blender forest geometry nodes, blender weight proximity node, blender vertex group, blender vertex weight paint geometry nodes, blender geometry node forest
Id: kq7kI5XMB7E
Channel Id: undefined
Length: 15min 56sec (956 seconds)
Published: Fri Apr 16 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.