Creating a Procedural Fountain Using Points
local graph
Chapter 17 — Creating a Procedural Fountain Using Points
Section titled “Chapter 17 — Creating a Procedural Fountain Using Points”In the previous chapter, we introduced you to the cool tricks we can do utilizing Points in the Simulation Zone. In this chapter, we’ll take a look at how we can add proper physics and gravity to these Points to turn them into a procedural fountain animation.
Before we get any deeper into this chapter, let us first explain how we will achieve the effect of gravity using simple mathematics. In this project, we will have Points being thrown upward, which fall down due to gravity, much like a fountain seen in real life.
When you drop or throw something, gravity is the force that pulls it toward the ground. If an object starts moving, its speed and direction are called its velocity. The starting speed of that motion is called the initial velocity.
For example, if you toss a ball straight up, the initial velocity is the speed you gave it by throwing it. As the ball moves up, gravity slows it down, and when it comes back down, gravity makes it go faster. However, when an object falls for long enough, air resistance (the air pushing against it) will balance out the pull of gravity. At this point, the object stops accelerating and falls at a constant speed called its terminal velocity.
Just like this ball, in the illustration given in Figure 17.1, our Points will follow the same rules individually. Using these rules, we’ll be able to create a procedural fountain effect in the Simulation Zone.

Figure 17.1: Procedural fountain animation
Note
Please note that this project is a continuation of the project seen in Figure 16.18 in Chapter 16.
We will cover the following topics in this chapter:
- Creating a velocity vector
- Adding terminal velocity
- Implementing an initial velocity
- Modifying the X and Y velocity
- Exercise – creating a procedural fountain animation
Let’s get right into the exercise!
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 find the exercise from this chapter in the common .blend file in the GitHub repository.
Creating a velocity vector
Section titled “Creating a velocity vector”Let’s start this exercise off by opening the project file from Figure 16.18 in Chapter 16, where we created a Point Emitter with Points falling down at a constant speed.
This time, we will rework our node tree to have a velocity vector, which allows a more realistic effect of gravity.
Let’s start this chapter off by adding a velocity vector, which we will do by utilizing a Store Named Attribute node, just like we used for our age attribute.
Let’s add in a Store Named Attribute node right before our Join Geometry node. Let’s also set the datatype of this node to Vector, because our velocity will consist of an X, Y, and Z axis. Let’s name our attribute vel, as seen in Figure 17.2.

Figure 17.2: Settings for the Store Named Attribute node
The idea is that we want to lower the Z velocity of each point per frame by a certain value.
Note
Our named attribute called vel stands for velocity; this can be any name, but we recommend using the attribute name vel as it’s the usual name for velocity attributes.
To do this, we’ll apply the same technique we used for age in Chapter 16.
Let’s add in a Named Attribute node with the name vel and set the datatype to Vector. Let’s also connect the Attribute output to the Value input of the Store Named Attribute node we’ve added before.
Right now, it won’t do anything because we’re just setting the value to what it was before. We want to lower the Z value by 0.02. We’ll do this by adding a Vector Math node set to Subtract and setting the Z value to 0.02.
Once we restart our timeline by pressing Ctrl + Left Arrow and start playing our simulation, we’ll see that nothing visually happens. This is because we are not using the velocity values yet.
To start utilizing this attribute, we’ll swap our Transform Geometry node for a Set Position node. This is necessary because the Transform Geometry node cannot transform each point individually.
Once you have swapped this node out, connect the Attribute output of our Named Attribute node to the Offset input of our Set Position node.
To keep our node tree organized, we’re also going to frame all the nodes we’re adding in the correct order.
Let’s select all the nodes we’ve just added, except the Named Attribute node, and press Shift + P to join the nodes in a frame. We’ll call this frame Calculate Velocity.
Tip
You can change the color of frames by going to the right-hand menu of the Geometry Node editor and going to the Node tab, where you’ll see an option to change the color of the frame. To keep our node tree even more organized, we’ll give each frame a different color.
If you have followed these steps correctly, this is what your current frame should look like:

Figure 17.3: Calculate Velocity frame
When we restart our timeline and play our simulation, we can see that we now have Points falling with realistic velocity.
There’s an underlying issue, though; the Points will keep accelerating until they die out from our age attribute. In real life, there’s a phenomenon called terminal velocity, which is the maximum speed a falling object will reach due to air resistance.
Let’s try to recreate this phenomenon using Geometry Nodes!
Adding terminal velocity
Section titled “Adding terminal velocity”To add terminal velocity, we’ll have to compare our current velocity and stop changing the Z velocity of any point that is going too fast:
- To do this, let’s go back to the Calculate Velocity frame and add in a Compare node set to Greater Than.
- We will need to extract the Z value from our
velattribute. To do that, let’s add in a Separate XYZ node and connect the Z output to the A input of the Compare node. - In the B input, let’s enter
-1, because we don’t want our Points going under this-1threshold. Keep in mind that you are allowed to change this value. In this demo, we kept the value at-1because it looks closest to how terminal velocity works in real life. - Let’s connect the Attribute output of our Named Attribute node to the Vector input of our Separate XYZ node, and let’s also connect the Result output of our Compare node to the Selection input of our Store Named Attribute node, which is responsible for the velocity.
This Compare node only allows values that are greater than -1; otherwise, it will not pass the Store Named Attribute node, where the value will not be saved for that specific point, which means the velocity will not change anymore.
- Once again, let’s select the nodes we have added in this section and create a frame around them by executing Shift + P.
- Let’s give this frame the name
Terminal Velocityand give it another color.
If you have followed these steps correctly, this is what your current frame should look like:

Figure 17.4: Terminal Velocity frame
We have now created a system where our node tree checks each point’s speed. If a point has a Z velocity greater than -1 (which means it’s falling slower than -1 each frame), it will process the Store Named Attribute node.
If the point is falling faster than -1 each frame, the node will no longer be processed, and the vel value will not change for that specific point.
Implementing an initial velocity
Section titled “Implementing an initial velocity”Let’s go back to the example of throwing a ball, which we explained at the beginning of this chapter.
If we throw a ball, we’re giving our ball an initial velocity by throwing it.
We can simulate this phenomenon in our node tree as well, which is surprisingly easy.
All that we have to do is add a Store Named Attribute node right after where we define that our age value is 0, as our Points are created.
Once again, let’s enter vel as our name and set the datatype to Vector, as you can see in Figure 17.5:

Figure 17.5: Initial velocity creation
In this Store Named Attribute node, we can define the starting velocity of each point. For example, if we enter a value of 0.2 on the X axis and 0.3 on the Z axis, we can see that our Points get shot up and forward, as you can see in Figure 17.6.

Figure 17.6: Points get shot up and forward
Let’s also drag the Value input of the Store Named Attribute node to our Group Input node’s unused socket. This will create a Group Input node in our modifier stack so that we can access the value easily. Let’s rename this Group Input node to Initial Velocity.
Once again, let’s select all the nodes we’ve added and create a frame called Initial Velocity. Let’s also give it a different color again.
We can see that all Points follow the same path. This is because there’s no randomization in Initial Velocity. To add this, let’s take a look at the next section!
Adding randomness to Initial Velocity
Section titled “Adding randomness to Initial Velocity”To make Initial Velocity more random, let’s add a parameter that allows us to randomize it. To do this, we want to multiply the Vector line from our Group Input node to our Store Named Attribute node by a value from 0 to 1.
Here’s how to set it up:
- Add a Vector Math node set to Multiply between the Group Input node and the Store Named Attribute node.
- Let’s also add a Random Value node set to Float and connect it to the second Vector input of the Vector Math node.
- Just like we’ve done before, connect the Frame output from our already added Scene Time node to the Seed input of our Random Value node. This will increase the randomization per frame.
- When we restart our timeline and play our simulation, we can see that Initial Velocity is indeed randomized. However, we want to be able to control how much it’s being randomized.
- To do that, slide the Min input of our Random Value node to the unused socket of our Group Input node.
This will decide how much randomization is in Initial Velocity: 0 means a lot of randomization, and 1 means no randomization.
- This isn’t very logical. To make more sense, we will flip these values around using a Map Range node, which will remap our values from
0-1to1-0. - Now, our values should correspond correctly. Let’s also rename the Group Input node we’ve just added to
Randomization. In this demo, we’ll continue with a value of0.5. - Once again, to keep our node tree organized, select all the nodes we’ve just added and join them into a frame by executing Shift + P. Let’s name the frame
Randomize Initial Velocityand give it a different color.
If you have followed the previous steps correctly, this is what your current frame should look like:

Figure 17.7: Initial Velocity frames
When we take a look at the top view and play our simulation, we can see an issue emerge. We’re not slowing down our Points velocity on the X and Y axes. In reality, this should happen. Let’s fix that by modifying the velocity on our X and Y axes!
Modifying the X and Y velocity
Section titled “Modifying the X and Y velocity”Let’s slow down our Points on the X and Y axes per frame:
- To do this, let’s first move back to our Calculate Velocity frame.
- Duplicate the Store Named Attribute node and place it right after that node. Make sure it’s not part of the frame anymore by right-clicking the node and selecting Remove from Frame or by executing Alt + P.
- Next, move all the nodes on the right side to the right because we will need some more space to add nodes.
We’ll need to take our current vel vector and gain access to the X and Y values of that attribute.
- To do that, let’s add in a Separate XYZ node and connect the Named Attribute output to the input of this Separate XYZ node. We’ll also add in a Combine XYZ node and connect it to its respective inputs of the Separate XYZ node.
- Finally, connect the output of this Combine XYZ node to the Value input of the Store Named Attribute node we’ve duplicated.
If you have followed the current steps correctly, this is how your node tree should look:

Figure 17.8: Your current node tree

Inside these two nodes, we will need to perform some calculations.
We want to lower the values of the X and Y axes gradually. To do this, let’s use the following calculations:
- X = X - ( X / 40 )
- Y = Y - ( Y / 40 )
When we convert this formula to nodes, this is how our node tree should look:

Figure 17.9: Formula converted to nodes
Go ahead and build this node tree between the Separate XYZ node and the Combine XYZ node.
Let’s also make sure we can change this division factor. This value defines how fast the Points will lose their X and Y speed.
We’ll drag one of these values to the Group Input node’s unused socket and drag the other value into the node socket we’ve just created. Let’s name the Group Input node Velocity X and Y.
This is a very long line. To tidy it up, we’ll add some Reroutes so that we can reroute it around our Calculate Velocity frame.
Once we are done with all the previous steps, let’s go ahead and select all the nodes we’ve just added and execute Shift + P to join them in a frame.
We’ll name this frame X and Y Velocity and give it a new color, as seen in Figure 17.10:

Figure 17.10: X and Y Velocity frame
If we now restart our timeline and play our simulation, we can see that our Points gradually slow down on the X and Y axes.
Note
You might need to increase the lifetime of your Points to visualize the effect better.
That’s all the calculations we need to do for the velocity! In the next section, we’ll be finishing off this chapter by creating a procedural fountain animation.
Exercise – creating a procedural fountain animation
Section titled “Exercise – creating a procedural fountain animation”We will create an animation where Initial Velocity rotates around in a random pattern. To do this, we will drive the Initial Velocity node we created earlier with a Noise Texture node:
- To get started, let’s head back to our Randomize Initial Velocity frame and add a new Vector Math node set to Add right before our Vector Math Multiply node, as seen in Figure 17.11:

Figure 17.11: Location of the Vector Math node set to Add
- We want to control the second input of this Vector Math Add node using a Noise Texture node, so we’ll add a Noise Texture node and connect the Color output to the Vector Math node’s second input.
- We will notice that the movement is rather chaotic. That is because we still have to map this Noise Texture node correctly. Add in a Vector Math node set to Subtract and add it between the Noise Texture node and the other Vector Math node. Let’s give it a value of
0.5on all axes. - It’s less chaotic now. To finalize this node, we will need it to actually change. To do this, set this Noise Texture node’s mode to 4D and connect the W input to our Scene Time node’s Frame output. Let’s also set the Scale value of our Noise Texture node to
0.2to ease the chaos. - We can see that not much changes because our previous Initial Velocity values are still at play. Go ahead and set the X and Y values of Initial Velocity to
0in our modifier stack. - We can now see some randomized movement, but it’s way too fast. To slow it down, add a Math node set to Divide between the Group Input node and the Noise Texture node. This can be any value you want; the higher the value, the slower the noise pattern will change. During this demo, we went with a value of
7. - The effect is still a bit weak, though. To intensify this effect, we can add another Vector Math node set to Multiply right after our Vector Math Subtract node. Once again, this can be any value you like, but we went with
3on all axes during this demo. - To tidy up our node tree, select all the nodes we’ve added and execute Shift + P to add them into a frame.
- Let’s name this frame
Random Motionand give it a different color.
If you have followed the previous steps correctly, this is what the Random Motion frame should look like:

Figure 17.12: Random Motion frame
We can now see that our procedural fountain is complete! Feel free to tweak any values to your liking to explore different possibilities.
As you can see in Figure 17.13, this is how your completed node tree should look:

Figure 17.13: Your finished node tree
Summary
Section titled “Summary”In this chapter, the concept of creating a procedural fountain animation using Geometry Nodes was explored. The chapter began by implementing gravity through velocity vectors, using attributes to simulate realistic point motion.
Terminal velocity was added to cap acceleration, and initial velocity was introduced to give the Points a starting motion. Randomization techniques were applied to vary the initial velocity for a more dynamic effect, while calculations were made to gradually slow down the X and Y velocity.
Finally, we introduced randomized movement driven by a Noise Texture node to achieve the finalized procedural fountain look.
Building on this simulation, in the next chapter, we will learn how to bake this simulation with the help of the Bake node in the Geometry Node editor!