Collaboration diagram for Fractal Noise:
![]() |
Files | |
file | noise.c |
Data Structures | |
struct | str_ht |
struct | fbm_spec |
double | bn_noise_perlin (point_t pt) |
void | bn_noise_vec (point_t point, point_t result) |
double | bn_noise_fbm (point_t point, double h_val, double lacunarity, double octaves) |
double | bn_noise_turb (point_t point, double h_val, double lacunarity, double octaves) |
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) |
Defines | |
#define | SMOOTHSTEP(x) ( (x) * (x) * (3 - 2*(x)) ) |
interpolate smoothly from 0 .. 1 SMOOTHSTEP() takes a value in the range [0:1] and provides a number in the same range indicating the amount of (a) present in a smooth interpolation transition between (a) and (b) | |
#define | FLOOR(x) ( (int)(x) - ( (x) < 0 && (x) != (int)(x) ) ) |
#define | MAXSIZE 267 |
#define | INCRSUM(m, s, x, y, z) |
#define | MAGIC_STRHT1 1771561 |
#define | MAGIC_STRHT2 1651771 |
#define | MAGIC_TAB1 9823 |
#define | MAGIC_TAB2 784642 |
#define | CK_HT() |
#define | Hash3d(a, b, c) |
#define | MAGIC_fbm_spec_wgt 0x837592 |
#define | PSCALE(_p, _s) _p[0] *= _s; _p[1] *= _s; _p[2] *= _s |
#define | PCOPY(_d, _s) _d[0] = _s[0]; _d[1] = _s[1]; _d[2] = _s[2] |
Functions | |
void | bn_noise_init (void) |
double | bn_noise_perlin (fastf_t *point) |
Robert Skinner's Perlin-style "Noise" function. | |
void | bn_noise_vec (fastf_t *point, fastf_t *result) |
fbm_spec * | find_spec_wgt (double h, double l, double o) |
double | bn_noise_fbm (fastf_t *point, double h_val, double lacunarity, double octaves) |
Procedural fBm evaluated at "point"; returns value stored in "value". | |
double | bn_noise_turb (fastf_t *point, double h_val, double lacunarity, double octaves) |
Procedural turbulence evaluated at "point";. | |
double | bn_noise_ridged (fastf_t *point, double h_val, double lacunarity, double octaves, double offset) |
A ridged noise pattern. | |
double | bn_noise_mf (fastf_t *point, double h_val, double lacunarity, double octaves, double offset) |
|
interpolate smoothly from 0 .. 1 SMOOTHSTEP() takes a value in the range [0:1] and provides a number in the same range indicating the amount of (a) present in a smooth interpolation transition between (a) and (b)
Definition at line 75 of file noise.c. Referenced by bn_noise_perlin(), bn_noise_vec(), and rt_dsp_norm(). |
|
|
|
|
|
Value: Definition at line 133 of file noise.c. Referenced by bn_noise_perlin(), and bn_noise_vec(). |
|
Definition at line 157 of file noise.c. Referenced by bn_noise_init(). |
|
Definition at line 158 of file noise.c. Referenced by bn_noise_init(). |
|
Definition at line 159 of file noise.c. Referenced by bn_noise_init(). |
|
Definition at line 160 of file noise.c. Referenced by bn_noise_init(). |
|
Value: { \ BU_CKMAG(&ht.magic, MAGIC_STRHT1, "struct str_ht ht 1"); \ BU_CKMAG(&ht.magic_end, MAGIC_STRHT2, "struct str_ht ht 2"); \ BU_CKMAG(ht.hashTableMagic1, MAGIC_TAB1, "hashTable Magic 1"); \ BU_CKMAG(ht.hashTableMagic2, MAGIC_TAB2, "hashTable Magic 2"); \ if (ht.hashTable != (short *)&ht.hashTableMagic1[1] ) \ bu_bomb("ht.hashTable changed rel ht.hashTableMagic1"); \ if (ht.hashTableMagic2 != (long *)&ht.hashTable[4096] ) \ bu_bomb("ht.hashTable changed rel ht.hashTableMagic2"); \ } |
|
Value: ht.hashTable[ \ ht.hashTable[ \ ht.hashTable[(a) & 0xfff] ^ ((b) & 0xfff) \ ] ^ ((c) & 0xfff) \ ] Definition at line 178 of file noise.c. Referenced by bn_noise_perlin(), and bn_noise_vec(). |
|
Definition at line 458 of file noise.c. Referenced by find_spec_wgt(). |
|
Definition at line 464 of file noise.c. Referenced by bn_noise_fbm(), bn_noise_mf(), bn_noise_ridged(), and bn_noise_turb(). |
|
Definition at line 465 of file noise.c. Referenced by bn_noise_fbm(), bn_noise_mf(), bn_noise_ridged(), and bn_noise_turb(). |
|
Definition at line 187 of file noise.c. References BN_RAND_TABSIZE, BN_RANDOM, BN_RANDSEED, bu_malloc(), BU_SEM_BN_NOISE, bu_semaphore_acquire(), bu_semaphore_release(), str_ht::hashTable, str_ht::hashTableMagic1, str_ht::hashTableMagic2, str_ht::hashTableValid, str_ht::magic, str_ht::magic_end, MAGIC_STRHT1, MAGIC_STRHT2, MAGIC_TAB1, and MAGIC_TAB2. Referenced by bn_noise_perlin(), and bn_noise_vec(). Here is the call graph for this function: ![]() |
|
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. Definition at line 253 of file noise.c. References bn_noise_init(), Hash3d, str_ht::hashTableValid, INCRSUM, SMOOTHSTEP, X, Y, and Z. Here is the call graph for this function: ![]() |
|
Vector-valued "Noise" Definition at line 334 of file noise.c. References bn_noise_init(), Hash3d, str_ht::hashTableValid, INCRSUM, SMOOTHSTEP, X, Y, and Z. Here is the call graph for this function: ![]() |
|
The first order of business is to see if we have pre-computed the spectral weights table for these parameters in a previous invocation. If not, the we compute them and save them for possible future use Definition at line 524 of file noise.c. References bu_bomb(), fbm_spec::h_val, fbm_spec::lacunarity, fbm_spec::magic, MAGIC_fbm_spec_wgt, and fbm_spec::octaves. Referenced by bn_noise_fbm(), bn_noise_mf(), bn_noise_ridged(), and bn_noise_turb(). Here is the call graph for this function: ![]() |
|
Procedural fBm evaluated at "point"; returns value stored in "value".
The function call pow() is relatively expensive. Therfore, this function pre-computes and saves the spectral weights in a table for re-use in successive invocations. Definition at line 585 of file noise.c. References bn_noise_perlin(), find_spec_wgt(), int, PCOPY, PSCALE, fbm_spec::remainder, fbm_spec::spec_wgts, and value. Here is the call graph for this function: ![]() |
|
Procedural turbulence evaluated at "point";.
Definition at line 655 of file noise.c. References bn_noise_perlin(), find_spec_wgt(), int, PCOPY, PSCALE, fbm_spec::spec_wgts, and value. Here is the call graph for this function: ![]() |
|
A ridged noise pattern. From "Texturing and Modeling, A Procedural Approach" 2nd ed p338 Definition at line 730 of file noise.c. References bn_noise_perlin(), find_spec_wgt(), PCOPY, PSCALE, and fbm_spec::spec_wgts. Here is the call graph for this function: ![]() |
|
From "Texturing and Modeling, A Procedural Approach" 2nd ed Definition at line 789 of file noise.c. References bn_noise_perlin(), find_spec_wgt(), PCOPY, PSCALE, and fbm_spec::spec_wgts. Here is the call graph for this function: ![]() |
|
Referenced by bn_cmd_noise_perlin(), bn_noise_fbm(), bn_noise_mf(), bn_noise_ridged(), and bn_noise_turb(). |
|
|
|
Referenced by bn_cmd_noise(), and bn_cmd_noise_slice(). |
|
Referenced by bn_cmd_noise(). |
|
|
|
|