Crates.io | noise-functions |
lib.rs | noise-functions |
version | |
source | src |
created_at | 2024-04-26 00:24:16.259518 |
updated_at | 2024-11-29 23:49:30.381459 |
description | Fast and lightweight noise functions. |
homepage | |
repository | https://github.com/bluurryy/noise-functions |
max_upload_size | |
id | 1220832 |
Cargo.toml error: | TOML parse error at line 25, column 1 | 25 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Fast and lightweight noise algorithm implementations.
Check out the live demo!
The implementation of these noise functions are from FastNoiseLite.
noise
or libnoise
?With noise
, constructing a noise struct like Perlin
creates a permutation table at runtime. So to use the noise efficiently, you need to keep that instance of Perlin
around.
With noise-functions
, Perlin
and friends don't carry any state. This makes noise algorithms easier to use efficiently.
For example, you can use the noise algorithms without having to carry around state, without sacrificing performance:
fn my_noise(point: Vec2) -> f32 {
Perlin.fbm(3, 0.5, 2.0).seed(42).frequency(3.0).sample2(point)
}
Pros: noise
has more noise functions, more dimensions for noise functions and more noise combinators.
Difference: noise
uses f64
instead of f32
.
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 this api is inconvenient and inefficient. There is the noise-functions-config
crate that provides a similar api if you need it.
Pros: fastnoise-lite
provides more cellular noise variations and has domain warping built into the config struct.