diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-12-09 12:01:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-12-09 12:01:44 +0300 |
commit | 9e365069afe156f33fadfad9705e1325f894cd54 (patch) | |
tree | 78373044d029feb51f987b45208e0c1a36958625 /source/blender/blenlib/BLI_noise.h | |
parent | d8b42751625c915113b64f5a2d9c72f19f009fee (diff) |
Cleanup: move public doc-strings into headers for 'blenlib'
- Added space below non doc-string comments to make it clear
these aren't comments for the symbols directly below them.
- Use doxy sections for some headers.
- Minor improvements to doc-strings.
Ref T92709
Diffstat (limited to 'source/blender/blenlib/BLI_noise.h')
-rw-r--r-- | source/blender/blenlib/BLI_noise.h | 78 |
1 files changed, 75 insertions, 3 deletions
diff --git a/source/blender/blenlib/BLI_noise.h b/source/blender/blenlib/BLI_noise.h index 37afd8ee031..51aee9dc2ba 100644 --- a/source/blender/blenlib/BLI_noise.h +++ b/source/blender/blenlib/BLI_noise.h @@ -29,21 +29,65 @@ extern "C" { float BLI_noise_hnoise(float noisesize, float x, float y, float z); float BLI_noise_hnoisep(float noisesize, float x, float y, float z); +/** + * Original turbulence functions. + */ float BLI_noise_turbulence(float noisesize, float x, float y, float z, int nr); -/* newnoise: generic noise & turbulence functions +/** + * newnoise: generic noise & turbulence functions * to replace the above BLI_noise_hnoise/p & BLI_noise_turbulence/1. - * This is done so different noise basis functions can be used */ + * This is done so different noise basis functions can be used. + */ +/** + * newnoise: generic noise function for use with different `noisebasis`. + */ float BLI_noise_generic_noise( float noisesize, float x, float y, float z, bool hard, int noisebasis); +/** + * newnoise: generic turbulence function for use with different `noisebasis`. + */ float BLI_noise_generic_turbulence( float noisesize, float x, float y, float z, int oct, bool hard, int noisebasis); + /* newnoise: musgrave functions */ + +/** + * Procedural `fBm` evaluated at "point"; returns value stored in "value". + * + * \param H: is the fractal increment parameter. + * \param lacunarity: is the gap between successive frequencies. + * \param octaves: is the number of frequencies in the `fBm`. + */ float BLI_noise_mg_fbm( float x, float y, float z, float H, float lacunarity, float octaves, int noisebasis); +/** + * Procedural multi-fractal evaluated at "point"; + * returns value stored in "value". + * + * \param H: determines the highest fractal dimension. + * \param lacunarity: is gap between successive frequencies. + * \param octaves: is the number of frequencies in the `fBm`. + * + * \note There used to be a parameter called `offset`, old docs read: + * is the zero offset, which determines multi-fractality. + */ float BLI_noise_mg_multi_fractal( float x, float y, float z, float H, float lacunarity, float octaves, int noisebasis); +/** + * "Variable Lacunarity Noise" + * A distorted variety of Perlin noise. + */ float BLI_noise_mg_variable_lacunarity( float x, float y, float z, float distortion, int nbas1, int nbas2); +/** + * Heterogeneous procedural terrain function: stats by altitude method. + * Evaluated at "point"; returns value stored in "value". + * + * \param H: Determines the fractal dimension of the roughest areas. + * \param lacunarity: Is the gap between successive frequencies. + * \param octaves: Is the number of frequencies in the `fBm`. + * \param offset: Raises the terrain from `sea level`. + */ float BLI_noise_mg_hetero_terrain(float x, float y, float z, @@ -52,6 +96,14 @@ float BLI_noise_mg_hetero_terrain(float x, float octaves, float offset, int noisebasis); +/** + * Hybrid additive/multiplicative multi-fractal terrain model. + * + * Some good parameter values to start with: + * + * \param H: 0.25 + * \param offset: 0.7 + */ float BLI_noise_mg_hybrid_multi_fractal(float x, float y, float z, @@ -61,6 +113,15 @@ float BLI_noise_mg_hybrid_multi_fractal(float x, float offset, float gain, int noisebasis); +/** + * Ridged multi-fractal terrain model. + * + * Some good parameter values to start with: + * + * \param H: 1.0 + * \param offset: 1.0 + * \param gain: 2.0 + */ float BLI_noise_mg_ridged_multi_fractal(float x, float y, float z, @@ -71,9 +132,20 @@ float BLI_noise_mg_ridged_multi_fractal(float x, float gain, int noisebasis); /* newnoise: voronoi */ + +/** + * Not 'pure' Worley, but the results are virtually the same. + * Returns distances in da and point coords in `pa`. + */ void BLI_noise_voronoi(float x, float y, float z, float *da, float *pa, float me, int dtype); -/* newnoise: BLI_noise_cell & BLI_noise_cell_v3 (for vector/point/color) */ +/** + * newnoise: BLI_noise_cell & BLI_noise_cell_v3 (for vector/point/color). + * idem, signed. + */ float BLI_noise_cell(float x, float y, float z); +/** + * Returns a vector/point/color in `r_ca`, using point hash-array directly. + */ void BLI_noise_cell_v3(float x, float y, float z, float r_ca[3]); #ifdef __cplusplus |