Field Math
Combines two fields using math operations. Supports scalar-scalar, vector-vector, and mixed scalar-vector combinations.
Category: Math Menu path: Math > Field Math
Ports
| Port | Type | Direction | Description |
|---|---|---|---|
a | scalarField | input | First field operand (also accepts vectorField and scalar) |
b | scalarField | input | Second field operand (also accepts vectorField and scalar) |
scalarField | scalarField | output | Combined scalar field result |
vectorField | vectorField | output | Combined vector field result |
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
operation | enum | Multiply | Math operation: Add, Subtract, Multiply, Divide, Min, Max, Lerp, Power, Screen, SmoothMin, SmoothMax |
t | scalar | 0.5 | Lerp factor (Lerp) OR smoothness coefficient k (SmoothMin, SmoothMax) |
The t param is visible only for Lerp, SmoothMin, and SmoothMax — it does double-duty across those three operations. For other operations, only operation is shown.
Operations
| Operation | Formula |
|---|---|
| Add | A + B |
| Subtract | A - B |
| Multiply | A * B |
| Divide | A / B |
| Min | min(A, B) |
| Max | max(A, B) |
| Lerp | A + (B - A) * t |
| Power | A ^ B |
| Screen | 1 - (1 - A) * (1 - B) |
| SmoothMin | polynomial smooth min with smoothness k = t: degenerates to min at t = 0, widens the smooth blend radius as t grows |
| SmoothMax | polynomial smooth max: -SmoothMin(-A, -B, t) |
SmoothMin / SmoothMax produce blended level sets when applied to two distance fields — the core primitive for metaballs. Combine with ContourExtract downstream to extract the blended boundary as a shape:
DistanceField(A) ─┐
├─► FieldMath(SmoothMin, t=0.3) ─► ContourExtract ─► DrawShape
DistanceField(B) ─┘Typical t values for [0, 1] fields like normalized distance: 0.1–0.5. Higher t = wider smooth transition.
How It Works
FieldMath composes two fields lazily -- the operation is applied at eval() time when a consumer samples the combined field. No GPU textures are allocated.
Type dispatch:
- Both scalar fields -> scalar output.
- Both vector fields -> vector output (component-wise operations).
- Mixed scalar and vector -> vector output. The scalar is used as a weight in [0, 1] space (not bipolar [-1, 1]) to modulate the vector field.
- Scalar values (from Constant or Math nodes) are promoted to constant fields.
Single-input passthrough: If only one input is connected, the field passes through unmodified.
Usage Examples
Basic: Mask a flow field
Noise.vectorField -> FieldMath.a (Multiply). DistanceField.scalarField -> FieldMath.b. The noise flow is multiplied by the distance field falloff -- particles flow near the shape but are still outside it.
Blend two noise fields
Noise1.scalarField -> FieldMath.a (Add). Noise2.scalarField -> FieldMath.b. Combines two noise patterns for a more complex field.
Lerp between fields
Noise1.vectorField -> FieldMath.a (Lerp, t: keyframed 0 to 1). Noise2.vectorField -> FieldMath.b. Smoothly transitions from one flow field to another over time.
Screen compositing
DistanceField1.scalarField -> FieldMath.a (Screen). DistanceField2.scalarField -> FieldMath.b. Produces a union-like combination where both fields contribute without exceeding 1.0.
Tips
- Multiply is the default and most common operation -- it works like a field mask
- Mixed scalar-vector math uses [0, 1] range for the scalar (not [-1, 1]), so a scalar value of 0.5 halves the vector
- Field operations are lazy -- chaining multiple FieldMath nodes has no cost until a consumer evaluates the combined field
- Screen is useful for combining multiple distance fields into a soft union
Related Nodes
- Remap -- reshape a single field's value distribution via curve
- Noise -- common field source for both scalar and vector
- DistanceField -- shape-based field source
- Math -- scalar math operations (non-field)
- PointAdvect -- consumer of combined vector fields