Geometry Nodes is one of the latest additions to the ever-evolving world of Blender and is one extremely powerful tool. It allows you to create and change an object's geometry in more complex ways than regular modifiers, and it allows you to create complex scenes quickly and in non-destructive ways, meaning you can always go back and tweak some of the parameters, making it extremely dynamic and versatile. Welcome to the exciting world of Geometry Nodes!
One thing to note is that Geometry Nodes is still being developed extensively by the developers of Blender, which means that new nodes will be added, and more workflow options will be available to you, making it one of the most exciting new features to come to the Blender toolset.
In this chapter, you will learn how to use some of the most popular nodes, and you will get a feel of what you can do using Geometry Nodes. You will learn how to distribute objects on points, using Math nodes to calculate attributes such as the distance between objects, as well as how to modify certain attributes such as scale, position, and rotation. Additionally, you will learn how to randomize certain attributes, which is important when creating dynamic motion graphics scenes.
This chapter will give you a good, but basic, understanding of Geometry Nodes, and later in this book, we will make use of other methods that will build on this chapter.
In this chapter, we're going to cover the following main topics:
Technical Requirements
All the projects in this book have been created and built on Blender 2.93.x. The projects should work perfectly fine with Blender 3.x versions too. There may obviously be slight changes going forward as they develop Blender 3, but most of the changes they usually do are minor and should not break any workflows. However, the Geometry nodes chapters will work strictly on versions 2.93.x, since these nodes are updated with every version change. Version 2.93 has Long Term Support (LTS) till 2023 and you can download it from here. https://www.blender.org/download/lts/2-93/
All the projects of this book have been uploaded on Github here: https://github.com/PacktPublishing/Taking-Blender-to-the-Next-Level
In this section, we will be looking at the Geometry Nodes workspace and how to apply the Geometry Nodes modifier to our base mesh. Additionally, we will take a quick look at the different nodes that are currently available in Blender. You will learn how to distribute an instance object across points on another object. Additionally, we will make use of some of the most used nodes such as the Point Instance node and the Subdivide node. You will also learn what attributes are and how you can use them to change the way your instance objects are displayed. Finally, we will use nodes to randomize different attributes of our instance objects such as the position, rotation, and scale.
Geometry Nodes functions as a basic modifier, but it also has its own workspace and editor. If you look at the top of the Blender interface, you should see a tab called Geometry Nodes. Additionally, you can change any window in Blender to the Geometry Nodes workspace by clicking on the drop-down menu in the upper-left corner of the window and selecting Geometry Node Editor from the list of available workspaces. This means you always have control over how you work:
If you look at the workspace, you will see the 3D Viewport window in the upper-right corner, the Spreadsheet window in the upper-left corner, and the Geometry Nodes window at the bottom. Currently, there is a total of 63 nodes in Blender version 2.93.2, but this number will quickly grow in later versions of Blender:
One area that Blender has been lacking in for a while now is in the creation of MoGraph dynamically; Geometry Nodes changes that completely by turning Blender into a powerful MoGraph-making machine! The reason why Geometry Nodes is perfect for MoGraph is that you can quickly manipulate many objects at once and because of its non-destructive nature. Additionally, you can introduce textures to drive movement or even use other modifiers in conjunction with Geometry Nodes.
Another great use for Geometry Nodes is for scattering objects quickly and easily. In previous versions of Blender, we had to make use of a particle or hair system to scatter objects across geometry, and that only gave us a certain amount of control. However, with Geometry Nodes, we have complete control to customize our node tree exactly the way we want.
You can even expose some of the parameters and values directly in the Modifier panel, making it very easy to customize your Geometry Nodes creations or giving you the ability to build custom node setups to share with others.
As mentioned earlier, there are currently 63 available nodes to use (including the Frame and Reroute nodes), as shown in the following screenshot. This number will likely increase with later versions:
If you have used the Compositing or Shading workspaces before, then you should be familiar with using nodes. However, don't fear if this is your first time using nodes. It can be very daunting at first, but we will look at the process step by step, and in no time, you will be able to create amazing and dynamic scenes using Geometry Nodes. In the next section, we will create our first, very basic node setup, and see it in action!
In this section, we will be creating our very first basic scene using Geometry Nodes. You will learn how to add the Geometry Nodes modifier to your base mesh and how to instance an object onto each vertex of your base mesh. We will look at some of the nodes that you can use to manipulate these instances such as Position, Scale, and Rotation. Additionally, you will learn how to randomize certain attributes, and we will also take a look at the different types of attributes and how they are used.
Let's begin by creating a new Blender project.
Let's begin by creating our base mesh. For this example, we will be creating a plane object and applying the Geometry Nodes modifier to it. Then, we will use this plane object to distribute instances of another object across it:
Now, let's scale our plane.
Now, let's open the Geometry Nodes workspace by clicking on the tab at the top of the Geometry Nodes interface. You will now see the Geometry Nodes workspace split into three main views: the 3D Viewport window (in the upper-right corner), the Spreadsheet window (in the upper-left corner), and the Geometry Node Editor window at the bottom. Perform the following steps:
Congratulations! You have created your first Geometry Nodes setup! You will see two nodes that have been added automatically: the Group Input node and the Group Output node.
It's important to note that your data will always flow from the Group Input node on the left-hand side to the Group Output node on the right-hand side. Everything between these two nodes will modify our geometry.
Before we start adding any nodes to our node setup, we need something to use as our instance object. So, let's create a mesh that we can use:
In the next section, we will use this Icosphere node as an instance object.
Let's begin adding some nodes! In this section, we will look at how you can add new nodes to the node tree and how to distribute your instance object across your base mesh:
With your Icosphere instance out of the way and your plane selected, you should now see two nodes in the Geometry Node Editor. If you don't see any nodes, make sure that the Geometry Nodes modifier is selected or has been highlighted in the modifiers panel on the right-hand side:
Nodes that change attributes should almost always be placed before the Point Instance node, as the points are not referenced after this node.
Note that your plane object has disappeared in the 3D Viewport window! The reason for this is that we have not yet specified an instance object for our Point Instance node.
Let's do this now:
Now, let's take a look at what has happened in the 3D Viewport window:
As you can see, we now have four Icosphere instances. Ignore the original Icosphere instance that we moved off to the side – you can even hide it if you want. The reason we see four Icosphere instances is that our plane has four vertices. It's creating an instance on each vertex. Let's increase the number of vertices by subdividing our plane. We can do this right inside the Geometry Node Editor as there is a Subdivide node that we can use.
The Subdivide node will increase the number of points or vertices on our base mesh. Let's examine how we can use it in our scene:
Notice that you now have nine Icospheres in your scene. The reason for this is that our plane now has nine vertices because of the Level 1 Subdivide node.
3
. Now you should see a total of 81 Icospheres because we have increased the number of vertices on our plane to 81:Now, let's change the scale of our Icospheres – there is a node for that, too! Let's add a Point Scale node:
Additionally, you can search for nodes without needing to know where to find them. When you press Shift + A to bring up the nodes menu, click on the Search option at the top and type in the name of the node you are looking for.
Notice that on the Point Scale node, you have access to three different numbers: X, Y, and Z. This is called a vector as it's a set of three numbers. Change one of the numbers by clicking on it and dragging sideways. You will see how the scale of your Icospheres changes according to the axis you scale on. Let's change the Type setting from Vector to Float.
We have now set the scale of our instance objects using the Point Scale node. In the next section, we will look at the different types of attributes available in Geometry Nodes.
Let's take a moment to look at the different types of attributes and data types that you will see:
true
or false
.The most commonly used attributes are Position, Scale, and Rotation (these are all vector-based as they consist of three numbers, which each correspond to the three axes of X, Y, and Z). However, there are also a few others that we will look at in later chapters.
Let's look at how we can rotate our objects. To do this, we will need a new node called Point Rotate. Let's add it to our tree:
You will see that the Point Rotate node uses a Vector data type because you can rotate using the different X, Y, and Z axes.
Click and drag the values next to the different axes to see how your Icospheres rotate in your scene. Please note that the difference between Object and Point is that Object will rotate every point in the local space of the object, while Point will rotate every point in its local space as specified by its Rotation attribute.
Next, let's take a look at how to change the position of our objects. For this, we need the Point Translate node. Let's add it now after our Point Rotate node:
Our scene still looks very uniform and a bit boring; however, Geometry Nodes allows you to easily randomize your attributes! Let's see how we can randomize the Scale attribute of our Icospheres. For this, we will need a node called Attribute Randomize.
Let's add it now:
This node is slightly more complex, as we can choose which attribute it will randomize and how it will influence the current attribute values.
Let's examine how we can randomize the Scale attribute.
We can use the Attribute Randomize node to randomize different attributes. Let's see how we can randomize the Scale attribute of our instance objects:
The default data type value is set to Float, which means we use one number for all three axes, which will result in a uniform scale.
Now we have much more control over how our instances will be scaled. We can adjust the minimum and maximum values for all three X, Y, and Z axes.
0
and the Max value to 1
. Notice that some of the Icospheres are not being displayed or might be very tiny. This is because we're using the Replace/Create operator, which means we're choosing a value between 0
and 1
and replacing the current Scale attribute with this new number. Note this value can be 0
, which will result in some Icospheres with a scale of 0
, making them disappear.Now we are adding our random value to the current Scale attribute, which will not result in Icospheres with a scale of 0
. Other operators you can use are Multiply and Subtract, which work in a similar way to the Add operator.
Let's randomize the position of our Icospheres!
This time, we're going to duplicate our Attribute Randomize node and reuse it for the Position attribute:
Let's configure the node as follows:
position
into the box. Please note that attribute names are case sensitive:-10
and Max value to 10
. This will randomize our Icospheres' positions from -10
, -10
, and -10
to 10
, 10
, and 10
in world space:Let's randomize the rotation of our Icospheres. For this, we will again duplicate our Attribute Randomize node and place it on the right-hand side of the position Attribute Randomize node:
Let's configure this node as follows:
0
and the Max value to 10
:It's very easy to change your instance object into something else. Let's do that now.
Start by creating a new instance object in our scene. For this, we will be adding a Suzanne object:
Now, let's take a look at what happened in the 3D Viewport window:
You can also mute or deactivate certain nodes to see exactly what they do. This is good practice for troubleshooting your node tree. To do this, highlight the node or nodes you want to mute and press the M shortcut.
Now, let's mute our three Attribute Randomize nodes:
Observe how your scene will update instantly! You can unmute/reactivate these nodes again by selecting them all and pressing M again.
Congratulations! You have now created your first basic scene using Geometry Nodes. Please save your project now, as we will continue to work on it during the next section.
In this section, we will be using textures to manipulate attributes to create interesting and more complex scenes. You will learn how to use the Attribute Sample Texture node to change specific attributes using a texture map.
Let's begin by making some changes to the scene that we saved in the previous section:
5
by adjusting the Level value on the Subdivide node. This will increase the number of instances we have in our scene.0.2
to decrease the size of our Suzanne instances: Now, let's take a look at what happened in the 3D Viewport window:
Now it's time to introduce a new node called the Attribute Sample Texture node. This node is used to sample a texture and apply the results to an attribute such as Rotation, Scale or Position:
MyTexture
.Your texture will now be displayed in the side menu:
Nothing will happen yet as we still need to configure our new node. Let's do that next.
Back in the Geometry Node Editor, let's take a look at the Attribute Sample Texture node. It has two attribute slots that we can use. The Mapping attribute is used to determine where and how the texture is evaluated.
scale
, in lowercase, and then press Enter:Notice that our instance's scale has been updated and matches our wood texture. Where we have black pixels, the scale factor will be set to 0
. And where we have white pixels, we will have a scale factor of 1
. Feel free to experiment with other texture types to see how it affects your scene.
You can even load your own custom image texture by choosing Image or Movie as the Type setting and then clicking on Open to load your image:
Try loading a grayscale image to see how it affects the scale of your instances. The following example uses a grayscale image of the Blender logo:
For this example, I've moved the Point Scale node after the Attribute Sample Texture node and lowered the value to 0.4
. The reason for placing the node here is that our Attribute Sample Texture node is changing our scale attribute. Therefore, any node before the Attribute Sample Texture node will not have any effect on the scale attribute. Remember that the data is flowing from left to right:
By now, you should have a basic understanding of what Geometry Nodes is and how it can be used to create amazing patterns or scenes.
In the next section, we will look at how to add keyframes and animation to our Geometry Nodes using basic math.
In this section, we look at how to create interesting animations using Math nodes and other objects in your scene. We will create a basic scaling animation by using the distance value between two objects in our scene and modify the scaling attribute using some easy math. So, let's get started!
For this section, you can start with a new Blender project:
10 m
. Click anywhere in the viewport to confirm these parameters:Now, let's add our first nodes.
Note that you have lots of tori in your scene. Yup, I also didn't know that the plural of a torus is tori until now!
Now, let's create a new cube object in our scene that we will use to calculate some math later on:
Great! You should now have enough instance objects in the scene. In the next section, we will use basic math to calculate the distance between the cube object and each of the instance objects.
Now, let's create our first Math node – the Attribute Vector Math node. There are a few Math nodes available, but for this specific example, we need to use the Attribute Vector Math node because of its Distance operator:
Notice that the Object Info node is not yet connected.
Important Note
One thing to bear in mind is that any node that uses an attribute is calculating that attribute for each instance in every frame.
Now, let's take a moment to look at the Attribute Vector Math node and how we will use it. We want to calculate the distance between our Cube object and every Torus instance object. We already have the position value of each Torus instance saved in the position attribute, and with our Object Info node (connected to our cube object), we also have the relative position of the cube. Let's see how we can calculate the distance.
position
and press Enter.Now we need to save the result of this operation to an attribute. Here, we can create our new attribute by entering a new attribute name that's not in use, but an easier option would be to simply overwrite the current scale attribute with our new result. Let's do that next.
scale
and press Enter:As you can see in the 3D Viewport window, our scale factor is currently too big. We can use some more basic math to change that:
We want to make our scale factor smaller, so let's use the divide operation to do this. We will perform a simple calculation to make our scale factor smaller:
scale / value = smaller scale
For the Result setting, we can overwrite an existing attribute. In this example, let's overwrite the scale attribute. To do this, click on the empty box next to Result and select scale from the list. Again, you can enter this manually and press Enter to confirm.
Your tori will disappear from the 3D Viewport window because we are now dividing by 0, resulting in their new scale being 0.
10
.Let's examine our node tree:
First, we are subdividing our plane into three levels. Then, we calculate the distance between our cube object and every torus in our scene by using the Attribute Vector Math node. We then save this distance value into our existing scale attribute, overwriting the current value. Following this, we divide our new scale attribute by 10 (the float we entered manually), resulting in a smaller scale factor.
Now, let's move our cube around the scene to see the effect in action.
Using this method, you can easily create interesting and dynamic motion graphics scenes inside of Blender. Experiment with this technique and try to affect the rotation or position of your instance objects rather than their scale. Have fun creating interesting animations!
Congratulations! You should now have a basic understanding of how to create different Geometry Nodes and how to use them to change certain attributes to create dynamic effects. Now, let's use what we have learned to create something more interesting.
In the next chapter, we will create a motion graphics scene using all of the techniques we've learned so far. Additionally, we will look at how to apply materials to our instance objects!
Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.
If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.
Please Note: Packt eBooks are non-returnable and non-refundable.
Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:
If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:
Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.
You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.
Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.
When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.
For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.