Close
Asset

Point Field COMP

The pointField 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".

The .toe files here are the full test files with all examples. The TouchDesigner palette contains the pointField.tox from which the examples are based. See also https://docs.derivative.ca/Palette:pointField.

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:

  1. 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.)
  2. 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.
  3. Proximity to a Box - a value based on the proximity of each XYZ point to a box of any dimension (location/rotation determined by the Transform).

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 1 output - the TOP containing the point cloud with weight 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.

Inside each pointField* component, you will see that it uses TOPs to compute the weights. If the input is a SOP, it gets converted to a  TOP and all the calculations are done in TOPs. Previos version of this component was 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..

One pointField COMP can be passed to another pointField and their calculated weights are muntiplied together.  That is, if weight is on the input CHOP/SOP/TOP, it will be used by pointField.

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.

[  PointField.238.toe works in TouchDesigner 2021 Official builds, and PointField.297.toe works in TouchDesigner 2022 builds.  pointField is a palette component in 2022.20300 and later. POintField.327.toe is stripped down to not include the SOP and CHOP outputs - They were there to prove the CHOP path and TOP paths were equivalent. ]

Asset Downloads

PointField.238.toe (68.45 KB)
PointField.297.toe (111.45 KB)
PointField.327.toe (112.2 KB)

Comments