floor

The value rounded down to a whole number.

floor(x: Val): Expr

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

Gives the cell index when you tile a coordinate.

Parameters

NameTypeNotes
xVal

Example

const column = floor(mul(uv.member('x'), params.uniforms.columns))

See also

  • fract — The fractional part of a value, 0..1.
  • ceil — The value rounded up to a whole number.

Used by

CarbonFiber, CompressionArtifacts, Crystal, Waveform