Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl.Vector/llms.txt
Use this file to discover all available pages before exploring further.
Noise (in Prowl.Vector) is a static partial class providing GLSL-ported noise functions for procedural content generation. It covers four distinct noise families — Simplex, Classic Perlin, Periodic Simplex, and Cellular/Worley — spanning 2D, 3D, and 4D inputs, all returning float values in approximately [−1, 1] unless noted otherwise.
All noise functions are ported from Stefan Gustavson’s GLSL noise shaders and are released under the MIT license. Source: https://github.com/stegu/webgl-noise
Simplex Noise (SNoise)
Simplex noise is a modern replacement for Classic Perlin noise. It uses fewer arithmetic operations, has lower computational complexity in higher dimensions, and produces smooth, isotropic results with no obvious directional artefacts.
Output range: approximately [−1, 1].
Overloads
| Signature | Input | Description |
|---|---|---|
SNoise(Float2 v) | 2D | Standard 2D simplex noise. |
SNoise(Float3 v) | 3D | Standard 3D simplex noise. |
SNoise(Float4 v) | 4D | Standard 4D simplex noise (higher quality, useful for animated 3D noise via a time w component). |
Example — 2D heightmap
Example — Animated 3D noise using 4D
Classic Perlin Noise (CNoise)
Classic Perlin noise uses a grid-based gradient scheme with quintic interpolation. It produces smooth, band-limited noise with a characteristic look suited to cloud, marble, and wood textures.
Output range: approximately [−1, 1].
Overloads
| Signature | Input | Description |
|---|---|---|
CNoise(Float2 P) | 2D | Classic 2D Perlin noise. |
CNoise(Float3 P) | 3D | Classic 3D Perlin noise. |
CNoise(Float4 P) | 4D | Classic 4D Perlin noise. |
Example
Periodic Perlin Noise (PNoise)
Periodic variants of Classic Perlin noise that tile seamlessly. A rep parameter specifies the repetition period along each axis. Use this whenever you need a tileable texture or a looping animation.
Output range: approximately [−1, 1].
Overloads
| Signature | Input | Description |
|---|---|---|
PNoise(Float2 P, Float2 rep) | 2D | Tileable 2D Perlin noise. rep is the period per axis. |
PNoise(Float3 P, Float3 rep) | 3D | Tileable 3D Perlin noise. |
PNoise(Float4 P, Float4 rep) | 4D | Tileable 4D Perlin noise. |
Example — Tiling terrain texture
Cellular / Worley Noise
Cellular noise (also called Worley noise) works by scattering feature points and measuring the distance from any query point to the nearest two feature points (F1 and F2). It produces characteristic Voronoi-cell patterns useful for stone, skin, scales, and organic surfaces. All cellular functions return aFloat2 whose components are:
.X— F1: distance to the nearest feature point..Y— F2: distance to the second-nearest feature point.
Overloads
| Signature | Return | Description |
|---|---|---|
Cellular2D(Float2 P) | Float2 | Full-quality 2D cellular noise (3×3 search window). |
Cellular3D(Float3 P) | Float2 | Full-quality 3D cellular noise. |
Example
Periodic Simplex Noise (Psrd_*)
The Psrd_* family provides 2D simplex noise on a hexagonal grid with support for both tiling (periodic) and non-tiling variants, rotating gradients, and analytical derivatives. These are higher-quality options than plain SNoise when you need tileability or gradient information simultaneously.
Overloads
| Signature | Tiles | Returns Gradient | Description |
|---|---|---|---|
Psrd_PSRDNoise(Float2 pos, Float2 per, float rot) | ✅ | ✅ | Tiling simplex noise with rotating gradients. Returns Float3(noise, dX, dY). |
Psrd_PSDNoise(Float2 pos, Float2 per) | ✅ | ✅ | Wrapper for Psrd_PSRDNoise with rot = 0. Returns Float3(noise, dX, dY). |
Psrd_PSRNoise(Float2 pos, Float2 per, float rot) | ✅ | ❌ | Tiling simplex with rotating gradients, scalar output only. |
Psrd_PSNoise(Float2 pos, Float2 per) | ✅ | ❌ | Wrapper for Psrd_PSRNoise with rot = 0. |
Psrd_SRDNoise(Float2 pos, float rot) | ❌ | ✅ | Non-tiling simplex with rotating gradients. Returns Float3(noise, dX, dY). |
Psrd_SDNoise(Float2 pos) | ❌ | ✅ | Wrapper for Psrd_SRDNoise with rot = 0. |
SRNoise(Float2 pos, float rot) | ❌ | ❌ | Non-tiling simplex with rotating gradients, scalar only. |
Psrd_SNoise(Float2 pos) | ❌ | ❌ | Wrapper for SRNoise with rot = 0. |
Float3 return from derivative-enabled variants packs (noiseValue, dNoise/dX, dNoise/dY).
Example — Tiling noise with gradient
Usage Patterns
Octave Noise (Fractal Brownian Motion — FBM)
Octave Noise (Fractal Brownian Motion — FBM)
Summing multiple octaves of noise at increasing frequency and decreasing amplitude creates fractal-like detail — the foundation of terrain, clouds, and fire effects.
Domain Warping
Domain Warping
Domain warping distorts the input coordinates of one noise call using the output of another, creating swirling, flowing patterns.
Tiling Heightmaps
Tiling Heightmaps
Use
PNoise or the Psrd_PSNoise family whenever a texture must tile seamlessly — for terrain chunks, repeating wall materials, or looping animations.Cellular Voronoi Patterns
Cellular Voronoi Patterns
Combine F1 and F2 in different ways to produce a wide variety of organic surfaces.