Sign in Join
Wiki copytemporary

Perlin Noise: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11This page is the start of a tutorial about using Perlin Noise on LCL applications to generate natural looking images. It will cover both basic theory and real usage examples, with a focus on compilable examples.
22
33Perlin Noise was invented by [Ken Perlin](http://mrl.nyu.edu/~perlin/) to generate textures for a movie called Tron. Today it is widely used on movies and video games to produce natural looking smoke, landscapes, clouds and any texture including marble, irregular glass, etc.
44
55## Getting Started
66
77Perlin Noise is based on the idea of fractals, that things in nature show different degrees of change. On a rocky mountain landscape for example when can see changes with a very big amplitude, which are the mountains themselves. Smaller changes represent irregularities on those mountains and even smaller ones represent rocks.
88
9-<figure>
10-<img src="mountain_landscape.png" title="mountain_landscape.png" />
11-<figcaption>mountain_landscape.png</figcaption>
12-</figure>
9+![](/wiki-images/b/b6/Mountain_landscape.png)
1310
1411## First Example
1512
1613This application demonstrates a simple noise function with the following properties:
1714
1815- Only 1 harmonic present
1916- Amplitude of 250 pixels
2017- Wavelength of 20 pixels
2118- Frequency of 0.05
2219- You can use a combo box to choose between Linear, Cossine and Cubic interpolation
2320
24-<figure>
25-<img src="Noise1D.png" title="Noise1D.png" />
26-<figcaption>Noise1D.png</figcaption>
27-</figure>
21+![](/wiki-images/8/86/Noise1D.png)
2822
2923Files:
3024
3125- noise1d.lpi
3226- noise1d.dpr
3327- noise.pas
3428
3529## Persistence Example
3630
3731This application demonstrates how to sum many noise functions to get a perlin noise function. It has the following properties:
3832
3933- 3 harmonics present
4034- Amplitudes of 250, 125 and 62 pixels
4135- Wavelength of 20, 10, and 5 pixels
4236- Frequency of 0.05, 0.1, 0.2
4337- You can use a combo box to choose between Linear, Cossine and Cubic interpolation
4438
45-<figure>
46-<img src="Perlin1D.png" title="Perlin1D.png" />
47-<figcaption>Perlin1D.png</figcaption>
48-</figure>
39+![](/wiki-images/8/85/Perlin1D.png)
4940
5041Files:
5142
5243- perlin1d.lpi
5344- perlin1d.dpr
5445- noise.pas
5546
5647## Use Perlin noise to create textures
5748
5849It is possible to create tilable textures of stone, water, wood... with Perlin noise.
5950
6051Here is a tutorial on how to do this: [[BGRABitmap tutorial 8]]
6152
6253## Subversion
6354
6455You can download the source code for the examples and the library using this command:
6556
6657svn co <https://svn.code.sf.net/p/lazarus-ccr/svn/examples/noise> noise
6758
6859## External Links
6960
7061- [Article](http://web.archive.org/web/20160325134143/http://freespace.virgin.net/hugo.elias/models/m_perlin.htm) with the theory of Perlin Noise.
7162
7263---
7364*From the Free Pascal wiki, page "Perlin Noise", as it stood on 2019-04-11 after a change by PascalR, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
7465Category: Game Development
7566Category: Graphics
7667Category: Lazarus-CCR
7768Category: SciTech
7869Category: Tutorials

Back to history