RE: Perlin Noise - Early demo release was ( - Texture Generator)

new topic     » goto parent     » topic index » view thread      » older message » newer message

I am trying to program it the way you told me. In the meantime, I've found a
fast, easy algorithm to something similar. I'd like that you test it in
order to see if the results are somewhat similar.
The idea is old and very simple. It is called "exponential smoothing" and
works as follows, assuming it is applied to sound (it seems not too
difficult to extend it to images):
Let us call x[t] (t = 1, 2, 3,... n) the samples generated at, for example,
44100 each second. Let us say that z is a randomly generated number
between -32768 and 32767 ( z = rand(65536) - 32769). Then:
x[t+1] = z * alpha + x[t] * (1.0 - alpha)
where alpha is a coefficient between 0 and 1.
The output consists in the integer part of x[t] for successive t's.
The generated sound has a main frequency that decreases with alpha. It
reminds me the "space" noise in the film 2001.
Regards.
----- Original Message -----
From: <dm31 at uow.edu.au>
To: EUforum <EUforum at topica.com>
Sent: Tuesday, November 26, 2002 9:04 PM
Subject: RE: Perlin Noise - Early demo release was ( - Texture Generator)



|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

==^^===============================================================
This email was sent to: rforno at tutopia.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu