cf_noise_fbm_pixels_wrapped¶
Category: noise
GitHub: cute_noise.h
Creates an image from noise using fractal brownian motion, that can also animate in a loop, and tiles seamlessly.
CF_Pixel* cf_noise_fbm_pixels_wrapped(int w, int h, uint64_t seed, float scale, float lacunarity, int octaves, float falloff, float time, float time_amplitude);
| Parameters | Description |
|---|---|
w |
The width of the image. |
h |
The height of the image. |
seed |
Used to seed the sequence of numbers generated. Default 0. |
scale |
Scales up or down the noise in the image, like zooming in or out. Default 1.0f. |
lacunarity |
The difference in the period of the noise between each octave. Default 2.0f. |
octaves |
The number of octaves to sum together. Higher numbers has worse performance. Default 3. |
falloff |
How much contribution higher octaves have compared to lower ones. Default 0.5f. |
Return Value¶
Returns a generated image filled with noise.
Remarks¶
The generated image can be animated over a loop, and tiles seamlessly in the x-y directions. To control the animation pass in a float starting at 0, and incremented with CF_DELTA_TIME each game tick. This will loop the animation over a one-second period. You can divide your accumulated time by a frequency to set a number of seconds to loop over.
If you want the animation to move faster without adjusting the loop time, then adjust time_amplitude. This scales how
much the animation will evolve over time. Higher values will have faster and more volatile looking motions.