Feedback loops, especially when used with textures, are a popular topic among TouchDesigner users and can be used to generate some incredibly complex behavior. Up to this point, Feedback operators were only available in the TOP and CHOP families. Eagle-eyed readers/viewers out there may have noticed the inclusion of a Feedback POP in the list of TouchDesigner POPs found in the OP Create Dialog and wondered what it might be used for. Well, wonder no more! In this post, we’ll take a closer look at setting up feedback with the Feedback POP in TouchDesigner. We’ll cover possible uses, how to set up feedback loops and a couple of example networks showcasing it in practice.
What is the Feedback POP and How Can It Be Used?
So to start, what is the Feedback POP and what can it be used for? The Feedback POP allows the creation of feedback loops within the POP family of operators, which share some similarities in functionality to the feedback operators/networks found in other families, but also include a variety of new features specific to the POP family.
The Feedback POP can be used for the creation of integrated movement over time, which is especially useful for generating/creating particle movement. As we’ll see in the second example, it’s possible to modify more than just point positions within the feedback loop. Unlike previous methods for working with particles, the ability to create and modify a large number of predefined and custom attributes opens the door for complex particle effects.
Setting up Feedback with the Feedback POP
We’ll start off by looking at how a feedback network is implemented with POPs. For anyone who’s accustomed to working with the Feedback TOP, things will look somewhat similar (though of course the results are very different!).
- The first thing needed is an operator that will serve as the “initial state” of the network. This is what will be fed into the network first, and sets the stage for the type of effect that you’ll end up generating. I’ve chosen a Point Generator POP, which is used to randomly distribute points throughout a spherical volume.
- Once the “initial state” has been set up, add a Feedback POP. This marks the beginning of the feedback loop. You’ll notice that like the Feedback TOP, the Feedback POP also needs to have a Target OP specified in order to function (see Parameter Window in image below).
- Next, additional POPs are added to modify the data within the feedback loop. I’ve chosen a Noise POP to add noise to the position attribute of each point, similar to the functionality of the Noise SOP.
- For the final step, add a Null POP that will serve as the Target POP for the Feedback POP. In other words, this will be the end point of the feedback loop. Once added, simply drag the Null POP onto the Feedback POP’s Target POP parameter, and you’ll be generating feedback! Take a look at the GIF below to see this in action.
Comparing Two Networks: With and Without Feedback
So the previous descriptions showcase how a basic feedback network is set up, but what is really happening under the hood? How is the result different than working without feedback? In this example, we’ll take a look at feedback in practice by comparing the results of two almost identical networks, one with feedback included, and one without.
Network Overview
At the start of the network, we’ve added a Point Generator POP to generate a randomly distributed spherical volume of points. In SOP terms, this is similar to starting with a Sphere SOP and using a Sprinkle SOP to distribute points throughout the volume. Then, after adding a Null POP, we branch into two networks, one with a Feedback POP and a Noise POP, and the other with just the Noise POP. In both cases, the Noise POP is used to add a randomly generated XYZ position value to the points at the input.
Results of Applying Feedback
Now let’s see what happens when we start applying feedback! Compare the results of the top null_feedback POP and the bottom null_noFeedback POP. Once feedback is applied, they’re dramatically different.
So what’s happening here? Let’s start with the null_noFeedback POP. In this case, the original points have each had a random XYZ value added. The random value shifts slightly over time due to the use of an absTime.seconds expression to translate the noise.
In the case of the null_feedback POP, a random XYZ value is being added to each input point as well. The difference is that rather than the input points always staying the same (as they do in the second example), the output of the Noise POP is fed back into itself via the Feedback POP. The points with added random XYZ values are fed back into the Noise POP, only to have a new set of random XYZ values added to their position. And so the translations to each point will continue to accumulate over time, creating a very different trajectory than the example without feedback.
Although in this example we’re only using feedback to manipulate point positions, it’s possible to manipulate other attributes in the feedback loop as well!
Get Our 7 Core TouchDesigner Templates, FREE
We’re making our 7 core project file templates available – for free.
These templates shed light into the most useful and sometimes obtuse features of TouchDesigner.
They’re designed to be immediately applicable for the complete TouchDesigner beginner, while also providing inspiration for the advanced user.
Modifying Other Attributes with Feedback
In this next example, we’ll take a look at how the feedback loop can be utilized to modify more than the point position. In this case, we’ve added two additional attributes to the points prior to adding feedback, which are Random and Age. In both cases, a Random POP is used to generate the data, which generates random data in a somewhat similar way to Noise CHOP/TOP.
Random is a vec3 that is used to add randomness to the movement of the points, and is not modified in the feedback loop. Age, on the other hand, is a float used to track the lifetime of a point/particle from the time it is generated (i.e. when feedback is reset/restarts). By using a Random POP, each particle has a different initial Age value assigned to it.
In the feedback loop, a Math Mix POP is used to add movement to the particles using the Random attribute, and to decrement the Age attribute over time. The Age attribute is then used in two more places. The Delete POP will delete points once their Age attribute equals zero, and the Lookup Texture POP uses the Age attribute to assign a Color attribute to each point. As each point ages, the color will fade from white to dark blue and finally to black.
Outside of the POP network, the Age attribute is used once again in the Point Sprite MAT to attenuate the size of the particles over time. This allows for the particles to shrink as they age until they finally disappear when they reach zero. Here’s a look at the final result!
Wrap-Up
As usual with all feedback-related topics, we’ve barely scratched the surface of what’s possible with the Feedback POP. That said, we hope this post has gotten you excited for all of the new possibilities that the Feedback POP will enable for working with particles in TouchDesigner. Stay tuned for more on TouchDesigner POPs!