The Point Field COMP assigns weights to XYZ points, and the weights can be use to reveal/hide instanced geometry, interpolate between data sets, apply colors, or numerous other purposes. It spatially segregates point sets using "fields".
[This works in Experimental builds of TouchDesigner 2020.44350 from Dec 3. 2020 and later]
What is a field in this context? A field is an entity that has a value or vector at each location in space. Points in 3D space manifest a "field value" (or "weight") for each point. Gravity is a field - wherever you are, there is a certain strength (force) that pulls you in some direction. Also, "noise functions" are fields. For example, in the Noise CHOP, SOP or TOP, you give the OP a set of XYZ points. From the field, for each point, you get a value (one number, a "scalar"), or set of two or more values (a "vector") for each point. The value(s) can then be interpreted/used in any way... For example, a 3-vector from a Noise TOP can be treated as an RGB color as it does by default in the Noise TOP. Or it can be used as an acceleration in some direction. Or, as in this Point Field COMP, a single weight value generated per output point can be used as a scale factor for a rendered instance, shrinking boxes down to size 0.
So this component extends in a simple way what's already in TouchDesigner. First you give it a bunch of XYZs, in a CHOP, SOP or TOP,. You get out one "weight" number per point. There are 2 kinds of fields in this component, based on the Type parameter:
- Relative to a Plane - a value based on the point's proximity to a plane, and which side of the plane it's on: the weight is 1 one one side and 0 on the other side. And it can gradually roll off from 1 to 0 in an S-curve rolloff range around the plane. (The plane can be warped to a parabolic surface uing the Paraboloid parameters.)
- Relative to a Point - a value based on the proximity of each XYZ point to a center point (location determined by the Transform). But the rolloff can be like an S-curve, where the weight is 1 near the point, dropping at a threshold Radius distance, and rolling off to 0 farther from the point.
The input can be a CHOP (with an x, y and z channel), a SOP (with any points) or a TOP (where RGB will be treated as X, Y and Z values.
The component has 3 outputs, each contains the same data in different forms: a CHOP, SOP or TOP. Each output contains the input's XYZ and the weight. The SOP creates a "weight" attribute, the CHOP has a weight channel and in the TOP the weight is in the alpha channel.
The viewer uses the weight values as scale factors for cube instances, but the outputs can be used in any way. For example in this demo file, some components take the weight channels and translate the instances off-screen when weight == 1.
The S-curve rolloff can be replaced with any lookup table using the distance-to-plane or -point as index.
The plane can be rotated/translated/scaled based on the usual Transform-type parameters. The point can be translated in a similar way.
You can Bypass to see all the original points. You can Invert to see the invisible point and vice versa.
With the Plane type, using the Shoulder parameter, the rolloff can occur all on the 1-side of the plane, all on the 0-side of the plane, or crossing from 1 to 0 right at the plane.
field* component, you will see that it uses CHOPs (on the CPU) to compute all the weights (the nodes at the top of the network), or, identically, using the GPU, TOPs to compute the weights (bottom of network), both with the same results. If the input is a SOP, it gets converted to a CHOP and all the calculations are done in CHOPs before passing the results back to a SOP for output. This component is also a confirmation/test that a lot of CHOP operations can now be done faster (and equivalently) on the GPU with TOPs - Math CHOP/TOP, Lookup CHOP/TOP, Function CHOP/TOP, Switch CHOP/TOP, etc..
If you've seen the fabulous work of Ryoichi Kurokawa, you 've likely seen the kinds of reveal/displace/blend effects on point clouds that the Point Field COMP alludes to.
PS This component is intended to be hacked up for other purposes - add different field functions, input/output N-dimensional vectors etc. It provides a good starting-point methodology.