Skip to content

Attributes

Max Wright edited this page Jan 2, 2018 · 18 revisions

For a noise to look unique it has multiple octaves. An octave is a singular occurrence of that noise. A noise has a starting frequency and amplitude. Each successive octave has twice the frequency of the previous but also a changed amplitude equal to the amplitude times a value called persistence. The noise is then a sum of all octaves.

In this library, the starting amplitude is always one and the sum of all octaves is shrunk so the resulting noise still has an amplitude of one.

Frequency

How often something occurs. Something in the case of noise and also light refers to how many waves per unit. Frequency is manipulated in this library by manipulating the number of sections.

// 1D
Perlin1D perlin = new Perlin1D(10, 1000);
Perlin1D perlin2 = new Perlin1D(20, 1000);
// 2D
Perlin2D perlin = new Perlin1D(10, 10, 1000, 1000);
Perlin2D perlin2 = new Perlin1D(20, 20, 1000, 1000);

In these cases, perlin2 will have twice the frequency as perlin.

Octave

Par with the law of octaves, an octave is half or double the frequency. In this implementation, each successive octave is twice the frequency of the previous.

AdvPerlin2D perlin = new AdvPerlin2D(10, 10, 1000, 1000, 3, .5);

/*
 * perlin contains three instances of the coherent noise perlin.
 * These octaves are similar to:
 */
Perlin2D octave1 = new Perlin2D(10, 10, 1000, 1000); // Amplitude of 1
Perlin2D octave2 = new Perlin2D(20, 20, 1000, 1000); // but has an amplitude of .5
Perlin2D octave3 = new Perlin2D(40, 40, 1000, 1000); // but has an amplitude of .25

Persistence

Persistence is a scalar for the amplitude.

// 1D
AdvPerlin1D perlin = new AdvPerlin1D(10, 1000, 3, .5);
// 2D
AdvPerlin2D perlin = new AdvPerlin2D(10, 10, 1000, 1000, 3, .5);

In each case or perlin.

Octave #1 will have an amplitude of 1.0

Octave #2 will have an amplitude of 0.5

Octave #3 will have an amplitude of 0.25

Further Study

For further study, I recommend researching into these terms as defined and understood in the discipline of physics.

Clone this wiki locally