| Crates.io | noise-functions |
| lib.rs | noise-functions |
| version | 0.8.2 |
| created_at | 2024-04-26 00:24:16.259518+00 |
| updated_at | 2026-01-02 19:57:32.888101+00 |
| description | A collection of fast and lightweight noise functions. |
| homepage | |
| repository | https://github.com/bluurryy/noise-functions |
| max_upload_size | |
| id | 1220832 |
| size | 1,187,240 |
A collection of fast and lightweight noise functions.
Check out the live demo and node editor (experimental)!
Click on the images to view the code that created them.
std (enabled by default) — Uses floating point functions from the standard library.alloc (enabled by default) — Adds trait implementations for boxed trait objects.libm — Uses libm for floating point functions. Required for no_std.nightly-simd — Adds support for sampling with simd types.
Some of the noise algorithms have optimized implementations for simd that can be faster than the scalar versions.
Currently those are the 2d and 3d implementations of Perlin, Cell* and Value* noises.Noise libraries like noise or libnoise create a permutation table at runtime for each instance of Perlin and the like. This library uses static permutation tables / hashing instead. As such, there is no need to store and reuse noise structs for the sake of efficiency. There is no downside to writing code like this:
fn my_noise(point: Vec2) -> f32 {
Perlin.fbm(3, 0.5, 2.0).seed(42).frequency(3.0).sample2(point)
}
[!NOTE] This library uses
f32instead off64.
fastnoise-lite?fastnoise-lite provides its noise generation via a big struct that you are to mutate to get the noise you want. If you already know what noise you want or you want to compose multiple noises in a custom way then this design is less efficient and less convenient. There is the noise-functions-config crate that provides a similar configurable struct (the demo is powered by it). It opts to return a trait object like Box<dyn Sample<2>> instead of branching on each sample call.
Licensed under either of:
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.