Amortized Noise Terrain Generator
A Program to Generate Terrain from Amortized Noise with Exponentially Distributed Gradient Magnitude
|
Code for generating an exponentially distributed hash function. More...
Macros | |
#define | clip(x, a, b) min(max(x, a), b) |
Clip x to [a,b]. | |
Functions | |
float | UniformHash (unsigned int x, unsigned int max) |
Uniform hash. More... | |
float | ExpHash (unsigned int x, unsigned int max) |
Exponential hash. More... | |
float | ExpHash (unsigned int x, unsigned int y, unsigned int m, float omega) |
Exponential hash with control of exponent and tail of distribution. More... | |
float ExpHash | ( | unsigned int | x, |
unsigned int | max | ||
) |
Exponentially distributed hash function.
Hash an unsigned integer into the range (0, 1) with an exponential distribution.
x | Value to be hashed. |
max | Largest possible value of x. |
float ExpHash | ( | unsigned int | x, |
unsigned int | y, | ||
unsigned int | m, | ||
float | omega | ||
) |
Exponentially distributed hash function.
Hash an unsigned integer into the range (0, 1) with an exponential distribution giving some control over the base of the exponent and the height of the tail of the distribution.
x | Value to be hashed. |
y | Second value to be hashed to select distribution. |
m | Largest possible value of x. |
omega | The tail multiplier, which controls how low the tails of the distribution can be. |
float UniformHash | ( | unsigned int | x, |
unsigned int | max | ||
) |
Uniformly distributed hash function.
Hash an unsigned integer uniformly into the range (0, 1).
x | Value to be hashed. |
max | Largest possible value of x. |