PerlinNoise Class |
Namespace: DigitalRune.Mathematics.Statistics
The PerlinNoise type exposes the following members.
Name | Description | |
---|---|---|
Compute(Double) |
Computes a noise value for a 1D position given by (x).
| |
Compute(Double, Double) |
Computes a noise value for a 2D position given by (x, y).
| |
Compute(Double, Int32) |
Computes a noise value for a 1D position given by (x).
The noise is tileable with the given periods.
| |
Compute(Double, Double, Double) |
Computes a noise value for a 3D position given by (x, y, z).
| |
Compute(Double, Double, Double, Double) |
Computes a noise value for a 4D position given by (x, y, z, w).
| |
Compute(Double, Double, Int32, Int32) |
Computes a noise value for a 2D position given by (x, y).
The noise is tileable with the given periods.
| |
Compute(Double, Double, Double, Int32, Int32, Int32) |
Computes a noise value for a 3D position given by (x, y, z).
The noise is tileable with the given periods.
| |
Compute(Double, Double, Double, Double, Int32, Int32, Int32, Int32) |
Computes a noise value for a 4D position given by (x, y, z, w).
The noise is tileable with the given periods.
| |
Noise(Double, Double, Double) | Obsolete.
Computes a 3d noise value for a 3d position given by (x, y, z).
| |
Noise(Double, Double, Double, Int32) | Obsolete.
Computes a 3d noise value for a 3d position given by (x, y, z).
|
Name | Description | |
---|---|---|
Permutation |
Permutation table for improved noise by Ken Perlin.
|
This class implements "improved noise" by Ken Perlin for 1D, 2D, 3D and 4D.
General noise is simply a collection of random values, like the random dot pattern on old TVs when there is no input signal. General noise is not smooth. Band-limited noise is a noise which is smooth. This can be generated by zooming into the noise pattern and applying a Gaussian blur. A more efficient version of band-limited noise is Perlin Noise.
Perlin Noise is a Gradient Noise: It use a grid of gradients. The noise is 0 at the grid points, i.e. for 3D Compute((int)x, (int)y, (int)z) == 0.
Between grid points the gradients are interpolated to created smooth noise. There is at most one oscillation between two grid points.
Perlin noise is consistent: For a constant position this method always returns the same noise value.
The resulting noise is scaled to keep values the range [-1, 1]. (This is only approximated using scaling factors determined by experimentation. Some returned noise values might still be outside [-1, 1].)
Random values are generated using a lookup table. Since the table is limited, the noise
function repeats itself in each dimension after 256 values, for example:
Compute(x, y, z) == Compute(x + 256, y + 256, z + 256).
This class can also compute periodic/tileable noise for any integer period, such that:
Compute(x, y, z, periodX, periodY, periodZ) == Compute(x + periodX, y + periodY, z + periodZ, periodX, periodY, periodZ)