Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

math.smoothstep (procNode)

A smooth blend from 0 to 1 as x goes from edge0 to edge1, flat outside, element by element.

The smoothstep operation of the authoring surface, called through the Luau node on proc.fieldc.operators. Operands are numbers, vectors, Columns or Fields. When every operand is a plain number or vector the answer is the plain result, folded where the node cooks; otherwise the answer is a Field: a template over its operands that whatever reads it evaluates in one dispatch together with the chain around it. Nothing dispatches for this node alone. Over numbers and animated values the answer is an animated value: the operation at every time.

The blend is k * k * (3 - 2 * k) with k the share of the way x has gone, held to 0..1. With the two edges equal the answer steps from 0 to 1 at the edge.

Operands of different widths widen to the widest: a number applies to every component, and a shorter vector reads 0 for the components it lacks.

Inputs

  • edge0 (Value, default 0). The value below which the result is 0.
  • edge1 (Value, default 0). The value above which the result is 1.
  • x (Value, default 0). The value measured.

Outputs

  • value. The blend, 0 to 1.
local value = g.math.smoothstep(0, 1, 0.5) -- 0.5