Perlin Noise is a fundamental concept in computer graphics, widely used for creating natural-looking textures, patterns, and motions.

Introduction to Perlin Noise

Perlin Noise, developed by Ken Perlin in the 1980s, is a type of gradient noise often used in computer graphics and procedural generation. It is different from regular noise (like white noise) in its smoothness and its natural appearance. Perlin Noise generates a sequence of numbers that appear random, but are actually continuous and smooth, making it ideal for simulating phenomena such as landscapes, clouds, and water.

Key Characteristics

Using Perlin Noise in Processing

In Processing, Perlin Noise is generated using the noise() function. This function takes one, two, or three arguments (representing coordinates in a multi-dimensional noise space) and returns a float between 0.0 and 1.0.

Noise Scale

The noise scale determines how much detail is in the noise pattern. It affects the "zoom level" of the noise.

scale_factor = 0.01  # Smaller scale
n = noise(x * scale_factor, y * scale_factor)

Octaves / Noise Detail

Octaves in Perlin Noise refer to the number of layers of noise functions stacked on top of each other, each with increasing frequency and decreasing amplitude.

In Processing, you can control the number of octaves using the noiseDetail() function.

octaves = 4
noiseDetail(octaves)

Falloff

Falloff in the context of octaves determines how quickly the amplitudes diminish for each subsequent octave.

Falloff is also controlled using the noiseDetail() function, where it's the second argument.

falloff = 0.5
noiseDetail(octaves, falloff)

Applications in Computer Graphics