Lerp
Blends between two numbers.
Node id math/lerp
The Lerp node (linear interpolation) outputs the number a fraction t of
the way from a to b: t = 0 gives a, t = 1 gives b, and the
default 0.5 gives their middle.
Parameters
| Name | Type | Default |
|---|---|---|
| curve | EasingCurve | "linear" |
| mode | EasingMode | "in-out" |
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| a | number | 0 | |
| b | number | 1 | |
| t | number | 0.5 |
Outputs
| Name | Type | Notes |
|---|---|---|
| result | number |
Behaviour
- Defaults.
adefaults to 0,bto 1 andtto 0.5. - Easing parameters. Parameters
curve(defaultlinear) andmode(defaultin-out) allow non-linear easing directly on the node. Whencurveislinear,tis unclamped and extrapolates outside 0 to 1. Whencurveis set to a non-linear curve (such ascubic,bounce, orsine),tis clamped to 0 to 1 and transformed by the easing curve before blending. - Not clamped when linear. With
curve=linear,toutside 0 to 1 continues the line past the ends: witha= 0 andb= 10,t= 1.5 gives 15 andt= -0.5 gives -5. Use Clamp ontor choose an easing curve to keep the result betweenaandb. - Unlike the object Lerp nodes. The Lerp nodes of the object types
(such as Lerp Color or Lerp Point, on each
type's page) do clamp
tto 0 to 1.
Related nodes
- Clamp: keeps
tfrom 0 to 1. - Inverse Lerp: the other way round, a
number back to its
t. - Map Range: converts a number from one range to another.
- Ease, Ease Bézier
and Ease Steps: shape
tbefore the blend, for any Lerp node. - Average: the middle of more than two numbers.