Relocate the ~6k-file docs tree from the repo root into plugins/document-navigator/docs/ so the plugin is self-contained and portable. docs/superpowers/ (specs and plans) stays at the repo root. Moved via cp+rm rather than git mv because directory rename() fails with EPERM on this WSL /mnt DrvFs mount; git rename-detection pairs the identical-content files at commit time. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
8.5 KiB
@suaveplan/noise - Seeded spatial noise fields: Perlin, Simplex, Value, Worley, fBm and Blue-noise sampling for procedural generation
Summary
Seeded spatial noise fields for procedural content generation. Provides six field types — Perlin, Simplex (2D/3D/4D), Value, Worley/cellular (F1/F2/F2-F1 modes), fBm (fractal Brownian motion compositor), and Poisson-disk Blue noise sampling — all seeded with Sfc32Rng for byte-identical, reproducible output. Every generator is available as both a functional API and a stateful class. Use this package for terrain heightmaps, texture generation, cloud simulation, vegetation scattering, and any procedural system that needs spatially-coherent randomness. For non-spatial random values (UUIDs, shuffles, distributions) use @suaveplan/random; for seeded integer/float sequences use @suaveplan/pseudo-random.
Documentation tree
- blue — (no submodules)
- blue — (no submodules)
- errors — (no submodules)
- noise-error — (no submodules)
- fbm — (no submodules)
- fbm — (no submodules)
- perlin — (no submodules)
- perlin — (no submodules)
- simplex — (no submodules)
- simplex — (no submodules)
- utils — (no submodules)
- permutation — (no submodules)
- value — (no submodules)
- value — (no submodules)
- worley — (no submodules)
- worley — (no submodules)
Install
bun add @suaveplan/noise
Features
- Perlin noise —
perlin2/perlin3(functional) +PerlinNoise(class) - Simplex noise —
simplex2/simplex3/simplex4+SimplexNoise - Value noise —
value2/value3+ValueNoise - Worley/cellular noise —
worley2/worley3withF1/F2/F2-F1modes - fBm compositor —
fbm2/fbm3wrap any base field into a multi-octave sum - Blue noise sampler —
blueNoiseSamplevia Bridson's Poisson-disk algorithm - Every field is seeded with
Sfc32Rng— byte-identical output for equal seeds - Zod schemas for every option bundle
Quick start
import { PerlinNoise, fbm2, blueNoiseSample } from "@suaveplan/noise";
const p = new PerlinNoise("terrain");
const height = fbm2((x, y) => p.noise2(x, y), 10, 20, { octaves: 6 });
const trees = blueNoiseSample({ width: 512, height: 512, radius: 16, seed: 1 });
Subpath exports
@suaveplan/noise/perlin@suaveplan/noise/simplex@suaveplan/noise/value@suaveplan/noise/worley@suaveplan/noise/fbm@suaveplan/noise/blue@suaveplan/noise/errors
Module docs
See the co-located .md next to each implementation.