0

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 :)

MrDrProfessorTyler
  • 403
  • 2
  • 10
  • 26
  • What exactly is your question? There is (pseudo-)code on the page you linked which shows how to deal with perlin including persistence. You may directly translate this into any language you like. – Howard Dec 26 '11 at 16:45
  • Yes I know but I am having a problem understanding it completely. I translated it into Java completely but I am having a problem understanding exactly how it works out mathematically. I need some sort of clear explanation of how the process works. – MrDrProfessorTyler Dec 26 '11 at 17:27

1 Answers1

2

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.

Howard
  • 38,639
  • 9
  • 64
  • 83