Difference T3D¶
Summary¶
The Difference T3D outputs |Input 1 − Input 2| for every RGBA channel, alpha included.
The input selected by Size sets the output's resolution; the other is the overlay, fitted by Pre-Fit Overlay and placed by the Transform page, and returns Extend outside its own bounds. Both are sampled at normalised positions, so inputs of different resolutions line up by extent. See Combining volumes.
Parameters - Transform Page¶
Size Size ⊞ - Which input sets the output resolution. The other input is the overlay: the Transform parameters and Pre-Fit Overlay place it inside the first.
- Input 1
input1 - Input 2
input2
Pre-Fit Overlay Prefit ⊞ - How the overlay is scaled to the output before the transform, as in TouchDesigner's Composite TOP, extended to three axes. Fit Horizontal, Fit Vertical and Fit Depth match the overlay's width, height or depth and keep its proportions; Fit Best and Fit Outside choose the axis that keeps the overlay entirely inside, or entirely covering, the output. Native Resolution keeps one overlay voxel per output voxel.
- Fill
fill - Fit Horizontal
fithorz - Fit Vertical
fitvert - Fit Depth
fitdepth - Fit Best
fitbest - Fit Outside
fitoutside - Native Resolution
nativeres
Justify Horizontal Justifyh ⊞ - Horizontal placement of the overlay. Applies only when Pre-Fit Overlay is Native Resolution.
- Left
left - Center
center - Right
right
Justify Vertical Justifyv ⊞ - Vertical placement of the overlay. Applies only when Pre-Fit Overlay is Native Resolution.
- Bottom
bottom - Center
center - Top
top
Justify Depth Justifyd ⊞ - Placement of the overlay in depth. Applies only when Pre-Fit Overlay is Native Resolution.
- Back
back - Center
center - Front
front
Extend Overlay Extend ⊞ - What the overlay returns outside its own bounds after the transform: Zero (transparent black), Hold (the edge voxel), Repeat or Mirror.
- Hold
hold - Zero
zero - Repeat
repeat - Mirror
mirror
Aspect Correction Aspectcorrection - Rotates the overlay in undistorted space when the volume is not a cube, so rotation keeps its shape (measured in 128 × 64 × 32: a 64 × 12 voxel bar rotated 90° about Z becomes 12 × 64; off, it becomes a distorted 24 × 32). Translate and Scale are fractions of each axis's extent either way.
Transform Order Xord ⊞ - Order in which scale, rotate and translate are applied to the overlay.
- Scale Rotate Translate
srt - Scale Translate Rotate
str - Rotate Scale Translate
rst - Rotate Translate Scale
rts - Translate Scale Rotate
tsr - Translate Rotate Scale
trs
Rotate Order Rord ⊞ - Order of the rotations about X, Y and Z.
- Rx Ry Rz
xyz - Rx Rz Ry
xzy - Ry Rx Rz
yxz - Ry Rz Rx
yzx - Rz Rx Ry
zxy - Rz Ry Rx
zyx
Translate Tx Ty Tz ⊞ - Moves the overlay, as a fraction of each axis's extent: 0.1 moves it a tenth of the width along X and a tenth of the height along Y.
Rotate R1 R2 R3 ⊞ - Rotation of the overlay about each axis, in degrees, around the pivot.
Scale Sx Sy Sz ⊞ - Scale of the overlay along each axis, around Pivot.
Pivot Px Py Pz ⊞ - Pivot of rotation and scale, as a fraction of each axis's extent from the corner at the origin. The default 0.5 is the volume's centre.
Uniform Scale Scale - Uniform scale, multiplied with Scale per axis.
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 - Runs the operation this many times, each pass taking the previous pass's result in place of the first input. Cost scales linearly with the number of passes.
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 1
T3D_in1- The first operand. With Size at Input 2 (the default) it is the overlay, placed by the Transform page. - Input 1: Input 2
T3D_in2- The second operand. With Size at Input 2 (the default) it sets the output's resolution and stays in place; at Input 1 it becomes the overlay.
Operator Outputs¶
- Output 0: Output
T3D_output- The result, at the resolution of the input selected by Size.
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.