Perlin

Started by
3 comments, last by swiftcoder 14 years, 11 months ago
Ive been looking into how Perlin Noise is created and have been looking at the following links, but they all seem to implement it a little differently. http://mrl.nyu.edu/~perlin/noise/ http://freespace.virgin.net/hugo.elias/models/m_perlin.htm For example, the second links works with Persistance and Octaves, and Perlins code doesnt mention any of these, but mentions functions such as Grad and Fade, but doesnt mention octaves or persistance. Could someone tell me if my understanding is correct. 1. Creat many different textures, of the same size, of random noise at different resolutions. say 16x16, 32x32, 64x64x 128x128 2. Add them all up I have a few questions though 1. When adding them on top of each other, whats to stop the image from being blown out?, arent the numbers all intergers from 0-255? 2. How do you create the lower resolution images? If the image size is 256x256, do you just divide the size by the res, and create noise values for each of those, and interpolate the pixels inbetween?
Advertisement
Quote:Original post by maya18222
1. When adding them on top of each other, whats to stop the image from being blown out?, arent the numbers all intergers from 0-255?
This is what octaves are for. Each resolution is called an octave, and is multiplied by a magnitude so that the sum of magnitudes is less than one (although in the end the values are centered around zero, so if using integers this would be -127, 128 instead of 0, 255). Also, I wouldn't advise using integers because of precision issues when interpolating and scaling.

Quote:2. How do you create the lower resolution images?
If the image size is 256x256, do you just divide the size by the res, and create noise values for each of those, and interpolate the pixels inbetween?
Yes, you interpolate.
Quote:Original post by maya18222
Ive been looking into how Perlin Noise is created and have been looking at the following links, but they all seem to implement it a little differently.

http://mrl.nyu.edu/~perlin/noise/
http://freespace.virgin.net/hugo.elias/models/m_perlin.htm

For example, the second links works with Persistance and Octaves, and Perlins code doesnt mention any of these, but mentions functions such as Grad and Fade, but doesnt mention octaves or persistance.
Note that Hugo Elias (the second link) isn't actually describing Perlin noise at all. He uses some variety of 'value noise' as a basis function, and the function he calls perlin noise is in fact an implementation of 'fractal brownian motion'. Value noise is fairly fast, but very poor quality as compared to Perlin (or even better, Simplex) noise.

The first link is an implementation of Perlin noise itself, but Perlin noise is just a basis function, and thus not terribly interesting on its own. You can use a variety of mono-fractal and multi-fractal functions (the most common being Fractal Brownian Motion) to combine successive octaves of a the basis function and create interesting images.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

So Perlin Noise doesnt use the technique of adding multiple layers togeather to produce the final result?

That would make sense, as in perlins implementation, i couldnt see any mention of looping through, it seems to return the result in one iteration. But how come googling Perlin Noise, always brings up the links showing the addition of multiple layers to produce the final effect?

Do you know of any links that explain what Grad and Fade are doing in perlins code?

Would the above code, from perlin, produce the following?
http://infohost.nmt.edu/~imcgarve/perlin_noise/perlin_noise2.jpg

or does it need to be layered first?
Quote:Original post by maya18222
So Perlin Noise doesnt use the technique of adding multiple layers togeather to produce the final result?

That would make sense, as in perlins implementation, i couldnt see any mention of looping through, it seems to return the result in one iteration. But how come googling Perlin Noise, always brings up the links showing the addition of multiple layers to produce the final effect?

Would the above code, from perlin, produce the following?
http://infohost.nmt.edu/~imcgarve/perlin_noise/perlin_noise2.jpg

or does it need to be layered first?
That image is created using fractal brownian motion to combine layers of perlin noise. When generating fractals, you need two things: basis functions, and fractal functions.

Basis functions (such as perlin noise) produce fairly uniform noise, and as such are not visually interesting.

Fractal functions (such as fractal brownian motion) combine multiple layers of a given basis function, to produce very complex patterns.

There are many, many different varieties of both basis and fractal functions - perlin and fractal brownian motion just some of the most popular. Take a look here, for an overview and basic explanation of many different fractals.
Quote:Do you know of any links that explain what Grad and Fade are doing in perlins code?
How solid is your math background? In laymans terms, a value noise technique (such as that shown by Hugo Elias) interpolates between values, whereas perlin noise is a gradient noise, where one interpolates between gradients. The advantage of interpolating gradients is that it offers much better continuity in the first derivative, resulting in 'smoother' noise.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

This topic is closed to new replies.

Advertisement