Question

There are not many easy-to-follow Perlin Noise tutorials out there and certainly not in Java or 2D. I followed this tutorial to a point but it doesn't explain 2D noise very much at all. I know you have to generate an array of numbers then interpolate them and everything. My problem is that I do not know how to implement frequency, persistence, or amplitude to help affect the outcome of the numbers. Can anyone give me some basic Perlin Noise functions or a link to a 2D Perlin Noise tutorial in Java or similar languages? Thanks!

EDIT: Can someone just briefly explain the process at least or how one implements the frequency, amplitude, and persistence to influence the generation? Please :)

Était-ce utile?

La solution

Amplitude and frequency are no free variables in the Perlin Noise generation. Instead they are parametrized by something called persistence.

The noise function is then the sum over several basic functions.

n(x) = sum( n_i(x*f_i) * a_i, i=0..N-1)

Each function is called octave and therefore numbered by the index i. The values f_i denote the frequencies and a_i the amplitudes. As mentioned before they are completely determined by the index i itself, parametrized by the persistence p:

f_i = 2^i
a_i = p^i

While each noise function n_i(x) is normalized for frequency 1 and amplitude 1, the overall term n_i(x*f_i) * a_i now has frequency and amplitude given by the expressions above.

In other words the noise function n(x) is the sum of octaves where the first one has frequency 1 and amplitude 1, the second one has frequency 2 and amplitude p, the third has frequency 4 and amplitude p^2, and so on.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top