Generates Perlin noise in 1D/2D/3D with configurable fractal parameters.
More...
#include <spk_perlin.hpp>
|
| | Perlin (unsigned int p_seed=0, Perlin::Interpolation p_interp=Perlin::Interpolation::SmoothStep) |
| | Constructs a Perlin generator with optional seed and interpolation.
|
| void | setInterpolation (Interpolation p_interp) |
| | Sets the interpolation curve.
|
| void | setSeed (unsigned int p_seed) |
| | Reseeds the permutation table.
|
| void | setOctaves (int p_oct) |
| | Sets octave count for fractal noise.
|
| void | setPersistence (float p_p) |
| | Sets amplitude persistence between octaves.
|
| void | setLacunarity (float p_l) |
| | Sets frequency multiplier per octave.
|
| void | setFrequency (float p_f) |
| | Sets base frequency.
|
| const int & | octaves () const |
| | Returns octave count.
|
| const float & | persistence () const |
| | Returns persistence.
|
| const float & | lacunarity () const |
| | Returns lacunarity.
|
| const float & | frequency () const |
| | Returns base frequency.
|
| float | sample1D (float p_x, float p_min=0, float p_max=1) const |
| | Samples 1D fractal noise.
|
| float | sample2D (float p_x, float p_y, float p_min=0, float p_max=1) const |
| | Samples 2D fractal noise.
|
| float | sample3D (float p_x, float p_y, float p_z, float p_min=0, float p_max=1) const |
| | Samples 3D fractal noise.
|
Generates Perlin noise in 1D/2D/3D with configurable fractal parameters.
float v = noise.sample2D(1.2f, 3.4f, -1.f, 1.f);
Generates Perlin noise in 1D/2D/3D with configurable fractal parameters.
Definition spk_perlin.hpp:20
◆ Interpolation
Selects smoothing curve applied between lattice points.
| Enumerator |
|---|
| Linear | Simple linear blending.
|
| SmoothStep | SmoothStep easing for softer transitions.
|
◆ Perlin()
Constructs a Perlin generator with optional seed and interpolation.
- Parameters
-
| p_seed | Random seed used for the permutation table. |
| p_interp | Interpolation mode used between lattice points. |
◆ frequency()
| const float & spk::Perlin::frequency |
( |
| ) |
const |
Returns base frequency.
- Returns
- Reference to the base frequency.
◆ lacunarity()
| const float & spk::Perlin::lacunarity |
( |
| ) |
const |
Returns lacunarity.
- Returns
- Reference to the lacunarity factor.
◆ octaves()
| const int & spk::Perlin::octaves |
( |
| ) |
const |
Returns octave count.
Returns octave count.
- Returns
- Reference to the configured octave count.
◆ persistence()
| const float & spk::Perlin::persistence |
( |
| ) |
const |
Returns persistence.
- Returns
- Reference to the persistence factor.
◆ sample1D()
| float spk::Perlin::sample1D |
( |
float | p_x, |
|
|
float | p_min = 0, |
|
|
float | p_max = 1 ) const |
Samples 1D fractal noise.
- Parameters
-
| p_x | Position. |
| p_min | Output min range. |
| p_max | Output max range. |
- Returns
- Noise value clamped to [p_min, p_max].
◆ sample2D()
| float spk::Perlin::sample2D |
( |
float | p_x, |
|
|
float | p_y, |
|
|
float | p_min = 0, |
|
|
float | p_max = 1 ) const |
Samples 2D fractal noise.
- Parameters
-
| p_x | X position. |
| p_y | Y position. |
| p_min | Output min range. |
| p_max | Output max range. |
- Returns
- Noise value clamped to [p_min, p_max].
◆ sample3D()
| float spk::Perlin::sample3D |
( |
float | p_x, |
|
|
float | p_y, |
|
|
float | p_z, |
|
|
float | p_min = 0, |
|
|
float | p_max = 1 ) const |
Samples 3D fractal noise.
- Parameters
-
| p_x | X position. |
| p_y | Y position. |
| p_z | Z position. |
| p_min | Output min range. |
| p_max | Output max range. |
- Returns
- Noise value clamped to [p_min, p_max].
◆ setFrequency()
| void spk::Perlin::setFrequency |
( |
float | p_f | ) |
|
Sets base frequency.
- Parameters
-
◆ setInterpolation()
Sets the interpolation curve.
- Parameters
-
| p_interp | Linear or SmoothStep. |
◆ setLacunarity()
| void spk::Perlin::setLacunarity |
( |
float | p_l | ) |
|
Sets frequency multiplier per octave.
- Parameters
-
◆ setOctaves()
| void spk::Perlin::setOctaves |
( |
int | p_oct | ) |
|
Sets octave count for fractal noise.
- Parameters
-
◆ setPersistence()
| void spk::Perlin::setPersistence |
( |
float | p_p | ) |
|
Sets amplitude persistence between octaves.
- Parameters
-
◆ setSeed()
| void spk::Perlin::setSeed |
( |
unsigned int | p_seed | ) |
|
Reseeds the permutation table.
- Parameters
-
The documentation for this class was generated from the following files:
- includes/structure/math/spk_perlin.hpp
- srcs/structure/math/spk_perlin.cpp