---
title: "smoothstep(): IR builder function in typeshade/core/ir"
description: "smoothstep, an IR builder function in typeshade/core/ir. smoothstep(e0, e1, x): Hermite interpolation from 0 at x = e0 to 1 at x = e1, component-wise."
url: https://typeshade.dev/api/smoothstep/
language: en
---

# `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()`](https://typeshade.dev/reference/functions/smoothstep/)

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

## Syntax

```ts
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

| Target | Support | Notes |
| --- | --- | --- |
| 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

- [`smoothstep()`](https://typeshade.dev/reference/functions/smoothstep/)

## Source

[`src/core/ir/node.ts`, line 1523](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L1523), at commit af54ddad5
