CGPdocs

Random numbers and noise

Uniform and normal random numbers, and Perlin-like noise for procedural shapes.

Compute 3

float noise_perlin(
    float x,
    int octave = 5,
    float persistency = 0.3f,
    float frequency_gain = 2.0f
)

Fractal 1D noise in [0,1] summing octave layers of simplex noise, each layer scaled in amplitude by persistency and in frequency by frequency_gain (defaults 5, 0.3, 2).

float rand_normal(float const average = 0.0f, float const stddev = 1.0f)

Random float drawn from a normal distribution of given average and standard deviation (0 and 1 by default).

float rand_uniform(float const value_min = 0.0f, float const value_max = 1.0f)

Random float drawn uniformly in [value_min, value_max), [0,1) by default.

Other 1

void rand_initialize_generator()

Reseed the random generator from the clock so that each run gives different values (the default seed is fixed at 0).

CGP - Computer Graphics Programming.