octaveNoise(x, y, z, octaves, persistence)
The octaveNoise()
function generates fractal Perlin noise by combining multiple layers (octaves) of noise at different frequencies and amplitudes. This creates more complex and natural-looking patterns than basic Perlin noise.
Syntax
Parameters
x
- The x-coordinate in the noise spacey
- The y-coordinate in the noise spacez
- The z-coordinate in the noise spaceoctaves
- The number of layers of noise to combinepersistence
- How much each octave contributes to the final result (0-1)
Return Value
A number between -1 and 1, representing the combined noise value at the given coordinates.
Description
Octave noise (also known as fractal noise) combines multiple layers of Perlin noise to create more detailed and natural-looking patterns. Each octave:
Has double the frequency (more detail) of the previous octave
Has its amplitude reduced by the persistence factor
This creates noise with both large-scale features and fine details, similar to natural phenomena like terrain, clouds, or textures.
The parameters work as follows:
Higher
octaves
values create more detailed noise but are more computationally expensiveLower
persistence
values create smoother noise with subtle detailsHigher
persistence
values create rougher noise with more prominent details
Examples
Basic Octave Noise
Terrain Generation with Octave Noise
2D Noise Map with Different Parameters
Animated Cloud-like Pattern
Comparison with Basic Noise
Octave noise differs from basic Perlin noise in several ways:
Detail level: Octave noise contains both large features and fine details
Complexity: Octave noise creates more complex, natural-looking patterns
Control: The octaves and persistence parameters allow fine-tuning of the noise characteristics
Performance: Octave noise is more computationally expensive due to calculating multiple layers
Notes
Typical values for
octaves
range from 1 to 8 (higher values are more expensive)Typical values for
persistence
range from 0.25 to 0.75Each additional octave doubles the computational cost
For real-time applications, use fewer octaves (1-4)
For pre-generated content, higher octave counts (4-8) create more detailed results
Last updated
Was this helpful?