Math T3D¶
Summary¶
The Math T3D applies the Math TOP's operations to every voxel, in a fixed order: Channel Pre OP, Combine Channels, Pre-Add, Multiply, Post-Add, the alpha Operation, the ranges (all channels, then red, green, blue and alpha on their own), Channel Post OP, and Integer last.
Set a float Pixel Format for results outside 0–1: with nothing connected, Use Input resolves to 8-bit fixed, which clamps them.
Parameters - OP Page¶
Channel Pre OP Preop ⊞ - Applied to each channel first.
- Off
off - Negate
negate- Negates the value. - Positive
pos- The absolute value. - Root
root- The square root. - Square
square- The square. - Inverse
inverse- One over the value.
Combine Channels Chanop ⊞ - Combines the four channels, RGBA, into one value written to all four: their sum, R minus the others, their product, R divided by the others, their average, minimum, maximum, or the length of the RGBA vector. Alpha takes part: set it to 0 first to combine RGB only.
Channel Post OP Postop ⊞ - Applied to each channel after the range, with the same options as Channel Pre OP.
- Off
off - Negate
negate - Positive
pos - Root
root - Square
square - Inverse
inverse
Integer Integer ⊞ - Rounds every channel up, down or to the nearest integer, last.
- Off
off - Ceiling
ceiling - Floor
floor - Round
round
Parameters - Multi-Add Page¶
Pre-Add Preoff - Added to every channel before Multiply.
Multiply Gain - Multiplies every channel.
Post-Add Postoff - Added to every channel after Multiply.
Operation Op ⊞ - An alpha operation after the multiply-add: multiply RGB by alpha (premultiply), divide RGB by alpha (unpremultiply), or divide and fill voxels whose alpha is 0.
- No Operation
no_op - Pre-Multiply RGB by Alpha
premultrgbbyalpha - Divide RGB by Alpha
rgbdivalpha - Divide RGB by Alpha and Fill
rgbdivalphafill
Parameters - Range Page¶
From Range Fromrange1 Fromrange2 ⊞ - Maps this range of values to To Range, on all four channels, after the alpha operation. Equal from and to ranges leave the values unchanged.
To Range Torange1 Torange2 ⊞ - The range From Range is mapped to.
From Range R Fromranger1 Fromranger2 ⊞ - Like From Range, for the red channel only, applied after it.
To Range R Toranger1 Toranger2 ⊞ - The range From Range R is mapped to.
From Range G Fromrangeg1 Fromrangeg2 ⊞ - Like From Range, for the green channel only.
To Range G Torangeg1 Torangeg2 ⊞ - The range From Range G is mapped to.
From Range B Fromrangeb1 Fromrangeb2 ⊞ - Like From Range, for the blue channel only.
To Range B Torangeb1 Torangeb2 ⊞ - The range From Range B is mapped to.
From Range A Fromrangea1 Fromrangea2 ⊞ - Like From Range, for the alpha channel only.
To Range A Torangea1 Torangea2 ⊞ - The range From Range A is mapped to.
Parameters - Common Page¶
Output Resolution Outputresolution ⊞ - Where the output's width, height and depth come from. With nothing connected to the first input the operator always uses Resolution, whichever option is set.
- Use Input
useinput- The first input's width, height and depth. - Custom
custom- The Resolution parameter.
Resolution Resolution1 Resolution2 Resolution3 ⊞ - Width, height and depth of the output in voxels. Used when Output Resolution is Custom, or when the first input is not connected. Memory is width × height × depth × bytes per voxel of the Pixel Format: 256³ at 16-bit float RGBA is 128 MiB.
Input Smoothness Inputfiltertype ⊞ - Filtering of the internal GLSL TOPs' input samplers, as TouchDesigner's Input Smoothness. Inputs are read at normalised coordinates, so this matters whenever the input and output resolutions differ or an input is transformed. Nearest Pixel returns voxels unblended; Interpolate Pixels is trilinear.
- Nearest Pixel
nearest - Interpolate Pixels
linear - Mipmap Pixels
mipmap
Passes Npasses - Has no effect on this operator: its shaders are compute shaders, which read the connected input on every pass, so extra passes repeat identical work. Leave it at 1.
Pixel Format Format ⊞ - Pixel format of the output. Use Input takes the first input's format. With nothing connected, Use Input resolves to 8-bit fixed (RGBA), which clamps values to 0–1 and quantises them to 1/255: set a float format for signed distances, densities above 1, velocities or anything else outside 0–1.
Bypass Bypass - Passes the first input through unchanged and skips the operator's work. With nothing connected the output is a single black voxel.
Version Version - T3D version of this operator. Read-only information; include it when reporting a problem.
Copyright Copyright - Author and licence information. Read-only.
Operator Inputs¶
- Input 0: Input
T3D_in1- The volume to process.
Operator Outputs¶
- Output 0: Output
T3D_output- The result.
Performance¶
GPU time when the operator recooks: 0.017 ms at 64³, 0.025 ms at 128³, all of its passes summed (GeForce RTX 4090, TouchDesigner 2025.33230). An operator whose inputs and parameters are unchanged does not recook and costs nothing.