noise_functions

Trait Noise

Source
pub trait Noise {
    // Provided methods
    fn seed(self, seed: i32) -> Seeded<Self>
       where Self: Sized { ... }
    fn frequency(self, frequency: f32) -> Frequency<Self>
       where Self: Sized { ... }
    fn fbm(self, octaves: u32, gain: f32, lacunarity: f32) -> Fbm<Self>
       where Self: Sized { ... }
    fn ridged(self) -> Ridged<Self>
       where Self: Sized { ... }
    fn triangle_wave(self, frequency: f32) -> TriangleWave<Self>
       where Self: Sized { ... }
    fn tileable(self, width: f32, height: f32) -> Tileable<Self>
       where Self: Sized { ... }
    fn mul_seed(self, value: i32) -> MulSeed<Self>
       where Self: Sized { ... }
}
Expand description

Provides modifier methods for noise types.

Provided Methods§

Source

fn seed(self, seed: i32) -> Seeded<Self>
where Self: Sized,

Sets a seed to be sampled with.

This requires a noise that implements SampleWithSeed.

Source

fn frequency(self, frequency: f32) -> Frequency<Self>
where Self: Sized,

Modifies a noise with a frequency multiplier.

This multiplies the point by the provided frequency before sampling.

Source

fn fbm(self, octaves: u32, gain: f32, lacunarity: f32) -> Fbm<Self>
where Self: Sized,

Creates a fractal from this noise with the provided octaves, gain and lacunarity.

The seed, with which the fractal is sampled with, will be incremented after each octave.

Source

fn ridged(self) -> Ridged<Self>
where Self: Sized,

Modifies a noise to create a peak at 0.

This outputs values is in the [-1, 1] range.

Note: This modifier assumes the base noise returns values in the [-1, 1] range.

Source

fn triangle_wave(self, frequency: f32) -> TriangleWave<Self>
where Self: Sized,

Applies a triangle wave to the output of a base noise function.

This outputs values is in the [-1, 1] range.

Note: This modifier assumes the base noise returns values in the [-1, 1] range.

Source

fn tileable(self, width: f32, height: f32) -> Tileable<Self>
where Self: Sized,

Creates a tileable 2D noise from a 4D noise.

The parameters width and height describe the size of the repeating tile.

Source

fn mul_seed(self, value: i32) -> MulSeed<Self>
where Self: Sized,

Multiplies the seed by value.

Implementations on Foreign Types§

Source§

impl<N: Noise> Noise for &N

Implementors§

Source§

impl Noise for CellDistance

Source§

impl Noise for CellDistanceSq

Source§

impl Noise for CellValue

Source§

impl Noise for OpenSimplex2

Source§

impl Noise for OpenSimplex2s

Source§

impl Noise for Perlin

Source§

impl Noise for Simplex

Source§

impl Noise for Value

Source§

impl Noise for ValueCubic

Source§

impl<F, const WITH_SEED: bool> Noise for NoiseFn<F, WITH_SEED>

Source§

impl<Fractal> Noise for Weighted<Fractal>

Source§

impl<N> Noise for Improve2X<N>

Source§

impl<N> Noise for Improve3Xy<N>

Source§

impl<N> Noise for Improve3Xz<N>

Source§

impl<N> Noise for Improve4XyZw<N>

Source§

impl<N> Noise for Improve4Xyz<N>

Source§

impl<N> Noise for Improve4XyzXy<N>

Source§

impl<N> Noise for Improve4XyzXz<N>

Source§

impl<N> Noise for Fbm<N>

Source§

impl<N> Noise for Frequency<N>

Source§

impl<N> Noise for MulSeed<N>

Source§

impl<N> Noise for Ridged<N>

Source§

impl<N> Noise for Seeded<N>

Source§

impl<N> Noise for Tileable<N>

Source§

impl<N> Noise for TriangleWave<N>