max

The larger of two values.

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

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

Parameters

NameTypeNotes
aVal
bVal

Example

const safeRadius = max(params.uniforms.radius, 0.001)

See also

  • min — The smaller of two values.
  • clamp — The value limited to the range lo..hi.

Used by

Aurora, Chrome, Crystal, FlowingGradient, Frost, Goo, Heatmap, Hologram, InkFlow, Irradiance, Marble, MeshGradient, Plastic, Prism, ReactionDiffusion, Sparkle, StudioBackground, TimeTrail, Voxels, Waveform