min

The smaller of two values.

min(a: Val, b: Val): Expr

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

Parameters

NameTypeNotes
aVal
bVal

Example

const capped = min(brightness, 1)

See also

  • max — The larger of two values.
  • clamp — The value limited to the range lo..hi.

Used by

CarbonFiber, Chrome, Goo, Heatmap, Hologram, ReactionDiffusion, Sparkle