The Interactive & Immersive HQ

Creating Generative Shapes & Patterns with SOPs

Exhausted all of your usual go-to techniques and looking for some creative inspiration for working with SOPs? We’ve put this post together for you! Creatively working with SOPs to generate shapes and patterns opens up a lot of opportunities for unique visual content that isn’t possible when working with textures alone. And it turns out there are a lot of SOPs that can be useful for this purpose, some of which may have flown under your radar. In this post, we’ll look at creating generative shapes and patterns with a variety of SOPs, including the LSystem SOP, the Superquad SOP, the Divide SOP, and more.

Organic Growth with the LSystem SOP

L-systems are a classic method in computer graphics for procedurally generating geometry through the use of iteration. They’re often used for creating realistic looking trees, plants and flowers. The LSystem SOP implements L-systems in TouchDesigner, allowing you the ability to define rules for growth. As the number of generations increases, what starts as simple rules can generate some very complex geometry. The syntax of the rule substitution takes a bit to get used to, but once understood it can provide some amazing results!

If you’re interested in diving in further, check out the LSystem SOP documentation, especially the Sections 6 and later, which goes into a high level of detail about the writing of rules. We also took a look at the LSystem SOP in the recent video The Last of Us-Inspired TouchDesigner + L-Systems Effect.

Complex Shapes through Combination with the Boolean SOP

At some point, you may find that you’re looking for a bit more variety than the basic 3D shape generator SOPs (box, sphere, torus, etc.) have to offer. The Boolean SOP can be a great way to experiment with new forms that result from the combination of polygonal sets. There are six different operations that can be performed on the input geometry, giving a pretty wide variety of results (as can be seen in the image above). For the Boolean SOP to function, the input geometry does need to fulfill two important requirements: the shapes must be completely closed and all polygons must be convex and coplanar.

Read more about the Boolean SOP at the Boolean SOP documentation page.

Isoquadric Surfaces with the Superquad SOP

The Superquad SOP is not an operator that you’ll hear about all that often, but it can produce some interesting shapes all its own. The Superquad SOP generates isoquadric surfaces, which can range quite a bit in shape (see image above). With controls over exponents, you can move between two extremes of inflation towards “squarishness” or contraction towards “starishness” as described below:

  • Value > 1 – Results in shapes that appear more like a “star”.
  • Value < 1 – Results in shapes that appear more “squarish”.
  • Value = 1 – Results in shapes that appear spherical.

Read more at the Superquad SOP documentation page.

It’s also worth checking out the Iso Surface SOP, which is able to produce similar isometric surfaces. However, unlike the Superquad SOP, the Iso Surface SOP requires you to provide an implicit function to define the surface, which means it’s not as fast or easy to start generating and manipulating shapes.

Geometric Divisions (and more) with the Divide SOP

The Divide SOP is another operator that’s easy to miss, but can generate some interesting results you may not expect! It is used to divide incoming polygonal geometry and has features for smoothing input polygons, divide polygons, and more.

Besides smoothing and dividing, it also can bricker polygons, which divides the input geometry into grid-like squares. The bricker settings allow for adjustment of the scale, offset and angle of the grid in all three dimensions. To achieve the result above, we reduced the scale of the grid and adjusted the angle slightly to produce the angled grid pattern. Then, using a Delete SOP, we deleted primitives by number using the Delete by Range setting.

The Divide SOP can also be used to final all polygon centers using the Compute Dual parameter, which can be used to generate voronoi-style effects. Combine that with the smoothing functions, and you can generate the underlying grey surface in the example below on the right. You can check out both of these examples in the OP Snippets for the Divide SOP.

Read more at the Divide SOP documentation page.

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.

Building Pattern with the Copy SOP

The Copy SOP is an indispensable tool for generating patterns with SOP geometry, whether 2D or 3D. It lets you make copies of the geometry of other SOPs and apply transformations to each copy. You can either use built in settings to apply cumulative transformations, or provide another SOP as an input template. Each point in the template will create a copy of the input geometry.

Although in certain cases it’s more efficient to approach some of the effects that can be produced with the Copy SOP via instancing, it does include some interesting features of its own like Stamping. Stamping allows you to pass parameters upstream to operators that come before the Copy SOP.

This means, for example, that you can fetch the copy index and use it to modify the number of divisions in the Circle SOP that’s used as the copy data in the example below. In the Circle SOP itself, nothing appears different, but once the copies are generated, each successive copy has more divisions than the last.

Read more at the Copy SOP documentation page.

More Ideas for Generating Shapes and Patterns

If you’re looking for even more ideas for generating patterns with SOPs (and more), check out these two videos from the Interactive & Immersive HQ YouTube channel!

Wrap-Up

That’s a wrap! Although SOPs are somewhat overshadowed by the recent release of POPs, they still offer a wide range of unique functionality that’s useful for creating generative content. We hope that this post has given you some ideas for experimenting further with SOPs. Happy programming!