Creating a Procedural Plant Generator
local graph
Chapter 10 — Creating a Procedural Plant Generator
Section titled “Chapter 10 — Creating a Procedural Plant Generator”Congratulations! You’ve now mastered the basics of Geometry Nodes in Blender! Now, it’s time to get started on the more advanced projects. One of these advanced projects includes making a procedural plant generator. Let’s get into it!
We will start this chapter off by adding a Curve Line node, to which we will add some noise using a Set Position node. After that, we will create a stem using a Curve to Mesh node and a Spline Parameter node to define the thickness. We will also be creating the leaves on our plant using instancing. We will rotate these leaves in a way that looks realistic. To finish off this node tree, we will be making a pot using the Mesh Boolean node and joining it with our leaves and stem. This is what our end result will look like:

Figure 10.1: The final result
To end the chapter, we will also teach you how to add Group Inputs to your node tree. This will be done to give end users easy access to the key variables of your node tree, such as height, leaf count, and resolution inputs.
We will cover the following topics in this chapter:
- Creating the node tree
- Utilizing group inputs
Technical requirements
Section titled “Technical requirements”Some figures in this chapter show the full Blender setup, including node trees, outcomes, and parameter settings. For easier viewing and readability, these figures are also available in the book’s GitHub repository.
You can also find the exercise from this chapter in the common .blend file in the GitHub repository.
Creating the node tree
Section titled “Creating the node tree”Open a new Geometry Node editor on the default cube. Once you’ve done that, you’re ready to start the exercise. The first step is to create the stem of the plant. Let’s begin.
Creating the stem
Section titled “Creating the stem”In this section, we will add a Curve Line node, to which we will add some noise displacement using a Set Position node. After that, we will give this curve some thickness using the Scale input on the Curve to Mesh node:
- Start by adding a Curve Line node to our Geometry Node editor. This will be the base of our stem.
- To visualize this node, connect it to the Group Output node.
- After that, add a Set Position node after the Curve Line node to start giving displacement to the curve.
- We will also need a Combine XYZ node to split the Offset vector value into its respective X, Y, and Z components. Drop this Combine XYZ node into the Offset input of the Set Position node.
If you’ve followed these steps correctly, this is how your node tree should look:

Figure 10.2: Your current node tree
Now, it’s time to add Noise Texture nodes to start randomizing our curve:
- Add two Noise Texture nodes with the given parameters shown in Figure 10.3.

Figure 10.3: Noise Texture parameters
Make sure that the Noise Texture nodes have different W values from each other. This is to ensure that we have enough randomization in our displacement.
- Now plug in these Noise Texture nodes in their respective X and Y inputs in the Combine XYZ node. Use the Fac output as your input for this node.
- We can see that not much happens when you do this. The reason for this, as covered in Chapter 8, is that we need to resample our curve first. So, add a Resample Curve node between the Curve Line node and the Set Position node. Give this a Count value of
20. - You might have noticed that our curve is offset from our origin point. To fix this, add a Vector Math node, set it to Subtract, and subtract
0.5from the X and Y axes. You can drop this node after the Combine XYZ node. This will set the median of our Noise Texture nodes to0, as explained in the previous chapters.
This is how your node tree should look after executing these steps correctly:

Figure 10.4: Your current node tree
Now, it’s time to give our stem some thickness:
- To do this, add a Curve to Mesh node at the end of our node tree. Check Fill Caps because we want the ends of our stem to be filled.
- Also, add a Curve Circle node as our Profile Curve input. Give this circle a Radius value of
0.05; we can always tweak this afterward if our stem appears too thick. - Now, we will give the curve a custom radius profile; to do this, let’s use the Scale input of our Curve to Mesh node. This will give us fine control over the thickness of our stem.
- As described in Chapter 8, we can use a Spline Parameter node along with a Float Curve node to create a custom thickness profile. Let’s execute this:
- Add in a Spline Parameter node and a Float Curve node, and then connect the Factor output of the Spline Parameter node to the Value input of the Float Curve node.
2. Then, connect the Value output of the Float Curve node to the Scale input of the Curve to Mesh node.
3. Give the Float Curve node the profile detailed in Figure 10.5.
Figure 10.5: The Float Curve editor
- Add in a Spline Parameter node and a Float Curve node, and then connect the Factor output of the Spline Parameter node to the Value input of the Float Curve node.
2. Then, connect the Value output of the Float Curve node to the Scale input of the Curve to Mesh node.
3. Give the Float Curve node the profile detailed in Figure 10.5.
Of course, you can always tweak these nodes to your liking. If you executed all these steps correctly, this is how your node tree should look:

Figure 10.6: Your current node tree
This is how your current model should look:

Figure 10.7: The stem
Congratulations! You’ve now completed the stem. Let’s move on to the leaves of our plant!
Creating the leaves
Section titled “Creating the leaves”Now, we will be creating the leaves of our plant. We will do this by instancing some self-modeled leaves on our stem and rotating them using a Random Value node.
Before we start instancing leaves on our curve, let’s resample it again; this will determine how many leaves we will put on our plant.
Add in a Resample Curve node with a Count value of 10. This count means we will instance 10 leaves on our stem. You can connect this node after the Set Position node, as highlighted in Figure 10.8. In other words, we’re branching off from the previous part of the node tree.

Figure 10.8: The Set Position and Resample Curve nodes
This will give our curve more resolution to work with, which is what we need if we want to add noise to our stem. Next, follow these steps:
- Let’s go back to the Viewport editor to model a leaf. This can be really basic.

Figure 10.9: A basic leaf model
Important note
Make sure that your origin point is at the stem of your leaf. This will be important in the next step. You can also give some downward curvature to your leaf for extra realism!
- The next step is to start instancing this leaf in our Geometry Node editor. Let’s go back to the editor and select our stem to go back to the node tree.
To drop the leaf in our Geometry Nodes workspace, a simple trick we can execute is to drag our leaf from the Outliner to the editor, as shown in Figure 10.10:

Figure 10.10: Drag your leaf to the editor
You will see that this will create an Object Info node in the Geometry Node editor.
- To start instancing this leaf on our curve, let’s add an Instance on Points node.
- Let’s connect the Resample Curve node to the Points input of the Instance on Points node. As you might have guessed, we can also use the Instance on Points node on any mesh; in that scenario, Blender will read all the vertices the mesh contains as points.
- To add our leaf as the instance object, let’s also connect the Object Info node’s Geometry output to the Instance input of the Instance on Points node.

Figure 10.11: A node tree snippet
- We can see that nothing has happened yet because the Instance on Points node is not being outputted to the Group Output node. To fix this, add a Join Geometry node at the end of the node tree to join the stem and the leaves together.
- At first, you can see that our leaves are way too big. To fix this, use the Scale input to scale your leaves to the correct size. The value you use for this really depends on how you modeled your leaves.
Tip
You can hide the original leaf from the Viewport editor without hiding the instances by pressing the eye icon of the leaf in the Outliner.
- There is a problem, though – all our leaves are on the same side of our plant, and this is not realistic. To fix this, add a Random Value node set to Vector. Enter the parameters shown in Figure 10.12:

Figure 10.12: The Random Value node
To explain these values easily, we’re basically rotating a bit on the X and Y axes, but we’re making a full rotation on the Z axis.
- We can drop the output of this node straight into the Rotation input of the Instance on Points node.
When you now take a look at your Viewport, you can see that the leaves have spun around! We’re getting closer!

Figure 10.13: Your current node tree
Figure 10.13 is what your node tree should look like by now. As the final step, let’s create the pot.
Creating the pot
Section titled “Creating the pot”This is the last step in creating our plant. In this section, we will take two cylinders and use a Mesh Boolean node to cut away the insides of this pot. Let’s get into it:
- Add a Cylinder node to the existing Join Geometry node at the end of the node tree.
- Give it a Radius value big enough so that it covers all the leaves perfectly. In this demo, we went with a value of
0.5. Let’s also give it a Depth value of about0.8. - After that, use the Transform node to move the cylinder down to the bottom, and pick a Z Location value that you think is suitable.
- Let’s now add a Mesh Boolean node to cut away the middle of our pot. We can drop this node after the Transform node.
We can see that nothing happens; this is because we have not entered a Mesh 2 input yet.
- To fix this, let’s add in another Transform node that is slightly smaller and higher than our original cylinder, which will cut out the top of our Mesh 1 input. We went with a Z location of
0.1and a Scale value of0.8on all axes, but be sure to experiment with different values.
Figure 10.14: The pot node tree
If you now take a look at the Viewport, you can see that the plant is finished!

Figure 10.15: Your final model
You can see the finished node tree in Figure 10.16:

Figure 10.16: The final node tree
Keep in mind that you can still try out different parameters for leaf count, resolutions, noise patterns, and so on.
This brings us to the end of this node tree-building exercise! In this section, you’ve learned how to create a stem for a plant using Blender’s Geometry Nodes. Specifically, you’ve learned how to do the following:
- Create a Curve Line node and add noise displacement to it using a Set Position node and some noise textures
- Give the stem some thickness by using Scale input of the Curve to Mesh node and a Spline Parameter node
- Add leaves to the stem using instancing and rotation
- Create a pot using the Mesh Boolean node and join it with the leaves and stem to complete the node tree
We can still expand the functionality of our node tree beyond what it can do now. With the help of Group Inputs, we can add ease-of-use to frequently used variables. Let’s get right into it!
Utilizing group inputs
Section titled “Utilizing group inputs”In this section, we will add group inputs to our node tree. These can be handy when you want to distribute the node tree to other users so that they can easily access your variables. We’ll be adding group inputs to the most important variables in the node tree.
What inputs will we include?
Section titled “What inputs will we include?”The inputs that we will include are as follows:
- The End Z value of the Curve Line node, which we’ll call
Plant Height. - The Count value of the second Resample Curve node, which we’ll call
Leaf Count. - The Max value of the Random Value node, which we’ll call
Leaf Rotation. - The Count value of the first Resample Curve node, which we’ll call
Stem Resolution.
Let’s start implementing these group inputs!
Plant Height
Section titled “Plant Height”First, let’s implement the Plant Height group input:
- To implement the
Plant Heightgroup input, first utilize a Combine XYZ node to split the X, Y, and Z values of the Curve Line node’s End input. - After that, add a Group Input node and drag the gray node connection to the Z value of the Combine XYZ node.
Once you have done this, you can see that a new value called Z appears.

Figure 10.17: The Plant Height group input
In Figure 10.16, you can see the node tree for implementing the Plant Height group input.
Leaf Count
Section titled “Leaf Count”Let’s now implement the Leaf Count group input.
Luckily, this is really easy. All we need to do is drag the gray node connection to the Count input of the second Resample Curve node. When you do this, you’ll see that a Count value has been made on the Group Input node.

Figure 10.18: The Leaf Count group input
Do this for the rest of the group inputs (Leaf Rotation and Stem Resolution) until you have the following result:

Figure 10.19: The group inputs
Now, let’s start renaming all of these group inputs.
Renaming the group inputs
Section titled “Renaming the group inputs”Right now, it’s not that easy to remember all the different names that Blender assigned to these group inputs. Fortunately, we can choose to rename these:
- To rename the group inputs, open the right-hand menu of the Geometry Node editor (N), which can be seen in Figure 10.20, and head to the Group tab.

Figure 10.20: The right-hand menu button
- Once you are in the Group menu, look for the Group Sockets section, which is shown in Figure 10.21:

Figure 10.21: The group inputs list
- When you click on one of the entries, you will be presented with the option to change the datatype, give a name to the group input, add a tooltip to the input, add a default value, and give a value range.
Let’s rename each of the entries as follows:
- Z to
Plant Height - Count to
Leaf Count - Max to
Leaf Rotation - Count to
Stem Resolution
- Once you’ve done this, you can head to the Modifier stack to take a look at your finished Group Input control panel.

Figure 10.22: The Geometry Nodes modifier
There you have it! That’s how you make a procedural plant generator, complete with group inputs.

Figure 10.23: The final render
In Figure 10.23, you can see the final render of what we made in this chapter. As an extra challenge, you can attempt to put textures and materials on the created object as shown in Figure 10.23! This can be achieved with a Set Material node, with the output being the geometry with the material you’ve selected.
This brings us to the end of this chapter!
Summary
Section titled “Summary”In this chapter, you learned how to utilize Geometry Nodes to create a procedural plant generator, which, in turn, can be used to create a simple plant using only a few parameters. This can be useful when you need lots of plants in your scene but don’t want them all to look the same.
In the next chapter, we’ll be creating a procedural brick wall generator using Geometry Nodes.