Parameters
Name | Type | Description |
---|---|---|
t | f32 | Input parameter (0-1). |
Returns
f32value with back effect.
WGSL Code
fn backIn(t: f32) -> f32 {let s = 1.70158;let tt = clamp(t, 0.0, 1.0);return tt * tt * ((s + 1.0) * tt - s);}
Name | Type | Description |
---|---|---|
t | f32 | Input parameter (0-1). |
fn backIn(t: f32) -> f32 {let s = 1.70158;let tt = clamp(t, 0.0, 1.0);return tt * tt * ((s + 1.0) * tt - s);}
a cubic Bezier curve and returns both value and derivative.
ease-in function for smooth acceleration.
ease-out function for smooth deceleration.
ease-in-out function for smooth acceleration and deceleration.
ease-in function with oscillating motion.
ease-out function with oscillating motion.
ease-out function that overshoots before settling.
spring animation with configurable parameters.
A JavaScript library providing WGSL utility functions as strings for WebGPU shader development. Includes mathematical utilities, noise generation, signed distance fields, and color manipulation functions.
npm install wgsl-fns
import { backIn, getFns } from 'wgsl-fns'
getFns(['backIn'])