Perlin noise, while random, is what is referred to as coherent noise meaning there is gradual change between values. This can be clearly visualized by translating sections of a given noise map. When done to random noise, the section blends in immediately after its movement stops. However, when done to a coherent noise, like Perlin, the gradual change between values is interrupted and ends up being plainly obvious as seen below.
White Noise | Perlin Noise |
---|---|
-
Definition:
-
Calculation:
-
Interpolation:
-
Utilize bilinear interpolation to combine the four dot products.
-
Utilize a sigmoid fade function, otherwise known as an ease curve to remove any seams found between Perlin grid quadrants.
No fading Fading -
Calculate the local minimum and maximum of the given noise map, then rescale the individual noise values back onto the interval of [0-1] through inverse linear interpolation.
-
-
Seed:
-
Frequency:
-
Definition: The scale number of individual peaks and troughs found in each dimension of a single noise map octave.
-
Use: Controls the initial scale along the x and y axes of the Perlin noise map. As seen below, increasing the initial frequency by a factor of two causes the previous noise map to be present, but only represent a quarter of the subsequent grid.
Frequency: 1 Frequency: 2 Frequency: 4
-
-
Octave:
-
Definition: A single noise map which can be used independently or in compounding layers.
-
Use: Allows for the compounding of noise layers such that subsequent layers add detail and roughness to the previous noise layers without changing their overall structure.
Original Noise Layer Noise Layer 1 Noise Layer 2 Resultant Noise Map
-
-
Persistence:
-
Lacunarity:
-
Noise Mask:
Noise perlin = new PerlinNoiseGenerator()
// The desired (positive, non-zero, integer) height of the generated PerlinNoise object.
.height(512)
// The desired (positive, non-zero, integer) width of the generated PerlinNoise object.
.width(512)
// The desired (long) seed used when generating the PerlinNoise object.
.seed(0)
// The desired (positive, non-zero integer) initial frequency of the generated PerlinNoise object.
.frequency(1)
// The desired (positive, non-zero, integer) number of octaves present in the generated PerlinNoise object.
.octaves(10)
// The desired (positive, non-zero, double) persistence of the generated PerlinNoise object.
.persistence(0.5)
// The desired (positive, non-zero, double) lacunarity of the generated PerlinNoise object.
.lacunarity(2.8)
// The desired (positive, [0-1], double) intensity of the NoiseMask being applied to the generated PerlinNoise object.
.noiseMask(0.5)
.generate();