EASY GRASS in Blender with Geometry Nodes!

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 landscapes tutorial for you so in today's video we're going to talk about how to model and spread grass inside a blender using geometry nodes so let's go ahead and just jump into it all right so we're going to start by downing downloading a grass material from ccotextures.com and i will link to this in the notes down below and what we're going to do is we're going to use this image in order to make our grass more realistic and then we're going to spread it using geometry nodes so start by downloading this so it's going to have a color map a displacement map normals opacity and roughness and so for right now what we want to do is we want to start by just modeling a basically a rectangle that's going to represent our piece of grass so we're just going to do a shift a we're going to add a plane and then i'm going to tap the n key i'm going to turn my screencast keys on those will show up over here but now what i want to do is i just want to rotate this and i want to turn proportional editing off but i want to rotate this by doing an r y 90 and hitting the enter key and i'll move this over and i'm going to scale it down like this one thing you may want to do um notice how i'm scaling this down to about the size that a blade of grass might be so one thing you might want to do is you might want to go into your object and go ahead and apply your rotation and scale just to avoid any issues then i'm just going to tab into edit mode i'm just going to move this up um i just want to select these edges though oh i'm going to turn proportional editing off so i'm going to drag this up like this so this is about the height of a blade of grass for right now so now what we have is we just have a piece of random geometry in here and it doesn't really look like anything but now what we want to do is we want to apply a material to that so i'm going to go ahead and i'm going to jump over into the shader editor so i'm just going to click over here and then what i want to do is i want to add a new material to this so i'm just going to come down here and click on the button right here for add new material that's going to add my principled bsdf shader so now what i need to do is i need to bring those materials in and set them up so that it's applied to this object so there's a few different ways that you can do this i'm going to link to a video down below about a fast way to do this using node wrangler so when you have node wrangler enabled you can just come in here and just do a control shift t with your principled bsdf shader activated in order to set this up automatically and so you do need to make sure that you've enabled node wrangler in your add-ons so node wrangler needs to be turned on but then when you select the principled bsdf and do a ctrl shift t you can go find that material so i'm going to go find the grass material that i downloaded so in this case i've got it in this folder right here i'm just going to select all of these and i'm going to hit principle texture setup and so what that's going to do is that's going to come in here and that's going to set up my principled shader automatically for the most part there are some things that we need to adjust right but it's going to automatically set up my roughness my color map as well as displacement notice how it did not bring in the most important one which is going to be the opacity map so um first thing we want to do though before we bring the opacity map in is we want to go in and we want to adjust the uvs of this because if you look at this what this has done is this has placed all the pieces of grass in here and it's just kind of like stretched it right so we need to go into uv editing mode and we need to adjust this so we're going to go into the uv editing tab and what i want to do is i'm going to select the four corners of my object right so i have those selected over here well notice how what's happening is i can actually see that over here i'm gonna click this drop down and your foliage color map should show up in here but notice how when you select this you get these four dots over here those are going to correspond with these four dots right here so what i can do is go into my uv editing and i can adjust those i can adjust those the same way i adjust my geometry in blender and notice how wherever i move that box it's affecting the way that that material is placed on this object so what we want to do is we want to bring this in and we want to scale it out like this and then we may need to yeah we need to rotate this so i'm going to select this i'm going to rotate it 90 degrees like this and notice how i'm watching how this is being applied over here but then we're just going to take this we're just going to drag it up like this we'll notice how now what we have is we have a material applied to our blade of grass right here but the problem is it looks like a box right it's also perfectly straight which we'll fix in a minute but right now it looks like a box and so what we want to do is we want to go back into our shading editor and remember how i said that one of the maps didn't get applied we want to go ahead and we want to apply that so the way that i'm going to do that is we need to bring in the opacity map so this is going to mask out the background that's in here and so we want to do is we just want to do a shift a and we want to bring in a we're going to do a shift a and we want to bring in an image texture node so when we bring in the image texture that's going to allow us to load in an image that we can then link over here so we want to go find that opacity map so we want to go to the f or we want to go to the folder where we downloaded that in this case i've got it right here and i want to bring in the opacity map and i want to drag the color into the alpha so when i drag the color into the alpha notice what i'm getting right now is i'm getting just a black background in here around my piece of grass and so that's still not quite doing what we want it to do because we need to change a setting so you can get into the settings by tapping the n key but you want to come in here under options and you want to change your blend mode to alpha blend so when you change your blend mode to alpha blend what that's going to do is that's going to allow you to have transparency where this opacity map is coming in so now this looks like a piece of grass right even though if we were to tab into edit mode it's still just a rectangle right here so now we can start adding some detail so what i can do is i can go back into layout mode right here i can tab into this in order to go into edit mode but then i can do a control r in order to add some edge loops in here so i'm going to do a ctrl r and then i'm going to scroll my mouse up a little bit and then i'm just going to left click and right click that's basically set this up so that now we have more geometric detail for our piece of grass and so from there there's a few different things you can do the first thing you can do is you could take this and you could duplicate it so you could do a shift d and move it over and then for this object you could click into your uv editing mode and you could set this up i'm going to do an a to select all of these and you could move this over whoops we want to make sure we have them all selected we can move this over so that this is mapped to a different piece of grass so notice i'm changing the uv mapping of this object so that it's not the same piece of grass as what we had in there before so now let's do it again tab into edit mode and i can set this one up with this piece of grass right here and so one thing you might want to do with this one is you might want to scale it down on the z axis so it fits a little bit better but by doing this you can move multiple different piece of types of grass in here so that they're not all the same so i can do it one more time tab in here and for this one i'll set the mapping up to this piece of grass so now we have multiple different pieces of grass in here well now what i can do is i can go back into layout mode and i can start setting these up so that they look a little bit more like grass and you need to think at this point a little bit about what the grass is going to look like like if you do an image search for grass and look at images so if you do an image search for grass and look at images you can see how different areas of grass look a little bit different right like some of these just have like a whole bunch of different blades in here individually and some of these are a little bit more clumpy so i've got like clumps of grass so you just kind of need to think about the kind of grass that you want to create but basically what we can do is we can just come back in here and we can just align these all together so i can just move these over a little bit and then what you can do for each one of them is you can just tab into edit mode and you can just kind of adjust these and one thing that's probably good is turning on some proportional editing when you do this but now maybe see if i kind of like move this over a little bit i can have my whole piece of grass kind of move with me so i can tab in here i can move this over i can move it out maybe down but notice how by using that proportional editing i can kind of like randomize my pieces of grass in here so i'm just going to do that a little bit more it doesn't have to be perfect it's something you can kind of play around with so you can play around with like the size of your proportional editing in order to get different results and so then what i'm going to do is i'm just going to place these in kind of a clump right so i'm going to put this in a clump and so then we could just come in here we could just duplicate these and you might want to spread them out a little bit more you just kind of have to play around with this a little bit and you can get as creative with this as you want but you could take this and you could duplicate it kind of scale it down so you've got some different clumps in here but what that's going to do is that's going to give you groups of grass that you can then spread along the plane so now your grass is kind of ready to go it's ready to kind of render out and so now let's spread these on a plane alright so now what i've done is i've brought in a surface over here on the right hand side that we want to spread our grass across with our geometry nodes so to start off let's create a workspace so we can work with our geometry nodes we're just going to click over here on the plus button and we're just going to add a general layout workspace and what we want to do is we want to drag down from this corner so that we have a second workspace and then i'm just going to click the drop down right here and we're just going to add a geometry nodes editor and so this is our surface that we want to apply this along and so what we want to do is we want to select the surface we want to add a geometry nodes modifier so i'm just going to click the drop down click on the option for geometry nodes well now inside of the geometry nodes window you should get these two options right here and so we want to do is we want to use these options in order to place our grass on our surface and so the first thing we want to do is just kind of get some points in here so that we can see that this is doing something so to do that i'm just going to do a shift a all right so the first thing i'm going to do is i just want to do a shift a and i just want to add a point distribute node so i'm just going to click right here in order to add this to this node setup and so notice how what that does is that replaces the surface i have with points from my surface right and notice how if i adjust the density the number of points is going to go up and then they're going to move based on the seed but we're not going to worry too much about that right now so the problem that we have right now though is notice how this replaced our uh our plane that we wanted to place this on right so now our plane is no longer here we just have a bunch of random points what we want to do is we want to add another node called a join geometry node and so we want to take that join geometry node we want to put it at the end here and then we just want to drag a node from here down to this point right here right so now what it's doing is it's creating points up above and then down below it's placing the original geometry in here and then we're joining them together into a single piece of geometry so now we've got our random points in here and we've got our geometry well now what we want to do is we want to set this up so that it's going to randomly place our grass on our surface and so the way that we're going to do that is right now this is just creating a bunch of points with the point distribute node what we wanted to do is we wanted to put something on those points so we're going to add what's known as a point instance node so i'm going to do a shift a we're just going to add a point instance node and just click on this line right here and so what that's going to do is that's going to give us the option to place something on those different points and notice how you can place objects or collections but if i was to click on this button right here and then go over and select one of my blades of grass notice what that's going to do is that's going to place blades of grass on the points that are in here so i'm going to get more or less depending on the density that i set but that's not quite giving us what we want right because what we want is we want these full clumps to be in here so um the way that i'm going to do that there's a couple ways you could do that you could put these in collections i'm finding it easier to just join all this geometry together so i'm just going to select all of this and do a control j and if you do want to keep it all separate for editing or in case you want to create something else i'm just going to do a shift d i'm just going to duplicate this over here and so what i want to do now is i'm just going to select the pieces of grass that i want to go on a clump i'm just going to do a control j and that's going to join these together i'm going to do the same thing with this one right here do another control j like this so now these are in here as one object rather than multiple objects well now in my geometry nodes if i reference one of those by clicking on it notice how it's going to place the clumps in here rather than just the individual blades of grass so now we can start playing around with our result to try to get the result that we want in here and so what we're gonna do is we're going to first off notice how when you turn your density up we're getting more grass but the grass is all following the direction of the actual surface right so instead it's growing up and down like grass usually would it's growing like at weird angles and so we need to do in order to fix that we need to adjust some of the attributes associated with these objects and so what we're going to do is we're just going to drag this off to the right and we're going to make some space in between our point distribute and our point instance and we're going to add a couple notes so we're going to start by adding an attribute randomize note i'm just going to click in here in order to place that and so notice how right now that's not doing anything but what this can do is this can randomize different attributes having to do with your objects and as of right now you have to type things in here which is a little bit annoying i wish there was a drop down in here but for example we're going to type in rotation into this box and hit the enter key and so we've set our rotation in here and right now you can see how if i adjust this it's kind of it's not giving us a very good result right like these are just kind of like all over the place that's because as of right now we're giving it a float value well what we need to do is click in here and select the option for vector value what vector is going to do is that's going to give us control over which directions are randomized so in this case for example this is randomizing the x y and z axes well the only thing i want this to randomize is the z axis so i'm going to set the first and second ones of these to zero but then i can also set this so that the rotation is randomized just by adjusting this value right here and so real quick i'm just going to do a little bit of cleanup just to get these out of the way but this still looks pretty uniform right like even if we crank up the density like all the grass is kind of exactly the same well what we can do is we can use another attribute randomized node and randomize the scale so i'm just going to do shift a do an attribute randomize then for this one we're going to adjust the scale and so notice how with that one what it's going to do is it's going to randomize the size of the grass that's in here and so i think we'll just leave this as the float for right now and we'll just adjust this where this is set somewhere between maybe like point seven five and one point three should be fine so notice how we're getting in here is we're getting this random grass based on our clumping well we've already done this once let's do it again with our other clump right and i should probably randomize this a little bit more maybe something like this but now i'm just going to take this whole thing and i'm going to duplicate it so we're just going to take all of these and we're just going to do a shift d down in our node editor and i'm going to move these down just a little bit more and so in i think in the 2.93 version the join geometry node over here is going to allow you to join multiple different things in here right now it's just got space for two so what we're going to do is we're just going to add another join geometry node right here we're just going to join these together so we're going to drag our input geometry into the geometry node and then we'll drag the output into this join geometry node so we've got a join geometry and a join geometry and then what we want to do in this case is we want to select our other object right and so what that's doing is that's now spreading this again but with the other object but one thing you may want to note about this is you want to just change the seed in here just so that that second object and you might adjust the density a little bit as well just so that that second object isn't placing these in the exact same place as the first object so then what i'm going to do is on my plane i'm just going to come in here and just add a like a brown color so something that looks kind of earthy something like this should be fine i'll probably turn the roughness on that up and the specular down just so it's not looking metallic but now i've got a bunch of grass being placed on this plane and we may crank these up a little bit so i may do like a 250 on this one maybe like a 450 on the other one just to give me more grass in here but what that does is that just gives me all this grass on this hill so placing the grass is really easy with this method so there's also a much faster way you can do this using an add-on called scatter i'll have a link for that on the screen here as well as a video talking about how you can render this out with a white background so in the next video in this series we're going to talk about how to render this out so that you have more realistic light but for right now thank you very much for watching i really appreciate it and i will catch you in the next video thanks guys
Info
Channel: The CG Essentials
Views: 9,143
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 grass, blender easy grass, blender simple grass, blender grass easy, blender grass tutorial, blender grass geometry nodes, blender geometry nodes
Id: QczIET_E2h0
Channel Id: undefined
Length: 20min 36sec (1236 seconds)
Published: Fri May 07 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.