An Introduction to Geometry Nodes
In this book, you’ll learn how to work with Geometry Nodes. You will find basic and intermediate-level information about Geometry Nodes here. This book will help you learn various topics, such as distributing points, modifying meshes, creating meshes, and covering the basic nodes.
If you are learning any kind of Blender workflow, Geometry Nodes will surely be a handy tool to know about. They open up new possibilities for procedural modeling and animation.
You’ll also get the chance to try your skills with fun exercises throughout this book; these include exercises such as making a procedural plant, a procedural landscape, and a Procedural LED panel.
In this chapter, we’ll talk about the practicality of Geometry Nodes, why they might be useful for you, and some scenarios in which this new tool will be helpful. We will also go over the different node inputs and outputs. Finally, at the end of this chapter, you will learn how to access the Geometry Node system.
In this chapter, we will cover the following topics:
- Understanding the Geometry Node system
- In what situations are Geometry Nodes applicable?
- Understanding the Geometry Node editor
- The different node inputs and outputs
- And finally, how to access the Geometry Node editor
In this book, we will use Blender version 3.3, which can be downloaded from this link: https://download.blender.org/release/Blender3.3/
If you do not have certain nodes, then you might have an outdated version of Blender. While newer versions of Blender might work with this book, we cannot guarantee that everything will match the explanations we give. For the best experience, we recommend using Blender 3.3.
To download and view the complete node trees of the relevant chapters, click on this link: https://packt.link/UvynW.
To make it easier for you, we have included all of the node trees we cover in this book as scenes in this blend file (link above). You can switch these scenes by looking at the top right of your screen, where you see the name of the exercise. If you click this, you'll get the option to select your preferred chapter.
Understanding the Geometry Node system
The Geometry Node editor is a new feature in Blender 3.0. Over the months, it has evolved into a very useful tool that every CG artist should know. Geometry Nodes is all about procedurally modeling your mesh. This can help with big scenes where you need lots of objects to have variation. For example, if you are making a forest, every tree needs to have a bit of variation; otherwise, the scene will look like a render. To easily add variation to trees, we use Geometry Nodes.
Previously, creators would use hair particles to scatter objects along a mesh. With Geometry Nodes, this is no longer needed. Geometry Nodes will help in scattering all objects just the way you want. There are lots of ways to scatter your objects. We will also go over the various ways to randomize these instances. The idea of Geometry Nodes is to procedurally generate a complex mesh out of a basic and simple input.
Unlike the Material Nodes editor, which does not use a Modifier, the Geometry Node editor is a Modifier that can be applied from the Modifiers tab. This Modifier can be combined with other Modifiers like any other would. The Geometry Nodes Modifier consists of a few parts:
Figure 1.1: The Geometry Nodes Modifier
Part 1 refers to how many times the node tree has been used. If the node tree is only being used by one object, this number will not be there.The button in part 2 allows you to select a node tree out of the different node trees in your project.
The button in part 4 allows you to animate the value of part 5. This can also be done by pressing i on any value field.
Lastly, part 5 defines the current value that is being inputted into the node tree. You can change this value by clicking on it or by holding down your mouse cursor while sliding.
Behind this Modifier lies the Geometry Node system. It consists of various nodes to procedurally model your objects.
In what situations are Geometry Nodes applicable?
Many people think that Geometry Nodes are the new way to model in Blender, and for certain scenarios, this is true. But there are times when you’re better off using the normal modeling workflow.
Geometry Nodes are usually used to procedurally generate multiple objects at once and to scatter objects around on a mesh, for example, scattering grass onto a field, generating roads procedurally, or generating multiple buildings at once.
Geometry Nodes are generally not used to model complex organic structures with lots of features, for example, faces, human figures, clothes, etc.
While it is certainly possible to model these objects via Geometry Nodes, it’s very impractical to do so because the amount of detail in these objects is near impossible to program mathematically using Geometry Nodes. It’s much more practical to model the structures via the normal modeling workflow in Blender.
Now that we’ve got a better understanding of when Geometry Nodes are applicable, we’ll talk about everything you need to know about the Geometry Node editor.
Understanding the Geometry Node editor
The Geometry Node system makes use of the node tree design in Blender, like the material node editor. Much like the material node editor, the node system flows from left to right. Geometry Nodes can modify and create different types of geometry, such as the following:
- Point clouds
Let’s take an in-depth look at these terms.
A mesh is a structural build of a 3D model consisting of faces. 3D meshes make use of the three axis points, x, y, and z. A mesh is made up of vertices, which make up edges, which, in turn, make up faces.
A curve is a way to define paths in Blender; this can be used on multiple occasions. For example, if you want a camera to follow a specific path, this can be done with curves. These can also be modified, used, and created in the Geometry Node editor. This will be explained in Chapter 8, Editing Curves with Nodes.
A point cloud is a selection of scattered points around a mesh. These point clouds are only visible in the viewport and not in the render.
A volume is a semi-transparent effect that can also be experimented with in the Geometry Node editor. Volumes are usually used to create abstract effects in the Geometry Node editor but can also be used to create a foggy atmosphere in your scene.
An instance is best explained as a copy of the original mesh. This can be used to copy multiple objects around a mesh, much like we used to do with hair particles. This is mostly used to scatter rocks or grass onto a base mesh.
All of these datatypes will use the same connection type, a Geometry connection. This node connection is green. Let’s have a look at the input and output node connection of the Geometry Node system.
Exploring the standard Geometry Nodes blocks
Figure 1.2: Group Input node
The standard Geometry output of this node returns the base mesh of your object before any modifications have been made. This mesh basically returns the mesh you've inputted into the object's Edit mode.
This node is used to add variables to the Geometry Nodes Modifier so that you can have easy access to the most used variables. To create these variables, just slide a value into the unused node socket, and it will automatically occupy the node socket.
Figure 1.3: Group Output node
This will define the end of the Modifier. Just like the Group Input node, the Group Output node has an unused node socket to output extra data to the Modifier. This can be used to define UV maps, for example.
The different node connections and how to use them
Now that we’ve looked into the group input and group output nodes, let’s go over the various node connection inputs and outputs.
Exploring different shapes
The round node connection
Figure 1.4: The round input/output node connection
This is a round input/output node connection. This defines a single node value. For example, in geometry nodes, a single node connection can send through multiple values from other locations. With a round connection, this is not the case. This will likely result in the value being rounded to one value or returning an error value.
The squared input/output node connection
Figure 1.5: The squared input/output node connection
It accepts multivalue fields. This means that every vertex on our mesh will be calculated separately according to the node tree. This feature in Geometry Nodes is very fun to play around with because each point gets its own flow of calculation, which opens up a world of interesting possibilities. An example of this feature is adding noise displacement to your mesh; each vertex will get its own displacement because each vertex is being calculated separately thanks to the square input/output node connection.
Exploring different node connection colors
Boolean node connection
Figure 1.6: The Boolean input/output node connection
This node connection will define either an on or an off value; in other words, this is a value with either a 1 or a 0. As explained previously, this can either be a single value (circle shape) or multiple values (square shape).
Vector node connection
Figure 1.7: The vector input/output node connection
This carries three values combined into one. These values can be separated with a Separate XYZ node. It can also be combined with a Combine XYZ node. The vector node is used to define positions, rotations, scales, and offsets. It can also be used to define UV maps in the material node editor.
Geometry node connection
This is a geometry node connection.
Figure 1.8: The geometry input/output node connection
This defines geometry and instances. When you slide an object from the outliner into the Geometry Node editor, you will see this connection to add this instance to your Geometry Nodes project. This is also the connection you will see when you generate a point cloud with the Distribute Points on Faces node. This node will also show up on both sides when you use any geometry-modifying node, such as Transform Instance node, Scale Instance node, and any primitive mesh node. All of these nodes will be explained in Chapter 2, Understanding the Functionalities of Basic Nodes.
Integer node connection
Figure 1.9: The integer input/output node connection
This defines or accepts any value that is an integer; some examples of integer values are 0, 1, 2, 3, and 4. These values are basically values without a decimal point. These are usually used to define indexes of certain things, for example, duplicate objects. This node connection can be found on nodes such as the ID node, the Duplicate Elements node, and the Index node.
Value node connection
Figure 1.10: The value input/output node connection
This defines a plain value. The difference between this and an integer node connection is that the value node connection can contain decimal points. Some examples of nodes containing this node connection are the Noise Texture node and any math node. This value can also make use of multivalue fields, just like the square symbol we previously discussed.
Color node connection
This is a color value.
Figure 1.11: The color input/output node connection
This node connection contains three values, an R channel (red), a G channel (green), and a B channel (blue), also known as the RGB channels. These can be separated into their respective RGB values using a Separate RGB node. They can also be combined using a Combine RGB node. Just like the examples explained in the Exploring different shapes section, this node connection can also make use of multivalue fields.
String node connection
This node connection defines a string of text.
Figure 1.12: The string input/output node connection
This value will mainly be seen on nodes that are made to create or modify text, such as the String node, the String to Curves node, and the String Length node. This will be explained in depth later on in the book.
Material node connection
Figure 1.13: The material input/output node connection
It can be used to set the material of selected geometry in the node editor. This node basically refers to a material you’ve already made and one that is included in the project file. Some nodes that make use of this node connection are the Material node, the Set Material node, and the Replace Material node.
Figure 1.14: Geometry multi-connection input
Figure 1.15: String multi-connection input
The preceding socket is used to join strings together. It works in the same way as the geometry multi-connection input.
Exercise – accessing the Geometry Node system
Make sure you at least have Blender 3.2, but in this book and chapter, we will be using Blender 3.3. Let’s begin:
- Firstly, let’s start by opening Blender.
- Then, you can head on to the Geometry Nodes tab in the top section of your screen. Now your journey begins.
Figure 1.16: Blender startup screen
Figure 1.17: Geometry Node editor tab with info overlayed
This might look overwhelming at first sight, but don’t worry, this book will guide you through all the parts of this node editor.
This is a separate window that allows you to see various bits of information about elements of your geometry, such as, for example, the properties of instances.
This is your main view in Blender. It allows you to see the project in 3D space.
This is a list of all the objects in your current scene. This makes it easy to create instances by sliding your object from the outliner right into the Geometry Node editor.
- Geometry Node editor
The Geometry Nodes editor is your main editing workspace for working with Geometry Node trees.
To start working on Geometry Nodes, it’s important to learn how to add a node tree to your projects. There are two ways to do this:
- One way to do this is to add a Geometry Nodes Modifier from the Modifiers tab in the Properties tab:
Figure 1.18: Geometry Nodes Modifier
After you’ve added the Modifier to the Modifier stack, you’ll need to press the New button. You’ve now successfully created a new node group.
- The other way to do this (and the quicker way since we’re already in the Geometry Nodes workspace) is to just click the New button in the Geometry Node editor. This automatically adds a new Geometry Nodes Modifier along with a beginning and end node. The following figure shows the New button you’ll find at the top of the Geometry Nodes workspace to add a new node tree, along with all the functions of the button.
Figure 1.19: Node group selection box
This is the end of the chapter. In this chapter, you’ve learned about the various node connections you will come across in the node editor, along with how to access the node editor.
Congratulations! You now know the basics of the Geometry Node editor.
In this chapter, we’ve covered the various node connections. This includes the Vector, Boolean, Color, Integer, Value, String, Material, and Geometry Inputs, along with the different shapes of node connections. We have explained how to access the Geometry Node editor in various ways, how the node system works, how it flows, and everything there is to know about this new system in Blender. Having read this chapter, you will now understand how this Geometry Node system works and what kinds of node connections are available in the Geometry Node editor.
In the next chapter, we’ll go over the basic nodes you’ll be needing the most in your basic projects. This is important because we will be using these nodes in the coming chapters.