Experimental:POP
Experimental - Skipping Glossary
Summary[edit]
POPs (Point Operators) is a new Operator Family of TouchDesigner that runs on the accelerated GPU graphics card or chips, and creates/modifies 3D data which in turn gets rendered by the Render TOP or gets passed to other devices like LED arrays, lasers or other external systems.
See also Category:POPs for a full list of articles related to POPs.
Every POP contains a set of points with a set of Attributes. The most common attribute is Position (P), the position in 3D space of the points. The POP may have other attributes like Color (Color) (always with a red, green, blue and alpha component) and Normal (N) which is a direction vector (with 3 components). The points can also have extra user-defined attributes, or will get attributes automatically-generated from certain POP operators.
Points are the building blocks of polygons, lines, line strips, spline curves, point clouds, particle systems, any 3D geometrical shape and any form of data points.
A POP is made of a points list, a vertex list, and a primitive list.
The types of "primitives" include
- Point (1 point))
- Line (2-point)
- Line Strip (1 or more points)
- Triangle (3 points)
- Quad (4 points)
Each primitive has a list of vertices. Vertices are indexes into the points list. So a quad primitive is 4 vertices which is a set of 4 indices of points in the point list. Vertices and Primitives can also have attributes, like Color can be a primitive attribute whih applies color to the entire primitive.
Like the other TouchDesigner families of operators, POPs include "generator" operators that create new shapes or import them from files or other systems, plus "filter" operators that modify the data coming from other POPs and may generate complex shapes and data from simpler inputs.
POPs are a replacement and re-think of TouchDesigner's historically first operator family, SOPs, with many new features and advantages. Like SOPs, POPs are a procedural family of operators that create and affect points, and primitives like triangles, quads and lines. POPs implements point clouds and particles, and it imports FBX, obj , Alembic files and more.
POPs are placed in Geometry COMPs to get rendered with the Render TOP. Materials (MATs) are applied to the Geometry COMPs (as with SOPs), the Geometry COMPs are provided to the Render TOP, which renders the raster images. POPs can also go directly to CHOPs then to lasers, DMX or other external systems.
3D operators running on the GPU gives us:
- Speed due to high parallelism. - Less memory: It is highly memory-optimized as only the attributes that change gets created. - (re-use of memory?)
POPs implement a lot of features of CHOPs so that it's not necessary to convert to CHOPs to do a lot of math/logic/mixing operations on 3D data and attributes.
POPs fits in with USD and FBX data structures including bones and weights - optionally creating POPs in the USD or FBX components.
POPs vs SOPs[edit]
If you know SOPs already:
- POPs run on the GPU as highly-parallelized compute shaders. SOPs run on the CPU.
- POPs give better, more modern workflow than SOPs: It takes the best of SOPs, CHOPs and TOPs.
- All point cloud-relevant TOPs are implemented in POPs and more, without the limitation of mapping to 4-channel image formats.
- You can retrieve point clouds from TOPs (TOP to POP), Point File In POP, and there are native point generators in POPs.
- `particlesGPU` is (being) re-implemented in POPs. Particle systems are enabled with Feedback POP and general data manipulation.
- POPs has much more powerful creation and manipulation of attributes.
- POPs does not follow SOPs directly. For example, the Normal POP creates surface normals and tangents whereas SOPs do it in a Facet SOP.
- You can render SOPs and POPs in the same Render TOP.
- right-click on a POP and select a Geometry COMP to create a POP-in-a-Geo..
- Geometry Instancing is done in the same way as SOPs/CHOPs/DATs, where POP attributes can be used on the Instancing pages.
- POPs implement features of spline curves (but as spline-divided line strips): Bezier, BSpline, and Cardinal splines.
- What POPs doesn't do presently: Meshes (grids where rows/columns are defined), tracing, full extrudes on any linestrip, booleans, or triangulation of closed linestrips. to come.
- Alembic data is now editable as POPs. (no Alembic POP yet)
- SOPs has some functionality that is more doable on the CPU, but more and more of that will be ported to POPs.
Some POP Features and Concepts[edit]
Compute Shaders is the programming language within POPs, and in the C++ compute shader sample POPs, there are numerous helper functions and pre-built examples.
Math with no Coding - Several POPs like Transform, Math, Math Mix and Normalize give fundamental manipulation capabilities without need for coding. POPs eliminate a lot of the need for coding.
Creating New Attributes - Some POPs allow for easy creation of new attributes simply by specifying an existing/new attribute in the Output Scope parameter. TouchDesigner will auto-choose a size and type of attribute. (in Math POP, Math Mix POP, Limit POP and numerous others)
Setting Attribute type and Size - Where you see >>> it lets you specify attribute type and size.
Attributes Feeding Rendering - POPs is better-tied to rendering as attributes are more extensive and controllable. Like glowing lines are a combination of geo and shading. In some cases hidden POPs generate the polys to render glow or lines.
GLSL POPs - A growing set of POPs let you code in GLSL-style compute shaders.
Multi-POP Inputs with Sequential Blocks - The POPs that allow unlimited inputs, like Merge, Switch, Math Mix, Blend, Attribute Combine etc. share a new flexible way of specifying inputs. You can (1) wire them in one-by one as before, or you can (2) specify multi-inputs like "box*" using pattern matching in a parameter. And you can (3) add a sequential block per input, where each block has a POP path parameter. The latter is most flexible as each sequential block can have extra parameters, like for the Attribute Combine POP, which attributes you want to extract from each input, or for the Merge POP, which groups you want to merge in for each input. For each wired-input, it auto-creates a sequential block. (You can use pattern matching in each sequential block). You can mix wired and unwired inputs if needed.
Multi-Component Attributes - An attribute can be one number per point, but also can have 2, 3 or 4 components, such as vec4 Color: multiple "components" Color(0), Color(1), Color(2) and Color(3). On top of that, "arrays" are for example multiple vec3 in one attribute, which you can create in an Attribute POP.
Multi-columns of Parameters (Parameter Size parameter): Most POPs give one set of parameters that apply to all components of a vector. You will see “Parameter Size” on some POPs that give you 1, 2, 3, or 4 sets of parameters, which then give you one parameter set for each component. For example, this enables you on a Math POP to apply a different re-range for each of the X Y ad Z components of a position, which previously required several OPs.
Memory Reduction via References - Each POP only allocates memory for attributes that it is modifying or creating anew. If it is not modifying Position, for example, it will use the Position from an POP that is flowing into the POP. This saves a lot of memory. Tip: At the bottom left corner of the POPs viewers it shows which attributes it is creating/modifying in that POP, The rest of the attributes are being passed through from POPs upstream (references). Also, the middle-click info popup on a node shows the attribute names, and if they are followed by a (r) it is a reference to memory in another node.
Single-Component menu - where a single component of an attribute needs to be specified, (like for an index) there is single-component menu that is used everywhere, which lets you choose one from all the POP's attributes' components.
Line Strips are primitives (like triangles, quads etc) made of multi-points, and can be created via most generator POPs, the Line POP or the Create POP.
They can also be created from any point list that has a linebreak attribute, which in the Line Strip POP takes the point list in its order, and splits it into line stripp primitives based on 0 or 1 in the linebreak attribute.
Line MAT is implemented with an POP underneath and does a conversion into a Line Thick POP. More aspects of lines are controllable per-point using attributes. More Line MAT features are controlled using POP attributes via the Line MAT’s Attributes page.
Weights - Several POPs generate 0-1 value weights per-point, and others use those weights to blend between two states, like the Transform POP which can partially transform each point.
High Precision - User-defined attributes can be single or double precision floats, also 32-bit or 64-bit integers.
Sorting with the Sort POP is implemented with modern fast sorting algorithms. Sort can be based on any attribute component.
Over-Allocation Caveat of GPUs - If a POP's number of points, primitives or vertices cannot be determined at the start of cooking, it needs to allocate a max number of thee entities and not use some memory. So they have to sometimes over-allocate. Some POPs have parameters that let you set the max amount of things you expect in the POP.
Conversions - To transfer from Point Attributes to/from Vertex Attributes to/from Primitive Attributes, use the Attribute Convert POP. Use the Convert POP to convert between primitive types.
GPU - You can keep your computing on the GPU and not break the parallelism caused by sending/receiving form the CPU. Since TOPs are GPU-based too, interactions between them are also optimized. POPs are all GPU except when CPU absolutely needed (like loading files).
Primitives[edit]
Primitive Types[edit]
Primitive types in POPs are:
- Point primitive - has one index into the point list
- Line primitive - a set of two points in the point list
- Line Strip primitive - a set of any number of points in the point list
- Triangle primitive - a set of three points
- Quad - primitive - a set of four points
Tip: POP to DAT using its Extract menu shows it all.
Line Strips Open or Closed[edit]
Line strips can be open or closed. Closed line strips have their last vertex pointing to the same point as the first vertex.
Points without Primitives (and why points alone don’t render)[edit]
You can have a set of points without a primitive.
Instancing only looks at the point list. Copy SOP templates don’t care. Many POPs don't care - they go through the points in the point list and mod something and that's it.
But you can’t render (Render TOP) points themselves unless they have a point primitive at least. (is this true with Line MAT?)
The generators (Circle, Torus, Tube, Point Generator and soon Sphere) (when Connectivity is set to None, where applicable) all create points, each with a corresponding point primitive.
The Create POP, like the Add SOP, can strip off primitives and leave you with no primitives unless you create them in the Primitives tab.
Order of primitives in POPs[edit]
Primitives are re-grouped with this specific order: Triangles, Quads, Line Strips, Lines and Points.
Attributes[edit]
Standard Attributes[edit]
Fixed-purpose built-in attributes - Every point has a position, that is called the P attribute (now you can have a POP without a P attribute). P has 3 components including P(0), P(1) and P(2) for the X, Y and Z dimensions. P is a “vec3”.
Each point can have other optional attributes that are added using various POPs. N is for normals and is a 3-float vector (vec3). Color is the point color and always has 4 components , for red, green, blue and alpha. Often you will see Color(0) Color(1) Color(2) for changing the RGB only. Tex is the texture coordinates for point and is always a 3-float vector which includes the 3rd dimension of a 3D texture.
You can create and modify color and texture attributes in many places in POPs, like in Normalize, Math, Math Mix, Pattern, Noise, Random, Projection, Lookup*, Line and more.
Common Attributes[edit]
There are other attribute names that are commonly used in TouchDesigner that you should use as a habit unless there is a reason not to do so. These include Tan(tangent), Pointscale, LineWidth, Dir, Dist, Vel, Disp, Speed, Accel, Weight, Curv (curvature), Index (general index) Nebr (neighbor indexes).
Point, Vertex or Primitive Attributes[edit]
Points have attributes, but also primitives and vertices can have attributes. Most often point attributes are desirable. For example, the Sphere POP optionally produces vertex attributes as textures to typically handle textures that wrap around.
Where to create Attributes[edit]
Yu can create attributes with the Attribute POP, but you can create attributes on the fly with most POPs by specifying a new name where you would give the output attribute name.
Attributes data types[edit]
Attributes can be any name and any size if they are floats. An Attribute can be float (32-bit), double (64-bit double-precision floats), integer (32-bit), or uint (unsigned 32 bit integers). Attributes can be 1-component floats, or 2+ component vectors (vec2, vec3 or vec4), and up-to 4x4 matrices. You can also have arrays, like an array of 5 floats, for example, represented as MyArray[0] to MyArray[4]. POPs that have counters like Ray POP, Line Metrics POP or Neighbor POP create unsigned integer attributes.
Attribute names[edit]
Attribute names can contain only alphabetic characters A-Z lower and upper case. Attribute names will always start with a letter. Standard and Common attributes defined by Derivative are named with the first letter capitalized like Weight. User-defined attributes can start with lower or upper case, but to avoid future conflicts and be more recognized as user-defined, it’s recommended you start them with lower case.
List of Attributes[edit]
You can get a list of all point attributes: in python op('pop1').pointAttributes() with pattern matching. Or you can look at the middle-click Info popup. Also in each POP viewer at the bottom left it shows which attributes are added or changed. Check the section Python Members and Functions.
POPs without a P attribute[edit]
It is possible to create and manipulate a POP without the P attribute - a point can represent any data and not necessarily something with a position. Or on a POP chain, the P doesn’t matter. A point without a P attribute is given a P value of (0, 0, 0) when, for instance you want to display a P-less point in 3D. You can strip a P off using an Attribute Combine POP, for example.
Creating new Custom Attributes[edit]
Selecting Components of Attributes[edit]
Reserved and Common Attribute Names[edit]
Groups[edit]
Some POP Common Features[edit]
Particles[edit]
Point Clouds[edit]
Lines and Curves[edit]
[edit]
Texture Mapping[edit]
Python Members and Functions[edit]
Advanced Features and Topics[edit]
New Concepts in POPs[edit]
POP Lingo Glossary, Miscellaneous[edit]
| POPs |
|---|
| • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • |