RE: Perlin Noise - Early demo release was ( - Texture Generator)
- Posted by dm31 at uow.edu.au Nov 27, 2002
- 479 views
|Thanks. |It will suffice being 1 channel. |The range may be -32767 to 32767 *or* greater, if this eases things. |Anyway, I'd be grateful in case you explain the basics of Perlin |noise generation, for me to try. Many people have used random number generators in their programs to create unpredictability, make the motion and behavior of objects appear more natural, or generate textures. Random number generators certainly have their uses, but at times their output can be too harsh to appear natural. Perlin Noise has a very wide range of uses, more than I can think of, but basically anywhere where you need something to look natural in origin. What's more it's output can easily be tailored to suit your needs. If you look at many things in nature, you will notice that they are fractal. They have various levels of detail. A common example is the outline of a mountain range. It contains large variations in height (the mountains), medium variations (hills), small variations (boulders), tiny variations (stones)... you could go on. The Perlin Noise function recreates this by simply adding up noisy functions at a range of different scales. The two most important functions needed, are the Noise function, and the Interpolate function. The Noise function will create the random data to be used, and the Interpolate funcion smoothly interpolates between the values. I'm going to assume that you understand the terms Frequency & Amplitude. The key to Perlin Noise is to create several layers of Noise, at different Frequency and Amplitudes. The most common way to go is to half the amplitude and double the frequency. Of course you could do whatever you want, depended on you desired effect(atm, you can select any frequencies for the layers, and selectable Amps will be coded soon) Once you have made the layers of Noise at different Freqs and Amps, you can simply add them together, and volia. With simple modifications, you can do this in 1D(limited uses. Sound, Sketchy Interfaces, etc), 2D(Moving 1D, Textures, creating 3d Terrain), 3D(Moving 2D, Volumetric Textures(VERY good stuff :), etc) and 4D(Moving 3D) The three types of Interpolate functions you would most likely use are Linear(fastest, blocky looking), Cosine(Good Detail, good speed) and Cubic(slowest, but the smoothest, more complex to implement). Aside from creating the Noise and Interpolating it, another function that you would most likey want to implement is a smoothing algorithm. If you have ever written a Image smoothing filter, or a Fire Algo, you should be familiar with the process. Hopefully I explained enough for you to figure out Perlin Noise. Cheers, Dan McG