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§
Sourcefn seed(self, seed: i32) -> Seeded<Self>where
Self: Sized,
fn seed(self, seed: i32) -> Seeded<Self>where
Self: Sized,
Sets a seed to be sampled with.
This requires a noise that implements SampleWithSeed
.
Sourcefn frequency(self, frequency: f32) -> Frequency<Self>where
Self: Sized,
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.
Sourcefn fbm(self, octaves: u32, gain: f32, lacunarity: f32) -> Fbm<Self>where
Self: Sized,
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.
Sourcefn ridged(self) -> Ridged<Self>where
Self: Sized,
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.
Sourcefn triangle_wave(self, frequency: f32) -> TriangleWave<Self>where
Self: Sized,
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.