Parameters
Name | Type | Description |
---|---|---|
x | vec4<f32> | Input 4D vector. |
Returns
Dependencies
WGSL Code
//! requires mod289fn perm4(x: vec4f) -> vec4f {return mod289(((x * 34.) + 1.) * x);}
Name | Type | Description |
---|---|---|
x | vec4<f32> | Input 4D vector. |
//! requires mod289fn perm4(x: vec4f) -> vec4f {return mod289(((x * 34.) + 1.) * x);}
a 2D hash from a 2D input vector for procedural generation.
2D Perlin-style noise for procedural textures and patterns.
Brownian Motion - combines multiple octaves of noise for complex patterns.
Brownian Motion - combines multiple octaves of noise for complex patterns.
a 1D hash value from an input value for noise generation.
a 1D hash value from a 3D input vector.
a 3D hash vector from a 3D input for displacement effects.
3D noise using trilinear interpolation.
3D warping noise using fractal Brownian motion.
and fast integer hash using PCG algorithm.
PCG hash function for fast procedural generation.
PCG hash function for volumetric procedural generation.
PCG hash function for advanced procedural generation.
integer hash using xxHash algorithm.
xxHash for strong integer hashing in 2D.
xxHash for strong integer hashing in 3D.
xxHash for strong integer hashing in 4D.
float from 1D input using sine (platform dependent).
float from 2D input using sine (platform dependent).
1D value noise using random interpolation.
2D value noise using smooth interpolation.
289 operation for Perlin noise.
value noise using permutation tables.
Perlin noise implementation.
Perlin noise implementation.
simplex noise implementation for efficient 2D procedural generation.
simplex noise implementation for volumetric procedural generation.
simplex noise implementation for high-quality procedural generation.
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 { perm4, getFns } from 'wgsl-fns'
getFns(['perm4'])