math
Mathematical toolkit for Geometry Nodes: shaping curves, waves, vectors, SDFs, and noise distributions
| Targets | blender-compositor, blender-geometry, blender-gp |
|---|---|
| Version | 0.13.1 (edition 2026) |
| Depends on | — |
| Import | use math or use math (name, …) |
| Source | stdlib/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.
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
| Input | Type | Default | Range |
|---|---|---|---|
x | Float | ||
force | Float | 0.25 | 0.001..0.999 |
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
| Input | Type | Default | Range |
|---|---|---|---|
x | Float | ||
contrast | Float | 0.25 | 0.001..0.999 |
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
| Input | Type | Default | Range |
|---|---|---|---|
t | Float | ||
power | Float | 2.0 | 0.0.. |
ease out#
Ends slowly: inverse of ease in
geometry graph "ease out"(t: Float, power: Float = 2.0 in 0.0..) -> Float
| Input | Type | Default | Range |
|---|---|---|---|
t | Float | ||
power | Float | 2.0 | 0.0.. |
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
| Input | Type | Default | Range |
|---|---|---|---|
t | Float | ||
power | Float | 2.0 | 0.0.. |
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
| Input | Type | Default | Range |
|---|---|---|---|
x | Float | ||
stiffness | Float | 4.0 |
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
| Input | Type | Default | Range |
|---|---|---|---|
x | Float | ||
center | Float | 0.5 | |
half_width | Float | 0.25 | 0.0001.. |
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
| Input | Type | Default | Range |
|---|---|---|---|
x | Float | ||
sharpness | Float | 1.0 | 0.0.. |
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
| Input | Type | Default | Range |
|---|---|---|---|
x | Float | ||
rise | Float | 0.25 | 0.0001..1.0 |
bounce#
Falls and bounces three times before settling at 1: a ball
geometry graph bounce(t: Float) -> Float
| Input | Type | Default | Range |
|---|---|---|---|
t | Float |
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
| Input | Type | Default | Range |
|---|---|---|---|
t | Float |
recoil#
Pulls back before advancing: force 1.70158 recoils by 10%
geometry graph recoil(t: Float, force: Float = 1.70158) -> Float
| Input | Type | Default | Range |
|---|---|---|---|
t | Float | ||
force | Float | 1.70158 |
Waves of period 1#
triangle#
Triangle wave: 0 at integers, 1 at midpoints
geometry graph triangle(x: Float) -> Float
| Input | Type | Default | Range |
|---|---|---|---|
x | Float |
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
| Input | Type | Default | Range |
|---|---|---|---|
x | Float | ||
duty_cycle | Float | 0.5 | 0.0..1.0 |
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
| Input | Type | Default | Range |
|---|---|---|---|
x | Float |
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
| Input | Type | Default | Range |
|---|---|---|---|
v | Vector | ||
normal | Vector | (0.0, 0.0, 1.0) |
perpendicular#
Unit vector perpendicular to v
geometry graph perpendicular(v: Vector) -> Vector
| Input | Type | Default | Range |
|---|---|---|---|
v | Vector |
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
| Input | Type | Default | Range |
|---|---|---|---|
v | Vector |
min component#
Smallest of the three vector components
geometry graph "min component"(v: Vector) -> Float
| Input | Type | Default | Range |
|---|---|---|---|
v | Vector |
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)
| Input | Type | Default | Range |
|---|---|---|---|
p | Vector | Position() | |
a | Vector | ||
b | Vector | (0.0, 0.0, 1.0) |
Angles, in radians#
wrap angle#
Wraps an angle into [-π, π]
geometry graph "wrap angle"(angle: Float) -> Float
| Input | Type | Default | Range |
|---|---|---|---|
angle | Float |
angle between#
Angle between two vectors, from 0 to π, accurate even for nearly parallel vectors
geometry graph "angle between"(u: Vector, v: Vector) -> Float
| Input | Type | Default | Range |
|---|---|---|---|
u | Vector | ||
v | Vector |
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
| Input | Type | Default | Range |
|---|---|---|---|
u | Vector | ||
v | Vector | ||
axis | Vector | (0.0, 0.0, 1.0) |
Colors#
luminance#
Color luminance (Rec. 709): perceived brightness
geometry graph luminance(color: Color) -> Float
| Input | Type | Default | Range |
|---|---|---|---|
color | Color |
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
| Input | Type | Default | Range |
|---|---|---|---|
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) |
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
| Input | Type | Default | Range |
|---|---|---|---|
p | Vector | Position() | |
radius | Float | 1.0 |
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
| Input | Type | Default | Range |
|---|---|---|---|
p | Vector | Position() | |
half_size | Vector | (1.0, 1.0, 1.0) |
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
| Input | Type | Default | Range |
|---|---|---|---|
p | Vector | Position() | |
major_radius | Float | 1.0 | |
minor_radius | Float | 0.25 |
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
| Input | Type | Default | Range |
|---|---|---|---|
p | Vector | Position() | |
radius | Float | 1.0 | |
half_height | Float | 1.0 |
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
| Input | Type | Default | Range |
|---|---|---|---|
p | Vector | Position() | |
a | Vector | ||
b | Vector | (0.0, 0.0, 1.0) | |
radius | Float | 0.25 |
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
| Input | Type | Default | Range |
|---|---|---|---|
p | Vector | Position() | |
half_height | Float | 1.0 | |
bottom_radius | Float | 1.0 | |
top_radius | Float | 0.0.. |
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
| Input | Type | Default | Range |
|---|---|---|---|
p | Vector | Position() | |
radii | Vector | (1.0, 0.6, 0.4) |
sdf octahedron#
Octahedron with vertices at distance size; approximate distance
geometry graph "sdf octahedron"(p: Vector = Position(), size: Float = 1.0) -> Float
| Input | Type | Default | Range |
|---|---|---|---|
p | Vector | Position() | |
size | Float | 1.0 |
sdf circle#
Circle in the XY plane (2D: z ignored)
geometry graph "sdf circle"(p: Vector = Position(), radius: Float = 1.0) -> Float
| Input | Type | Default | Range |
|---|---|---|---|
p | Vector | Position() | |
radius | Float | 1.0 |
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
| Input | Type | Default | Range |
|---|---|---|---|
p | Vector | Position() | |
half_size | Vector | (1.0, 0.5) |
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
| Input | Type | Default | Range |
|---|---|---|---|
a | Float | ||
b | Float | ||
smoothness | Float | 0.1 | 0.0.. |
shell#
Shell of given thickness centered on surface
geometry graph shell(distance: Float, thickness: Float = 0.1 in 0.0..) -> Float
| Input | Type | Default | Range |
|---|---|---|---|
distance | Float | ||
thickness | Float | 0.1 | 0.0.. |
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
| Input | Type | Default | Range |
|---|---|---|---|
p | Vector | Position() | |
cell | Vector | (1.0, 1.0, 1.0) |
twist#
Twists space around Z: strength radians per unit height
geometry graph twist(p: Vector = Position(), strength: Float = 1.0) -> Vector
| Input | Type | Default | Range |
|---|---|---|---|
p | Vector | Position() | |
strength | Float | 1.0 |
bend#
Bends space upward along X: strength radians per unit length
geometry graph bend(p: Vector = Position(), strength: Float = 0.5) -> Vector
| Input | Type | Default | Range |
|---|---|---|---|
p | Vector | Position() | |
strength | Float | 0.5 |
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
| Input | Type | Default | Range |
|---|---|---|---|
d | Float | ||
dx | Float | ||
dy | Float | ||
dz | Float |
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
| Input | Type | Default | Range |
|---|---|---|---|
p | Vector | Position() | |
octaves | Int | 5 | 1..16 |
lacunarity | Float | 2.0 | |
persistence | Float | 0.5 | 0.0..1.0 |
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
| Input | Type | Default | Range |
|---|---|---|---|
p | Vector | Position() | |
octaves | Int | 5 | 1..16 |
lacunarity | Float | 2.0 | |
persistence | Float | 0.5 | 0.0..1.0 |
Random#
random direction#
Uniform random direction on the unit sphere
geometry graph "random direction"(id: Int = ID(), seed: Int) -> Vector
| Input | Type | Default | Range |
|---|---|---|---|
id | Int | ID() | |
seed | Int |
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
| Input | Type | Default | Range |
|---|---|---|---|
id | Int | ID() | |
seed | Int |
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
| Input | Type | Default | Range |
|---|---|---|---|
index | Int | Index() | |
count | Int | 100 | 1.. |
r2 sequence#
Point at index in the 2D R2 low-discrepancy sequence in [0, 1]²
geometry graph "r2 sequence"(index: Int = Index()) -> Vector
| Input | Type | Default | Range |
|---|---|---|---|
index | Int | Index() |