base-node (.bn) v0.13.1

math

Mathematical toolkit for Geometry Nodes: shaping curves, waves, vectors, SDFs, and noise distributions

Targetsblender-compositor, blender-geometry, blender-gp
Version0.13.1 (edition 2026)
Depends on—
Importuse math or use math (name, …)
Sourcestdlib/math.bn

Mathematical toolkit for Geometry Nodes: shaping curves, waves, angles, vectors, signed distance fields (SDF), and random distributions. Shaping curves and SDFs follow formulas published by Inigo Quilez (iquilezles.org). The string at the head of each graph is its docstring / asset description. An input p = Position() binds the point position when unconnected, id = ID() its identifier.

math-noise math-sdf

Curves: x from 0 to 1 produces 0 to 1#

bias#

Pushes values toward 0 (force < 0.5) or toward 1 (force > 0.5); 0.5 has no effect

geometry graph bias(x: Float, force: Float = 0.25 in 0.001..0.999) -> Float
InputTypeDefaultRange
xFloat
forceFloat0.250.001..0.999
geometry ✓shader ✓compositor ✓

gain#

S-curve around 0.5 (contrast < 0.5) or its inverse (> 0.5); 0.5 has no effect

geometry graph gain(x: Float, contrast: Float = 0.25 in 0.001..0.999) -> Float
InputTypeDefaultRange
xFloat
contrastFloat0.250.001..0.999
geometry ✓shader ✗compositor ✓

not in a shader tree: no Compare in a shader tree

ease in#

Starts slowly: t raised to power

geometry graph "ease in"(t: Float, power: Float = 2.0 in 0.0..) -> Float
InputTypeDefaultRange
tFloat
powerFloat2.00.0..
geometry ✓shader ✓compositor ✓

ease out#

Ends slowly: inverse of ease in

geometry graph "ease out"(t: Float, power: Float = 2.0 in 0.0..) -> Float
InputTypeDefaultRange
tFloat
powerFloat2.00.0..
geometry ✓shader ✓compositor ✓

ease in out#

Starts and ends slowly, passes through 0.5 at midpoint

geometry graph "ease in out"(t: Float, power: Float = 2.0 in 0.0..) -> Float
InputTypeDefaultRange
tFloat
powerFloat2.00.0..
geometry ✓shader ✗compositor ✓

not in a shader tree: no Compare in a shader tree

impulse#

Rises quickly to 1 at x = 1 / stiffness, then falls slowly: shock, bounce

geometry graph impulse(x: Float, stiffness: Float = 4.0) -> Float
InputTypeDefaultRange
xFloat
stiffnessFloat4.0
geometry ✓shader ✓compositor ✓

bump#

Smooth bump: 1 at center, 0 beyond half width

geometry graph bump(
    x: Float,
    center: Float = 0.5,
    "half width": Float = 0.25 in 0.0001..
) -> Float
InputTypeDefaultRange
xFloat
centerFloat0.5
half_widthFloat0.250.0001..
geometry ✓shader ✓compositor ✓

parabola#

0 at edges, 1 at midpoint; sharpness 1 gives a parabola, higher sharpens it

geometry graph parabola(x: Float, sharpness: Float = 1.0 in 0.0..) -> Float
InputTypeDefaultRange
xFloat
sharpnessFloat1.00.0..
geometry ✓shader ✓compositor ✓

steps#

Stair steps: each step rises smoothly over its final fraction 'rise'

geometry graph steps(x: Float, rise: Float = 0.25 in 0.0001..1.0) -> Float
InputTypeDefaultRange
xFloat
riseFloat0.250.0001..1.0
geometry ✓shader ✓compositor ✓

bounce#

Falls and bounces three times before settling at 1: a ball

geometry graph bounce(t: Float) -> Float
InputTypeDefaultRange
tFloat
geometry ✓shader ✗compositor ✓

not in a shader tree: no Compare in a shader tree

elastic#

Overshoots 1 and oscillates back: a released spring

geometry graph elastic(t: Float) -> Float
InputTypeDefaultRange
tFloat
geometry ✓shader ✓compositor ✓

recoil#

Pulls back before advancing: force 1.70158 recoils by 10%

geometry graph recoil(t: Float, force: Float = 1.70158) -> Float
InputTypeDefaultRange
tFloat
forceFloat1.70158
geometry ✓shader ✓compositor ✓

Waves of period 1#

triangle#

Triangle wave: 0 at integers, 1 at midpoints

geometry graph triangle(x: Float) -> Float
InputTypeDefaultRange
xFloat
geometry ✓shader ✓compositor ✓

square#

Square wave: 1 during duty cycle fraction of each period, 0 otherwise

geometry graph square(x: Float, duty_cycle: Float = 0.5 in 0.0..1.0) -> Float
InputTypeDefaultRange
xFloat
duty_cycleFloat0.50.0..1.0
geometry ✓shader ✗compositor ✓

not in a shader tree: no Compare in a shader tree

sine01#

Sine between 0 and 1: 0.5 at integers, 1 at quarter-period

geometry graph sine01(x: Float) -> Float
InputTypeDefaultRange
xFloat
geometry ✓shader ✓compositor ✓

Vectors#

project on plane#

Projection of v onto the plane perpendicular to normal

geometry graph "project on plane"(v: Vector, normal: Vector = (0.0, 0.0, 1.0)) -> Vector
InputTypeDefaultRange
vVector
normalVector(0.0, 0.0, 1.0)
geometry ✓shader ✓compositor ✓

perpendicular#

Unit vector perpendicular to v

geometry graph perpendicular(v: Vector) -> Vector
InputTypeDefaultRange
vVector
geometry ✓shader ✗compositor ✓

not in a shader tree: no Compare in a shader tree

max component#

Largest of the three vector components

geometry graph "max component"(v: Vector) -> Float
InputTypeDefaultRange
vVector
geometry ✓shader ✓compositor ✓

min component#

Smallest of the three vector components

geometry graph "min component"(v: Vector) -> Float
InputTypeDefaultRange
vVector
geometry ✓shader ✓compositor ✓

closest on segment#

Closest point on segment [a, b] to p, its distance to p and factor (0 at a, 1 at b)

geometry graph "closest on segment"(
    p: Vector = Position(),
    a: Vector,
    b: Vector = (0.0, 0.0, 1.0)
) -> (Distance: Float, Factor: Float, Point: Vector)
InputTypeDefaultRange
pVectorPosition()
aVector
bVector(0.0, 0.0, 1.0)
geometry ✓shader ✓compositor ✓

Angles, in radians#

wrap angle#

Wraps an angle into [-π, π]

geometry graph "wrap angle"(angle: Float) -> Float
InputTypeDefaultRange
angleFloat
geometry ✓shader ✓compositor ✓

angle between#

Angle between two vectors, from 0 to π, accurate even for nearly parallel vectors

geometry graph "angle between"(u: Vector, v: Vector) -> Float
InputTypeDefaultRange
uVector
vVector
geometry ✓shader ✓compositor ✓

signed angle#

Signed rotation angle from u to v around axis, from -π to π

geometry graph "signed angle"(u: Vector, v: Vector, axis: Vector = (0.0, 0.0, 1.0)) -> Float
InputTypeDefaultRange
uVector
vVector
axisVector(0.0, 0.0, 1.0)
geometry ✓shader ✓compositor ✓

Colors#

luminance#

Color luminance (Rec. 709): perceived brightness

geometry graph luminance(color: Color) -> Float
InputTypeDefaultRange
colorColor
geometry ✓shader ✓compositor ✓

palette#

Inigo Quilez cosine palette: a + b × cos(2π (c × t + d)), one color for each t

geometry graph palette(
    t: Float,
    a: Vector = (0.5, 0.5, 0.5),
    b: Vector = (0.5, 0.5, 0.5),
    c: Vector = (1.0, 1.0, 1.0),
    d: Vector = (0.0, 0.33, 0.67)
) -> Color
InputTypeDefaultRange
tFloat
aVector(0.5, 0.5, 0.5)
bVector(0.5, 0.5, 0.5)
cVector(1.0, 1.0, 1.0)
dVector(0.0, 0.33, 0.67)
geometry ✓shader ✓compositor ✓

Signed Distance Fields: negative inside, zero on surface#

sdf sphere#

Sphere centered at origin

geometry graph "sdf sphere"(p: Vector = Position(), radius: Float = 1.0) -> Float
InputTypeDefaultRange
pVectorPosition()
radiusFloat1.0
geometry ✓shader ✓compositor ✓

sdf box#

Box centered at origin of given half-extents

geometry graph "sdf box"(p: Vector = Position(), "half size": Vector = (1.0, 1.0, 1.0)) -> Float
InputTypeDefaultRange
pVectorPosition()
half_sizeVector(1.0, 1.0, 1.0)
geometry ✓shader ✓compositor ✓

sdf torus#

Flat torus centered around the Z axis

geometry graph "sdf torus"(
    p: Vector = Position(),
    "major radius": Float = 1.0,
    "minor radius": Float = 0.25
) -> Float
InputTypeDefaultRange
pVectorPosition()
major_radiusFloat1.0
minor_radiusFloat0.25
geometry ✓shader ✓compositor ✓

sdf cylinder#

Capped cylinder along Z of height 2 × half height

geometry graph "sdf cylinder"(
    p: Vector = Position(),
    radius: Float = 1.0,
    "half height": Float = 1.0
) -> Float
InputTypeDefaultRange
pVectorPosition()
radiusFloat1.0
half_heightFloat1.0
geometry ✓shader ✓compositor ✓

sdf capsule#

Capsule: line segment from a to b thickened by radius

geometry graph "sdf capsule"(
    p: Vector = Position(),
    a: Vector,
    b: Vector = (0.0, 0.0, 1.0),
    radius: Float = 0.25
) -> Float
InputTypeDefaultRange
pVectorPosition()
aVector
bVector(0.0, 0.0, 1.0)
radiusFloat0.25
geometry ✓shader ✓compositor ✓

sdf cone#

Cone frustum along Z of height 2 × half height; top radius 0 gives a sharp cone

geometry graph "sdf cone"(
    p: Vector = Position(),
    "half height": Float = 1.0,
    "bottom radius": Float = 1.0,
    "top radius": Float in 0.0..
) -> Float
InputTypeDefaultRange
pVectorPosition()
half_heightFloat1.0
bottom_radiusFloat1.0
top_radiusFloat0.0..
geometry ✓shader ✗compositor ✓

not in a shader tree: no Compare in a shader tree

sdf ellipsoid#

Ellipsoid of given semi-axes; approximate distance, exact on surface

geometry graph "sdf ellipsoid"(p: Vector = Position(), radii: Vector = (1.0, 0.6, 0.4)) -> Float
InputTypeDefaultRange
pVectorPosition()
radiiVector(1.0, 0.6, 0.4)
geometry ✓shader ✓compositor ✓

sdf octahedron#

Octahedron with vertices at distance size; approximate distance

geometry graph "sdf octahedron"(p: Vector = Position(), size: Float = 1.0) -> Float
InputTypeDefaultRange
pVectorPosition()
sizeFloat1.0
geometry ✓shader ✓compositor ✓

sdf circle#

Circle in the XY plane (2D: z ignored)

geometry graph "sdf circle"(p: Vector = Position(), radius: Float = 1.0) -> Float
InputTypeDefaultRange
pVectorPosition()
radiusFloat1.0
geometry ✓shader ✓compositor ✓

sdf rectangle#

Rectangle in the XY plane of given half-extents (2D: z ignored)

geometry graph "sdf rectangle"(p: Vector = Position(), "half size": Vector = (1.0, 0.5)) -> Float
InputTypeDefaultRange
pVectorPosition()
half_sizeVector(1.0, 0.5)
geometry ✓shader ✓compositor ✓

smooth subtraction#

Carves b out of a with rounded blend of given smoothness

geometry graph "smooth subtraction"(a: Float, b: Float, smoothness: Float = 0.1 in 0.0..) -> Float
InputTypeDefaultRange
aFloat
bFloat
smoothnessFloat0.10.0..
geometry ✓shader ✓compositor ✓

shell#

Shell of given thickness centered on surface

geometry graph shell(distance: Float, thickness: Float = 0.1 in 0.0..) -> Float
InputTypeDefaultRange
distanceFloat
thicknessFloat0.10.0..
geometry ✓shader ✓compositor ✓

repetition#

Repeats space: wraps p into its origin-centered cell

geometry graph repetition(p: Vector = Position(), cell: Vector = (1.0, 1.0, 1.0)) -> Vector
InputTypeDefaultRange
pVectorPosition()
cellVector(1.0, 1.0, 1.0)
geometry ✓shader ✓compositor ✓

twist#

Twists space around Z: strength radians per unit height

geometry graph twist(p: Vector = Position(), strength: Float = 1.0) -> Vector
InputTypeDefaultRange
pVectorPosition()
strengthFloat1.0
geometry ✓shader ✓compositor ✓

bend#

Bends space upward along X: strength radians per unit length

geometry graph bend(p: Vector = Position(), strength: Float = 0.5) -> Vector
InputTypeDefaultRange
pVectorPosition()
strengthFloat0.5
geometry ✓shader ✓compositor ✓

sdf normal#

SDF normal via finite differences: value at p, then at slightly offset x, y, and z

geometry graph "sdf normal"(d: Float, dx: Float, dy: Float, dz: Float) -> Vector
InputTypeDefaultRange
dFloat
dxFloat
dyFloat
dzFloat
geometry ✓shader ✓compositor ✓

Noise#

fbm#

Fractal noise: octave layers of increasing frequency and decreasing amplitude, roughly -1 to 1

geometry graph fbm(
    p: Vector = Position(),
    octaves: Int = 5 in 1..16,
    lacunarity: Float = 2.0,
    persistence: Float = 0.5 in 0.0..1.0
) -> Float
InputTypeDefaultRange
pVectorPosition()
octavesInt51..16
lacunarityFloat2.0
persistenceFloat0.50.0..1.0
geometry ✓shader ✓compositor ✓

ridge fbm#

Ridged fractal noise: sharp mountain ridges, roughly 0 to 1

geometry graph "ridge fbm"(
    p: Vector = Position(),
    octaves: Int = 5 in 1..16,
    lacunarity: Float = 2.0,
    persistence: Float = 0.5 in 0.0..1.0
) -> Float
InputTypeDefaultRange
pVectorPosition()
octavesInt51..16
lacunarityFloat2.0
persistenceFloat0.50.0..1.0
geometry ✓shader ✓compositor ✓

Random#

random direction#

Uniform random direction on the unit sphere

geometry graph "random direction"(id: Int = ID(), seed: Int) -> Vector
InputTypeDefaultRange
idIntID()
seedInt
geometry ✓shader ✗compositor ✓

not in a shader tree: unknown node 'RandomValue' in a shader tree; did you mean Value, StringToValue?

point in disk#

Uniform random point inside the XY unit disk

geometry graph "point in disk"(id: Int = ID(), seed: Int) -> Vector
InputTypeDefaultRange
idIntID()
seedInt
geometry ✓shader ✗compositor ✓

not in a shader tree: unknown node 'RandomValue' in a shader tree; did you mean Value, StringToValue?

Sampling#

fibonacci point#

Point at index from count points evenly distributed on the unit sphere

geometry graph "fibonacci point"(index: Int = Index(), count: Int = 100 in 1..) -> Vector
InputTypeDefaultRange
indexIntIndex()
countInt1001..
geometry ✓shader ✓compositor ✓

r2 sequence#

Point at index in the 2D R2 low-discrepancy sequence in [0, 1]²

geometry graph "r2 sequence"(index: Int = Index()) -> Vector
InputTypeDefaultRange
indexIntIndex()
geometry ✓shader ✓compositor ✓