Experimental:Math Combine POP
Summary[edit]
The Math Combine POP can do numerous math operations in one node, and is an expansion of the more elementary Math POP and Math Mix POP:
In addition to what Math Mix does:
- On the New page it lets you create new attributes with constant values, with more control over type and size, usable in the Combine page and output directly unless you delete them on the Output page.
- On the Pre page it has a set of pre-process blocks where you operate on one attribute per block, similar to the Math POP.
- On the Post page it has a set of post-process blocks after the Combine page, operating on one attribute at a time again, with re-ranging.
- On the Output page it gives more control over keeping or deleting temporary attributes.
Handling Inputs: Math Combine handles inputs differently than Math Mix: In the Math Combine POP you explicitly select the attributes from all the inputs, you can rename them, and these selected attributes go to the output (unless you delete them on the output page). Math Mix POP auto-names all the inputs’ attributes (in2_Tex for example), but the attributes don’t go to the output except for the first input's attributes. Math Combine POP treats inputs the same way as the Attribute Combine POP, which essentially hides which POPs the attributes come from. Note that anything you select on the Inputs page does not copy the attribute data - it remains as all references to attribute arrays in the incoming POPs.
The difference between the Uniforms page and the New page: The New page creates a full array of data, one per point constant value per point, and it is output from the POP like any attribute. Uniforms are named constant values that does not create any new data and is not output from the POP.
The Pre page and Post page (similar to the Math POP) are sequential blocks that operate on one attribute per block, with these parameters:
- Scope - which attribute to operate on
- Parameter Size (default 1) (Parameter Size means how many sets of parameters, like Parameter Size of 3 will present a set of parameters for each of X, Y and Z.
- Pre page has:
- Order menu (Add Multiply Op, Multiply Add Op, Op Add Multiply, Op Add Multiply)
- Multiply float
- Add float
- Operation - all the unary operations of the Combine page
- Post page has:
- Re-ranging parameters
- casting to integers, doubles, floats
- Quantize - rounding and also logic operations (> 0, == 0, …)
- Result Scope (in which attribute to put the result, whether it is an existing set of components or a new attribute)
Output page:
- Delete Attributes - which ones to delete from the output
- Delete New Attributes toggle
- Output Secondary Attributes - outputs ones created in the POP
Note that on the Common page you can select to output only the attributes that were affected in the POP, useful for cases where you want to output one attribute per POP.
Note the pop-up info contains pseudocode of the operations in this POP, for easier reading.
Attaching an Info DAT will show you raw GLSL code that is generated.
Parameters - Inputs Page
attrclass - ⊞ -
- Point
point-
- Vertex
vertex-
- Primitive
primitive-
lengthmismatchnotif - ⊞ -
- Ignore
ignore-
- Warning
warning-
- Error
error-
lengthmismatchaction - ⊞ -
- Hold
hold-
- Repeat
repeat-
- Zero
zero-
- One
one-
- None
none-
group -
input -
input0pop -
input0attrs - ⊞ -
- *
*-
input0renameto -
Parameters - Uniforms Page
vec -
vec0name -
vec0type - ⊞ -
- float
float-
- float2
float2-
- float3
float3-
- float4
float4-
- double
double-
- double2
double2-
- double3
double3-
- double4
double4-
- int
int-
- int2
int2-
- int3
int3-
- int4
int4-
- uint
uint-
- uint2
uint2-
- uint3
uint3-
- uint4
uint4-
vec0value - ⊞ -
- Value
vec0value0-
- Value
vec0value1-
- Value
vec0value2-
- Value
vec0value3-
Parameters - New Page
attr -
attr0name - ⊞ -
- Custom
custom-
- N
n-
- Color
color-
- Tex
tex-
- PointScale
pointscale-
- LineWidth
linewidth-
attr0customname -
attr0type - ⊞ -
- float
float-
- double
double-
- int
int-
- uint
uint-
- dir
dir-
- dbl dir
ddir-
attr0numcomps - ⊞ -
- 1
1-
- 2
2-
- 3
3-
- 4
4-
attr0defvalue - ⊞ -
- Default Value
attr0defvalue1-
- Default Value
attr0defvalue2-
- Default Value
attr0defvalue3-
- Default Value
attr0defvalue4-
Parameters - Pre Page
pre -
pre0scope -
pre0parsize - ⊞ -
- 1
1-
- 2
2-
- 3
3-
- 4
4-
pre0order - ⊞ -
- Multiply, Add, Operation
multaddop-
- Add, Multiply, Operation
addmultop-
- Operation, Multiply, Add
opmultadd-
- Operation, Add, Multiply
opaddmult-
pre0mult -
pre0add -
pre0oper - ⊞ -
- None
none-
- abs(A)
abs-
- sign(A)
sign-
- sqrt(A)
sqrt-
- A * A
square-
- 1 / A
inverse-
- floor(A)
floor-
- round(A)
round-
- ceil(A)
ceil-
- int(A)
int-
- fract(A)
fract-
- degrees(A)
degrees-
- radians(A)
radians-
- normalize(A)
normalize-
- exp10(A)
exp10-
- exp2(A)
exp2-
- exp(A)
exp-
- log10(A)
log10-
- log2(A)
log2-
- ln(A)
ln-
- sin(A)
sin-
- cos(A)
cos-
- tan(A)
tan-
- asin(A)
asin-
- acos(A)
acos-
- atan(A)
atan-
- dbtopow(A)
dbtopow-
- powtodb(A)
powtodb-
- dbtoamp(A)
dbtoamp-
- amptodb(A)
amptodb-
pre0quantize - ⊞ -
- Off
off-
- Floor
floor-
- Round
round-
- Ceiling
ceiling-
- > 0
gt0-
- >= 0
gteq0-
- == 0
eq0-
- != 0
neq0-
- <= 0
lteq0-
- < 0
lt0-
pre0resultscope - ⊞ -
- Color
Color-
- Color(0) Color(1) Color(2)
Color(0) Color(1) Color(2)-
- N
N-
- Tex
Tex-
- Color.i012
Color.i012-
Parameters - Combine Page
comb -
comb0oper - ⊞ -
- None
none-
- A
copya-
- abs(A)
abs-
- sign(A)
sign-
- sqrt(A)
sqrt-
- A * A
square-
- 1 / A
inverse-
- floor(A)
floor-
- round(A)
round-
- ceil(A)
ceil-
- int(A)
int-
- fract(A)
fract-
- normalize(A)
normalize-
- exp10(A)
exp10-
- exp2(A)
exp2-
- exp(A)
exp-
- log10(A)
log10-
- log2(A)
log2-
- ln(A)
ln-
- sin(A)
sin-
- cos(A)
cos-
- tan(A)
tan-
- asin(A)
asin-
- acos(A)
acos-
- atan(A)
atan-
- degrees(A)
degrees-
- radians(A)
radians-
- length(A)
length-
- compadd(A)
compadd-
- compsub(A)
compsub-
- compmult(A)
compmult-
- compdiv(A)
compdiv-
- compavg(A)
compavg-
- compmin(A)
compmin-
- compmax(A)
compmax-
- A + B
add-
- A - B
asubb-
- B - A
bsuba-
- A * B
mult-
- A / B
adivb-
- B / A
bdiva-
- A ** B
apowerb-
- logB(A)
logba-
- avg(A, B)
avg-
- min(A, B)
min-
- max(A, B)
max-
- mod(A, B)
mod-
- int(A / B)
intadivb-
- A > B
gt-
- A >= B
gte-
- A < B
lt-
- A <= B
lte-
- A == B
eq-
- A != B
ne-
- atan2(A, B)
atan2-
- dot(A, B)
dot-
- angle(A, B)
angle-
- cross(A, B)
cross-
- A + B * C
aaddbmultc-
- A * B + C
amultbaddc-
- A + B + C
aaddbaddc-
- A * B * C
amultbmultc-
- rangefrom(A, B, C)
rangefrom-
- rangeto(A, B, C)
rangeto-
- mix(A, B, C)
mix-
- A if C else B
ifelse-
- loop(A, B, C)
loop-
- zigzag(A, B, C)
zigzag-
- clamp(A, B, C)
clamp-
- smoothstep(A, B, C)
smoothstep-
- B <= A < C
bltealtc-
- B < A <= C
bltaltec-
- B < A < C
bltaltec-
- B <= A <= C
bltaltec-
- reflect(A, B)
reflect-
- refract(A, B, C)
refract-
comb0scopea -
comb0scopeb -
comb0scopec -
comb0result - ⊞ -
- Color
Color-
- Color(0) Color(1) Color(2)
Color(0) Color(1) Color(2)-
- N
N-
- Tex
Tex-
- Color.i012
Color.i012-
Parameters - Post Page
post -
post0scope -
post0parsize - ⊞ -
- 1
1-
- 2
2-
- 3
3-
- 4
4-
post0fromlow -
post0fromhigh -
post0tolow -
post0tohigh -
post0quantize - ⊞ -
- Off
off-
- Floor
floor-
- Round
round-
- Ceiling
ceiling-
- > 0
gt0-
- >= 0
gteq0-
- == 0
eq0-
- != 0
neq0-
- <= 0
lteq0-
- < 0
lt0-
post0castto - ⊞ -
- Automatic
auto-
- Float
float-
- Int
int-
post0result - ⊞ -
- Color
Color-
- Color(0) Color(1) Color(2)
Color(0) Color(1) Color(2)-
- N
N-
- Tex
Tex-
- Color.i012
Color.i012-
Parameters - Output Page
delattrs -
delnewattrs -
outputsecondary - ⊞ -
- *
*-
Parameters - Common Page
bypass -
delinputattrs -
parmcolorspace - ⊞ - Controls how all color parameters on this node are interpreted. The color values as treated as being in the selected color space, and are converted to the Working Color Space before they are used as part of the node's operation. Note that this does not change the color space of the node itself, as that is always in the Working Color Space.
- sRGB
srgb- sRGB color space, with sRGB transfer function. Considered an SDR color space with respect to Reference White.
- sRGB - Linear
srgblinear- sRGB color space, with linear transfer function. Considered an SDR color space with respect to Reference White.
- Rec.601 (NTSC)
rec601ntsc- Rec.601 with NTSC primaries color space, with Rec.601 transfer function. Considered an SDR color space with respect to Reference White.
- Rec.709
rec709- Rec.709 color space, with Rec.709 (same as Rec.2020) transfer function. Considered an SDR color space with respect to Reference White.
- Rec.2020
rec2020- Rec.2020 color space, with Rec.2020 (same as Rec.709) transfer function. Considered an HDR color space with respect to Reference White.
- DCI-P3
dcip3- DCI-P3 color space, with D65 white point and 2.6 gamma transfer function. Considered an HDR color space with respect to Reference White.
- DCI-P3 (D60)
dcip3d60- DCI-P3 "D60 sim" color space, with D60 white point, and 2.6 gamma transfer function. Considered an HDR color space with respect to Reference White.
- Display-P3 (D65)
displayp3d65- Display-P3 color space, with D65 white point, and sRGB gamma transfer function. Considered an HDR color space with respect to Reference White.
- ACES2065-1
aces2065-1- ACES 2065-1 (also known as ACES AP0) color space, with a linear gamma transfer function. Considered an HDR color space with respect to Reference White.
- ACEScg
acescg- ACEScg (also known as ACES AP1) color space, with a linear gamma transfer function. Considered an HDR color space with respect to Reference White.
- Passthrough
passthrough- When selected, the color values will be used as-is in the operation, without any modification or attempt to convert them into the Working Color Space.
parmreferencewhite - ⊞ - When converting a parameter color value to the Working Color Space, this controls how it should be treated with respect to Reference White. If the Working Color Space is the same Reference White, then no adjustment is done. If they are different, then the Reference White level (brightness) of this color will be adjusted to the range expected by the Working Color Space. For example if the project is set to have a SDR Reference White of 120 nits, and the HDR Reference White is 80 nits, then a color of (1, 1, 1), which is 120 nits in the SDR color space, will be converted to be (1.5, 1.5, 1.5), which is 120 nits still in the HDR Working Color Space.
- Default For Color Space
default- Will use either the SDR or the HDR Reference White, based on the color space selected.
- Standard (SDR)
sdr- Will treat the Parameter Color Space as SDR for it's reference white value.
- High (HDR)
hdr- Will treat the Parameter Color Space as HDR for it's reference white value.
Operator Inputs
- Input 0: -
Info CHOP Channels
Extra Information for the Math Combine POP can be accessed via an Info CHOP.
Common POP Info Channels
Common Operator Info Channels
- total_cooks - Number of times the operator has cooked since the process started.
- cook_time - Duration of the last cook in milliseconds.
- cook_frame - Frame number when this operator was last cooked relative to the component timeline.
- cook_abs_frame - Frame number when this operator was last cooked relative to the absolute time.
- cook_start_time - Time in milliseconds at which the operator started cooking in the frame it was cooked.
- cook_end_time - Time in milliseconds at which the operator finished cooking in the frame it was cooked.
- cooked_this_frame - 1 if operator was cooked this frame.
- warnings - Number of warnings in this operator if any.
- errors - Number of errors in this operator if any.
TouchDesigner Build:
| POPs |
|---|
| • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • |