[][src]Crate noise_fn

Some simple noise functions and traits to allow easy integration with your own.

use noise_fn::{Seedable, NoiseDomain, Octaves, Simplex};
use sized_matrix::Vector;

let seed = 12345;

let octaves = Octaves::<_, 4>::new(Simplex::new(), 0.5, 0.5).seed(seed);

let value2D = octaves.noise(Vector::vector([1.2, -3.5]));
let value3D = octaves.noise(Vector::vector([1.2, -3.5, 2.8]));

To use this, add it as a dependency to your Cargo.toml:

[dependencies]
noise_fn = "^0.1.2"

Re-exports

pub use noise::Noise;
pub use noise::Seedable;
pub use noise::NoiseDomain;
pub use helpers::Config;

Modules

helpers
noise
perm_table

Structs

AddNoise

A noise function which sums two other noise functions.

Constant

A noise function returning a constant value.

Gradient

A noise function which returns a gradient.

HashNoise

Seeded pseudorandom values using a fast non-cryptographic hash function.

Octaves

A noise function formed by summing several octaves of another noise function.

ScaleNoise

A noise function which scales both the input and output values.

Simplex

A simplex noise function loosely based on Stefan Gustavson's open source implementation.

SumNoise

A noise function formed by summing an array of other noise functions.

ToFloat

Convert random uint values to floating point numbers in the range [0, 1).

WhiteNoise

Seeded pseudorandom bytes using a permutation table.