Blender Geometry Node Basics In Blender 2.92 | Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hi i'm chris bailey i'm a blender youtuber at c bailey film today i'm bringing you this tutorial with cg cookie we're going to be looking at gmg we're going to be showing you the basics of geometry nodes how to get started and how to use it let's jump in now don't forget to check out cgcookie.com you can start a free trial today and enjoy all the amazing benefits you get by being a member all right so welcome to this quick breakdown uh intro to geometry notes now just as a preamble what we're going to be looking at is geometry nodes as it exists right now in blender 2.92 there are a lot of additions that are coming in future editions of blender and we're going to try and keep covering those as they come out so that you can stay up to date with what you can do with this amazing tool i've just got a very simple scene actually that i put together in a live stream over on my channel at c bailey film a little while ago and i thought i'd use it as an example here now i've got my plan just you know what's on it i've got a subdivision surface with five levels of subdivision just to really create a lot of geometry onto this this plane i've got a displacement modifier as well at the moment i've got it turned off and it's attached to a um a texture here now i'm going to turn up the strength of my landscape just to give myself a little bit of geometric definition to make it look a bit like ground now in order to get to the geometry node window you want to create a space for yourself and drag up a window and you want to select just in the drop down menu right here geometry node editor and the first thing you do is you're going to select the object you want to use generation nodes with and click new immediately it'll set up a new geometry node group you can name it whatever you want let's call this rocks and grass and it takes the input which is the geometry itself and has an output which is what our final result is going to be now one of the key concepts in geometry nodes is the idea of a point so we can instance points across our geometry and manipulate those points change their position scale rotation and then we can instance geometry wherever those points exist think of a point uh as like a particle right particles are the same kind of thing it's something it doesn't necessarily render until you attach some kind of geometry to it or some kind of thing to it it's just a data point in space so first i'm going to do is instance some points across our plane so i'm going to hit shift a and i'm going to go down to point and i'm going to go point distribute so this is going to well it will instance points across my uh my my object but instance is probably the wrong word to use because later we're going to instance geometry to where those points are so it's a bit confusing if i say that so we're going to just create some points and distribute them across the plane now if i increase the density you'll start seeing these boxy things appearing and if you kind of see it's got some flow to it if i change the strength of my displacement you can see they move around right so they're following the surface of the plane object but you notice the planes disappeared and what happens is we're basically replacing the geometry we're taking the position of all the vertexes in our geometry and we're using those to then know okay well where along this plane should we distribute all these points and so that's how you get the topography there but we want to keep our plane then we need to actually create another node here called a join node so join geometry node so if i take my original input which is the plane as it is before we've done anything to it and i take our new version of it here to go to these points distributed i can combine them together and then send this to the output and bam you're going to see your geometry appear again now if i go to render view you'll see um none of these points are rendering i'm in a bit of depth of field on my camera gotta love that new ev depth of field beautiful so these points are literally just points in space so we need to actually instance some geometry wherever these points are so i'm going to create another node here i'm going to go shift a point and i'm going to go point instance and i will drop this in now it asks me what do i want object collection so you can get a whole collection of objects i'm just going to do a single object i've made a rock object already i'll show you that to you so this rock is literally just a simple uh simple sphere that i've squashed down i've put a subdivision surface sub modifier with this viewport level of four let me make sure my render is for as well and over here i've got a displacement modifier on that as well so that's what's going on here with this so jump back over and uh i'll grab that object so i've called it rock and now whoa what's going on here oh zoom out see we've generated thousands of rocks and they're all humongous so we need to change some things i'll come back down to density of give it like a density of 10 for now first i'm going to do is change the scale now you might think to yourself all right well i want to change some scales so i'll type in scale and oh here we go point scale great so i've made my geometry now i'm going to throw my point scale down here and i'm going to change my scale but this actually isn't going to work whenever you are instancing geometry in geometry nodes once you do that it's like the last step you can't change the geometry once you've instanced it not not in the current build right what you want to do is change the points before you instance the geometry so sort of change the scale we actually want to change the scale of our points not our rocks after we instance them across our objects so if i plug this back in here and unplug this and take point scale i can bring it back over here now it's going to work of course nothing's happening yet and this also does introduce some new ideas so what is this the attribute here and factor what is it asking for for me so in geometry nodes one of the biggest things you're going to deal with are these ideas this this thing called an attribute an attribute is basically like a spreadsheet that lives on an object and it has all these different um sort of labels with some kind of value attached to them think of them as variables if you're into programming or if you've watched my my python tutorial an attribute is a variable that has some kind of number in it or string or anything in it attributes are really powerful and it's one of the key aspects of geometry nodes especially going forward they're going to be even more important for you to understand but we're just going to put a bookmark on this we'll come back to it in a second what we're going to do with point scale is actually switch it to vector now i can change these vectors you know i could bring this down to like point one and i could bring this one down to point one and this one down to point one and now all my rocks are 0.1 in size that's a bit labor intensive to type that three times so what i can do is i can grab a value node which is just a single number and i can plug it into this vector and now it's going to put whatever this number is in all three of those for me so i can go even smaller i'm going to hold down shift and i can kind of move around and there you go now uh all the rocks are the same size and that doesn't look very great so we need to put some randomness in here so thankfully there's a cool move for that instead of point scale what we can use to create randomness search attribute we come down to attribute randomized so now we're going to talk about attributes in a way that's relevant okay i'm going to drop this right here now this is going to we're going to be replacing over the information that's put in with scales this is irrelevant now but what we need to do is we want to randomize the scale attribute of our object so an example of attributes are scale position rotation those are like the basic ones the uv is also an attribute and you can make attributes you can call this whatever you want you know we could say okay i want to make a random attribute called fire and i'm going to set my minimum max and now it's going to add in an attribute called fire and it's going to put a random number between 0 and 1 into this object and now i could use that number later somewhere else if i wanted to in this case we're going to use one of the pre-established ones which is scale so if i just type scale in you can see automatically everything gets huge and if i just hold down shift and drag this down just to kind of make it small you can see now we have variation in scale tiny ones and big ones and so what it's doing is taking a single number this this floating point number between 0 and 0.03 and it's generating a random number and for each of the points it's changing the value in scale now if i made this instead of a float a vector i could create a random value between x y and z so they're going to be like somewhere really thin some would be really big but i want to keep uniform a uniform scale i think that looks a little bit better um in this particular case so i can adjust that i can come back to density and i could change this now what's so cool about it is i can come over to my displacement and my original ground object and you know i can change the strength here and you can see that as this object changes all these things are going to just appear on the object and track with it now we can do the same thing with rotation so it's another attribute so i can shift d to duplicate drag this over here and i can type rotation now these guys are going to rotate but that's a bit crazy i don't want them rotating all over the place well this is a good chance to use vectors so i can come over here and say okay i want the minimum rotation to be 0 0 0 and i don't really want to rotate on x or y i just want to rotate on z so i can just drag this number up and that's going to create a random value within that now all these rocks they look a little bit high to me like i'd like them to kind of rest a bit more in the ground so i'm gonna add in a uh let's see i'm gonna add a transform node drop that down here and i'm just gonna bring all of them uniformly down a little bit so they're intersecting all right now if i want to introduce another object so for example grass what i could do is i could take this whole system i could box select it just like this shift d bring it down get another join geometry node i'll just make this a little bigger see it shift d drop this down and stick this into here and then what i could do is come over to my group input and bring my geometry in and then instead of the rock object i could switch to collection now i've got some grass over here i can zoom over this just got a couple of splines um just some curves and i've just set those up in different shapes so i've got a variation and now i can do is i can grab the grass collection and instead of hole collection i turn that off and it's going to just use the objects within the collection itself so now i need to make things a bit bigger because right now they're a little too small so i could just do my scale and there we go so we start to see these guys now i probably don't want to be rotating it around the the zed so i might make this one and i also don't want to do this transform for these guys so i'm just going to delete that transform so i'll just adjust my my rotation values on my randomized rotation until they're kind of standing in the right angle and i've got a nice bit of variation on them and i'm going to bring them down too they're far too big and now one thing you'll notice is that they're all positioned in the exact same spot as all of my rocks and that's because the seed value that i've generated here for the point distribute node it's pretty much the same so i could technically keep all this stuff here and just pipe pipe over from this point right here and i'd get the same result right so if i want to change this up a little bit i can roll the seed and that will change where the points are all positioned originally so i can change that and i can also increase maybe the density of the grass we've got more grass so now you can see i've got grass i've got rocks and what's really cool is it's all dynamic and it's directly related to my ground objects so i can do anything with this ground object like scale it up scale it down what also is cool is that i can like take this and i can put it on other objects and it's going to just work so i could you know grab a sphere here and go shift a uv sphere and then i could add in a new geometry nodes and then just put rocks and grass on it and zoom in and here we go now we've got the same system at work so now you can continue to layer up all of these different things and create more and more objects you can have in your scene now some of the things that are coming to geometry nodes that aren't really here yet one of them is it's there's no real easy way to make sure that the grass isn't going to intersect the rocks so you can't take the position of all these rocks and come up with a way of subtracting them out of the grass unless you go really really really deep under the hood and force it to work in your direction now in order to understand how attributes work a little bit and kind of i guess give you a hint at where things are going with geometry nodes let me just show you one last little trick eventually we're gonna have a spreadsheet that will show us what attributes are on what objects so it'll be a lot easier to kind of pinpoint exactly what's going on right now it's a little bit of guesswork but that's all right so what we're gonna do is we're gonna go over here shift a and we're gonna create an empty i'm just gonna get out of rendered views so we can actually see our empty there he is just got snapping turned on and i'll just snap it to the surface and i'm just going to find a nice little point what we're going to do is use the position of this end bead to change the size of our grass blades so i'm going to come over here into my geometry nodes on my plane and i'm going to shift a and i'm going to grab an object info node and i'm going to grab my empty 01 all right so let's grab empty 01 there it is now i can access the information uh from where that thing is in space um and what i can do is i can use this to compare things so let's create an attribute to do some math so i'm gonna say let's uh let's come right over here and i'm gonna go for an attribute vector math node and i'm going to say let's take the position of this thing and let's figure out what's the distance between the uh let's see the location of this empty and the location of each of these blades of grass so how far is each blade of grass from this object so i need to switch this first one to a vector and i'll take the location and plug it in and for the second one i'll type position and that will look at the position of each blade of grass and it'll calculate the distance between it and this empty now i want to store it in something and i'm going to store it in a value i'll just call it scale two okay now we've just made this up this is just a variable could have been called anything so nothing's going to happen right but we've stored this scale to value now i can grab another attribute vector math i can drop it here and now what i can do is i can say all right let's take let's take the attribute scale to and i want to multiply it with uh so we're going to take our variable scale to we're going to multiply it with the scale of each plate of grass and we'll use it to overwrite the scale and bam you can see wow all of a sudden everything's gotten so big now we need to change the size of scale 2 so it's not creating this big of a difference so i can grab another attribute vector math and just put it before these two and i'm going to take scale 2 and i'm going to multiply it by a vector and i will grab a value node here and i'll just plug that in so we're going to multiply this guy and i'll just drag this down make it smaller and smaller and smaller maybe .001 now there's one last thing i need to do to make this work right so i'm going to switch this from original to relative so by switching this to relative i'm bringing in the relative location relative to the object that we've got the geometry nodes on so you've got on an original it's not going to quite work right so i'm going to bring my value back up here we go now it's working so what you can see now is happening is wherever i have my empty in my scene you can see it's affecting which gras where the grass is tall and where it's not tall where it's growing and where it's not growing now one other thing that you can do that's really interesting is that you can actually clamp the values at the moment by using a color ramp node so if i put a color ramp attribute color ramp node in between my um where i'm calculating the distance from each blade of grass to my empty i come over to here to this and i can actually say all right i'm going to take the value of scale 2 and i want to write this to the value of scale 2. so basically overriding scale 2 and you can see it changed what's happening is it's basically it's clamping it and it's never going below zero one now um but what that means is i can now use this to then bring it up so i never lose the grass entirely but i could take this one now and i could bring it to like 1.2 for example to go above white and now these are all going to be a little bit taller and i can adjust the falloff just like i would if it was a material i can even add in more nodes and like say let's make this one black right so we've got this little gap where we're going to lose the grass completely if i wanted to like cut it off from my background or something well thanks for watching this video i hope you found it really fun and engaging hope you learned a few cool things about geometry nodes that you can start using in your own projects please like this video if you enjoyed it and don't forget to hit the subscribe button and ring the bell if you want to get notifications for when we drop new videos stay tuned i will catch you in the next one until then have a fantastic week see ya you
Info
Channel: CG Cookie
Views: 76,966
Rating: undefined out of 5
Keywords: Blender tutorial, learn blender, CG Cookie, blender beginner, geometry nodes blender 2.92, geometry nodes blender tutorial, blender geometry node attributes, create environment in blender, how to do grass in blender, how to create realistic rocks in blender, blender geometry node basics, Geometry Node Basics In Blender 2.92
Id: P1G2yDxsEpU
Channel Id: undefined
Length: 17min 25sec (1045 seconds)
Published: Mon Mar 15 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.