PDA

View Full Version : Perlin Noise? - How simple is it ?? or should I say complex???

tinak
09-15-2002, 07:42 PM
I ask this because after doing a search on these forums nearly every page mentioning this keeps pointing you to KenPerlins tutorial slide. I took a look it and saw all those great textures apparently created using this Perlin function. However, apart from looking at these weird formulas I have no idea how they can be implemented into a program.

I understand that you pick a point and then work through a series or values on each of its neighbouring point and affect them in some way. Are these points pixels on the screen and the affect adjustment of the colours at that pixel?

Is there a small simple piece of code that demonstrates the basics of this so that I can study this feature further? Or is there a more down to earth tutorial around?

Crossing fingers in hope and thanking in advance of any help someone can give me on this.

Tina

JML
09-15-2002, 11:35 PM
In CG (and many other fields) there is often a requirement for unpredictability to make scenes/textures etc. more interesting to look at.
However, using plain random number generators creates too much unpredictability to look nice. This form of noise is also called white noise.

In general noise functions take one, two, three or more input values and generate an output value based on those (and usually some initialising seed value(s)).
The output can also be one, two, three or higher dimensional.
Common uses are:
2 inputs --> 1 output (height-fields)
2 inputs --> 3 or 4 outputs (color plasma with/without alpha)
3 inputs --> 1 output (temperature in a volume)
etc.

There are several ways to create 'random' patterns that are less turbulent. Perlin Noise is one such way. It is a form of 'coherent random noise'. It is coherent because input values that are close to each other will produce results that are close to each other. That results in nice gradual changes in output.
It is random because the value for one set of input values is not (in an obvious way) related to the value for another (distant) set of input values.

What I find very nice about the Perlin noise functions is that there is hardly any discernible artificiality and repeatability in them, as opposed to the popular box-filter approach which leads to a very pronounced 'square-ness' of the output.

What you do with the noise output is entirely up to you: cloud generation, texture generation, movement/flow adjustment, density/probability-fields whatever...

I've not found many Perlin tutorials myself, but some interesting info can also be found looking for 'procedural textures' and 'cloud generation', as these are popular fields using Perlin noise functions.

HTH

Jean-Marc.

rIO
09-16-2002, 02:07 AM
Perlin Noise it's one of the common things you can find in CG, gotta LEARN it, before using some sample source code.
Anyway, here you are some good tutorials/samples :
http://students.vassar.edu/mazucker/code.html
http://www.angelcode.com/articles/perlin/perlin.asp
http://www.spinningkids.org/pan

tinak
09-16-2002, 03:15 AM
Thanks Guys,

I find I learn about things by tearing apart programs to see what makes them work... learnt something new already.. didn't realise you could actually texturise an object on the fly... I've been using ready made textures only. Yaay!

It seems I was on the right track with the setting of the color pixels based on certain cirumstances. With the help of Nate's GLUT based Procedural Texture Generator I'm on my way there and now I can manually set up pixels and render to the scene with newly randomised values and in multi colour too http://www.opengl.org/discussion_boards/ubb/biggrin.gif

Now time to look through those Perlin noise documents again to see how those formulas work with the pixels.

Thanks again

Tina

harsman
09-16-2002, 03:48 AM
There's a very good tutorial on Perlin Noise (http://freespace.virgin.net/hugo.elias/models/m_perlin.htm) by Hugo Elias.

pleopard
09-17-2002, 06:48 AM
Or ... go straight to the source ... Mr. Perlin himself, complete with source code ...

http://mrl.nyu.edu/~perlin/doc/oscar.html

pleopard
09-17-2002, 06:49 AM
oops ... double post ...

[This message has been edited by pleopard (edited 09-17-2002).]