Archived

This topic is now archived and is closed to further replies.

omega_001

Perlin Noise and Fractal Algorithms

Recommended Posts

I''m trying to understand how to generate fractal algorithms but I''m not that brillant on math terms. Does anyone know what perturb means and what its function is e.g. its mathematical expression/formula. Also does anyone have any advice or source code (I find it easier to learn if I can see the code and then break it down)on how to create Perlin Noise e.g. with GL_POINTS or texturing to quad. Thanks in advance Kiel.

Share this post


Link to post
Share on other sites
I don''t know anything about fractals

But for perlin noise you actually generate a texture procedurally. What I''d do is make a .RAW format file in memory (which is basically an array of RGB values) and load it in just like I would for a .RAW file. If you need help loading the texture into memory I believe there is a NeHe tutorial about loading .RAW files.

Hope this helps

Share this post


Link to post
Share on other sites
How do I generate the texture? Say on an empty texture of 128 by 128 pixels.

Could you provide any answer with some sort of source code as I would only be guessing what to do otherwise.

Thanks in advance Kiel

Share this post


Link to post
Share on other sites
To generate the texture its as simple as this:


  

char texImageData[128][128][3];



Or you can even allocate it dynamically. Then when you upload the texture to vid memory (you know, using glTexImage2D and such) you just pass that as the data, and 128 for the width and height.

Now to generate the noise is a whole different topic. I highly recommend this site:

http://freespace.virgin.net/hugo.elias/models/m_perlin.htm

It shows you everything you''ll need to know, from the pseudo random number generator to the smoothing.

Good luck

Share this post


Link to post
Share on other sites