top of page

Maths in Graphics: Perlin Noise


Instead of storing a list of random numbers for a landscapes dimensions, you can instead store an equation.


Noise

An algorithm for generating wave lengths that appear random but are mathematically calculated. This can be used for procedural generation.


Perlin noise is a type of gradient noise developed by Ken Perlin in 1983, and was used in Tron.


Noise has a smoothness and predictability that can't be got with randoms.

Noise can be generated with in any number of dimensions.


1 dimensional noise appears as a line graph, and is generated with one value as input (x).

2 dimensional noise is used to generate textures. it's generated with two values as input (y and x).

3 dimensional noise is used to define areas of volume.


Perlin noise returns a continuous wave form with values between 0 and 1. Because it is mathematically calculated it can also be zoomed in. The smaller the increments between the values, the smoother the results.


The higher the increment value is, the rougher the terrain will appear.

As you decrease the increment value the terrain begins to look smoother, as if you have zoomed in on a section of the rough terrain.

if you keep increasing though, it will only pick up the peaks and will appear flat instead of highly detailed.


However, if you keep decreasing the increment value, the terrain will also appear flat as all that is being picked up is the flat sections.





You can modify Perlin Noise by modifying it's frequency and/or amplitude.

By increasing the frequency you increase the number of occurrences of a wave in a section.

By increasing the amplitude you increase the height of the waves (where the wave peaks).


Each wave is called an Octave.


Perlin Algorithm:

  1. Determine lattice and seed with random gradient vectors.

  2. Pick a sample point in the region

  3. Calculate the displacement of the corners of the lattice cell relative to the sample point.

  4. Calculate the gradient values at the sample point by taking the dot product of the displacement vectors and their respective gradient vectors.

  5. Interpolate the four gradient values at the sample point.

  6. Next point (go back to 2), else done.



Recent Posts

See All

Source Control

Source Control allows you to track certain files over time. If you mess up or delete something you need back you can always return to a...

Comments


bottom of page