Builtin Library
- ..
- README.md711 B
- module.wgsl4.6 KB
README.md
luau_noise
The Perlin noise of Luau's math.noise, for a field chain's kernel: zero_luau_noise(x, y, z) answers what
math.noise(x, y, z) answers on the CPU, from the same permutation table (ZERO_LUAU_NOISE_HASH) and gradient
table (ZERO_LUAU_NOISE_GRADIENT). The value is about -1 to 1, 0 at every whole-number point, and repeats every 256
units in each axis; the coordinates are wrapped into that period first.
#include "@builtin::systems.procgen.kernels.luau_noise"
fn ripple(p: vec3<f32>) -> f32 { return zero_luau_noise(p.x, p.y, p.z); }
The math.noise node of nodes/math.nodebox (the noise operation of proc.fieldc.operators) includes this module
in the chain it writes.