Mirror of space-wizards/noise-rs
Find a file
Nick Whitney 5beca286b1
Merge pull request #193 from BenWiederhake/no-img
Make 'image' an optional dependency
2018-04-27 03:04:09 -04:00
benches Update formatting to current style 2018-01-11 23:28:28 -05:00
examples Make Transformers pass-by-ref 2018-03-24 01:02:23 -04:00
src Make 'image' an optional dependency 2018-04-27 08:07:46 +02:00
.gitattributes Add .gitattributes 2015-01-01 16:09:25 -05:00
.gitignore Remove old noise implementations 2017-06-21 09:27:24 -04:00
.travis.yml Extend Travis build matrix 2018-04-27 08:07:51 +02:00
Cargo.toml Make 'image' an optional dependency 2018-04-27 08:07:46 +02:00
LICENSE-APACHE Add MIT License and README sections 2017-04-26 22:07:45 -04:00
LICENSE-MIT Add MIT License and README sections 2017-04-26 22:07:45 -04:00
README.md Cleanup and updates before publish 2018-03-04 15:40:14 -05:00
rustfmt.toml Update formatting to current style 2018-01-11 23:28:28 -05:00

noise-rs

Build Status Documentation Crates.io

A procedural noise generation library for Rust.

Documentation

use noise::noise_fns::Fbm;

let fbm = Fbm::new();

let val = fbm.get([42.0, 37.0, 2.0]);

API

Gradient Noise

Gradient noise produces a smooth, continuous value over space. It's achieved by dividing space into regions, and placing a random gradient at each vertex, then blending between those gradients.

Perlin noise

A very fast and reasonable quality gradient noise:

  • Perlin::new()

OpenSimplex noise

A slower but higher quality form of gradient noise:

  • OpenSimplex::new()

Value Noise

Value noise (sometimes mistaken with gradient noise) produces lower quality smooth noise. It exhibits pronounced grid artifacts, but can be slightly faster than gradient noise. Benchmarks show it's about 1.21.3× faster than Perlin noise.

Cell neighbours are blended using a weighted S-curve linear interpolation method. This removes any discontinuities across grid edges.

  • Value::new()

Fractional Brownian Motion

A way of combining multiple octaves of a noise function to create a richer and more varied output:

  • Fbm::new()

Worley Noise

Named after Steven Worley, and also called Voronoi noise, is based on dividing space into cells based on proximity to a random set of seed points.

  • Worley::new()

Noise Functions

These are the actual noise functions, which just take a coordinate using get() and return a value. They can be chained together when declared, creating very complex noise results.

See the individual function pages for their descriptions, and the examples for their usage.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.