step

A hard edge: 0 when x is below edge, 1 from edge on.

step(edge: Val, x: Val): Expr

Import math from shaders/std and use math.step.

Parameters

NameTypeNotes
edgeVal
xVal

Example

const lit = step(params.uniforms.threshold, brightness)

See also

  • smoothstep — A soft edge: 0 below e0, 1 above e1, an S-curve between.

Used by

Sparkle, Waveform