Click or drag to resize
DigitalRunePerlinNoise Class
Computes Improved Perlin Noise.
Inheritance Hierarchy
SystemObject
  DigitalRune.Mathematics.StatisticsPerlinNoise

Namespace: DigitalRune.Mathematics.Statistics
Assembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax
public static class PerlinNoise

The PerlinNoise type exposes the following members.

Methods
  NameDescription
Public methodStatic memberCompute(Double)
Computes a noise value for a 1D position given by (x).
Public methodStatic memberCompute(Double, Double)
Computes a noise value for a 2D position given by (x, y).
Public methodStatic memberCompute(Double, Int32)
Computes a noise value for a 1D position given by (x). The noise is tileable with the given periods.
Public methodStatic memberCompute(Double, Double, Double)
Computes a noise value for a 3D position given by (x, y, z).
Public methodStatic memberCompute(Double, Double, Double, Double)
Computes a noise value for a 4D position given by (x, y, z, w).
Public methodStatic memberCompute(Double, Double, Int32, Int32)
Computes a noise value for a 2D position given by (x, y). The noise is tileable with the given periods.
Public methodStatic memberCompute(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.
Public methodStatic memberCompute(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.
Public methodStatic memberNoise(Double, Double, Double) Obsolete.
Computes a 3d noise value for a 3d position given by (x, y, z).
Public methodStatic memberNoise(Double, Double, Double, Int32) Obsolete.
Computes a 3d noise value for a 3d position given by (x, y, z).
Top
Fields
  NameDescription
Public fieldStatic memberPermutation
Permutation table for improved noise by Ken Perlin.
Top
Remarks

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)

See Also