BRL-CAD
|
These noise functions provide mostly random noise at the integer lattice points. More...
Functions | |
void | bn_noise_init (void) |
double | bn_noise_perlin (point_t pt) |
Robert Skinner's Perlin-style "Noise" function. More... | |
void | bn_noise_vec (point_t point, point_t result) |
double | bn_noise_fbm (point_t point, double h_val, double lacunarity, double octaves) |
Procedural fBm evaluated at "point"; returns value stored in "value". More... | |
double | bn_noise_turb (point_t point, double h_val, double lacunarity, double octaves) |
Procedural turbulence evaluated at "point";. More... | |
double | bn_noise_mf (point_t point, double h_val, double lacunarity, double octaves, double offset) |
double | bn_noise_ridged (point_t point, double h_val, double lacunarity, double octaves, double offset) |
A ridged noise pattern. More... | |
These noise functions provide mostly random noise at the integer lattice points.
The functions should be evaluated at non-integer locations for their nature to be realized.
Contains contributed code from: F. Kenton Musgrave Robert Skinner
void bn_noise_init | ( | void | ) |
double bn_noise_perlin | ( | point_t | pt | ) |
Robert Skinner's Perlin-style "Noise" function.
Results are in the range [-0.5 .. 0.5]. Unlike many implementations, this function provides random noise at the integer lattice values. However this produces much poorer quality and should be avoided if possible.
The power distribution of the result has no particular shape, though it isn't as flat as the literature would have one believe.
double bn_noise_fbm | ( | point_t | point, |
double | h_val, | ||
double | lacunarity, | ||
double | octaves | ||
) |
Procedural fBm evaluated at "point"; returns value stored in "value".
point | location to sample noise |
h_val | fractal increment parameter |
lacunarity | gap between successive frequencies |
octaves | number of frequencies in the fBm |
The spectral properties of the result are in the APPROXIMATE range [-1..1] Depending upon the number of octaves computed, this range may be exceeded. Applications should clamp or scale the result to their needs. The results have a more-or-less gaussian distribution. Typical results for 1M samples include:
The function call pow() is relatively expensive. Therefore, this function pre-computes and saves the spectral weights in a table for re-use in successive invocations.
double bn_noise_turb | ( | point_t | point, |
double | h_val, | ||
double | lacunarity, | ||
double | octaves | ||
) |
Procedural turbulence evaluated at "point";.
point | location to sample noise at |
h_val | fractal increment parameter |
lacunarity | gap between successive frequencies |
octaves | number of frequencies in the fBm |
The result is characterized by sharp, narrow trenches in low values and a more fbm-like quality in the mid-high values. Values are in the APPROXIMATE range [0 .. 1] depending upon the number of octaves evaluated. Typical results:
The function call pow() is relatively expensive. Therefore, this function pre-computes and saves the spectral weights in a table for re-use in successive invocations.
double bn_noise_mf | ( | point_t | point, |
double | h_val, | ||
double | lacunarity, | ||
double | octaves, | ||
double | offset | ||
) |
From "Texturing and Modeling, A Procedural Approach" 2nd ed
double bn_noise_ridged | ( | point_t | point, |
double | h_val, | ||
double | lacunarity, | ||
double | octaves, | ||
double | offset | ||
) |
A ridged noise pattern.
From "Texturing and Modeling, A Procedural Approach" 2nd ed p338