-
Notifications
You must be signed in to change notification settings - Fork 0
noise
github-actions[bot] edited this page Feb 12, 2026
·
1 revision
Procedural noise generation with Perlin and Voronoi noise in 2D and 3D.
Noise functions are essential for procedural terrain, texture generation, particle effects, cloud rendering, and organic-looking randomness.
Classic gradient noise that produces smooth, continuous values.
| Function | Description |
|---|---|
lm2_perlin2_f32(x, y) |
2D Perlin noise |
lm2_perlin3_f32(x, y, z) |
3D Perlin noise |
Returns: Value in [-1, 1].
Cell-based noise returning the Euclidean distance to the nearest feature point.
| Function | Description |
|---|---|
lm2_voronoi2_f32(x, y) |
2D Voronoi noise |
lm2_voronoi3_f32(x, y, z) |
3D Voronoi noise |
Returns: Euclidean distance to nearest feature point.
All functions also available in _f64 variants.
// Generate a terrain heightmap
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
float h = lm2_perlin2_f32(x * 0.01f, y * 0.01f);
heightmap[y * width + x] = h;
}
}