Math Interpolate*

Preview
Performance Cost 🟢 Low
Signal Type Vector → Vector
Implementation Native Compiled C++
Devices (Cycles) CPU / GPU (1:1)

Math Interpolate provides a set of robust mixing methods for smoothly blending between two vectors. While a standard "Mix" node simply performs a linear average, this node offers 10 distinct mathematical curves—including nonlinear, perceptual, ratio-preserving, and spherical variants. It is designed for precise control over gradients, animation easing, color mixing, and directional blending where specific acceleration or pathing behavior is required.

Usage & Behavior

Interpolation Logic: Practical Applications

The "Curve" you choose determines the physics of the blend. Here are the three most common scenarios:

1. The Normal Map Fix (Rotation)
Mode: SPHERICAL
Input 1: Base Normal
Input 2: Overlay Normal

Standard "Linear" mixing draws a straight line between two vectors, which shortens them in the middle (causing dark shading artifacts). Spherical interpolation rotates the vector along an arc, preserving its length and maintaining correct lighting physics.

2. The Organic Fade (Easing)
Mode: SMOOTHSTEP
Input 1: Texture A
Input 2: Texture B

Linear gradients often look "mechanical" or "CG." By using Smoothstep as your mixing curve, you ease the transition in and out. This mimics natural falloff, making texture blends (like moss on rock) look grounded rather than pasted on.

3. The Density Stack (Physics)
Mode: EXPONENTIAL
Input 1: Low Density
Input 2: High Density

When dealing with light absorption or volume density, linear math often looks flat. Exponential interpolation respects the multiplicative nature of light transmission, creating much deeper, richer volumetric gradients.

Linear + Spherical Gradient :
Exponential Mode (Normalize OFF)
Linear + Spherical Gradient :
Exponential Mode (Normalize ON)

The node blends Input 1 (at Mixer 0.0) to Input 2 (at Mixer 1.0). The Mode determines the "path" taken between these two states. For example, when mixing Normal Maps, a standard Linear mix shortens the vector length in the middle (resulting in darker shading), whereas the Spherical mode rotates the vector along an arc, preserving correct lighting physics.

Best Used For: Mixing Normal Maps (Spherical), smoothing animations (Smoothstep), blending density/volume data (Exponential), and high-contrast masking (Sigmoid).

Key Features

  • 10 Interpolation Curves: Covers Linear, Easing, Logarithmic, and Geometric mixing.
  • Spherical (Slerp): Essential for blending rotations and normals without volume loss.
  • Auto-Normalize: Optional re-normalization for direction vectors.

Cheat Sheet: Interpolation Modes

Choose the mode based on the type of data you are mixing:

Standard / Linear
  • LINEAR: Basic straight-line mix ($A \to B$).
  • INVLINEAR: Inverse mapping (finds $t$ given value).
Easing / Smoothing
  • SMOOTHSTEP: Cubic ease-in/out. The standard for soft transitions.
  • SMOOTHERSTEP: Quintic ($t^5$). Even softer start/stop.
  • COSINE: Gentle sinusoidal wave transition.
  • SIGMOID: High contrast. Slow start, fast middle, slow end.
Physical / Directional
  • EXPONENTIAL: Preserves multiplicative ratios. Great for light intensity.
  • LOGARITHMIC: Blends in log-space. Perceptually smooth brightness.
  • SPHERICAL: Interpolates along the arc angle. Critical for Normals.

Parameters

Mode Enum
Selects the mathematical curve used for blending (see Cheat Sheet above).
Normalize (bool, default: true)
Forces the resulting vector to have a length of 1.0. This is highly recommended when working with Direction vectors or Normal maps to prevent them from becoming "un-normalized" during the mix.
Input 1 Vector
The starting value (when Mixer is 0.0).
Input 2 Vector
The target value (when Mixer is 1.0).
Mixer (default: 0.5)
The blend factor (0.0 to 1.0).

Quick Recipes

Practical mixing scenarios.

Normal Map Mixer

  • Mode SPHERICAL
  • Normalize True
  • Input 1 Base Normal
  • Input 2 Detail Normal
Correctly rotates normals without shortening them, preserving shading intensity.

Soft Mask Transition

  • Mode SMOOTHSTEP
  • Input 1 Black
  • Input 2 White
  • Mixer Gradient
Converts a linear gradient into a smooth, eased mask with soft falloff at both ends.

Volumetric Density

  • Mode EXPONENTIAL
  • Input 1 Thin Fog
  • Input 2 Thick Smoke
Blends density values in a way that looks physically correct for light absorption.
↑ Back to Top

Leave a Reply