smoothstep
On this page

smoothstep()

Function in Builtins

smoothstep(e0, e1, x): Hermite interpolation from 0 at x = e0 to 1 at x = e1, component-wise.

import { smoothstep } from 'typeshade/core/ir'

This export returns an IR node. A "use typeshade" file calls the builtin itself: smoothstep()

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

Syntax

function smoothstep<K extends `vec${number}<f32>`>(
e0: ReadonlyNode<K>,
e1: ReadonlyNode<K>,
x: ReadonlyNode<K>,
): Node<K>;
function smoothstep(
e0: ReadonlyNode<'f32'> | number,
e1: ReadonlyNode<'f32'> | number,
x: ReadonlyNode<'f32'> | number,
): Node<'f32'>;

Parameters

e0 ReadonlyNode<K>
e1 ReadonlyNode<K>
x ReadonlyNode<K>

Return value

Node<K>

Description

WGSL requires all three arguments to have the same type, scalar or vector. The vector overload keeps the key of x; the scalar overload takes f32 nodes or JS numbers.

Targets

TargetSupportNotes
WGSL (WebGPU) Supported

smoothstep(e0, e1, x).

GLSL ES 3.00 (WebGL2) Supported

smoothstep(e0, e1, x).

CPU oracle Supported

Evaluated in f64 by the oracle.

See also

Source

src/core/ir/node.ts, line 1523, at commit af54ddad5

Edit this page Report a problem