Simplex Noise - Summation

672 views Asked by At

I have been reading this article as requested by Nathan Reed on Programmers.StackExchange. After some reading I stumbled upon a paragraph I really don't get. Can anyone explain this paragraph to me in a more simple language? (English is not my native language) If you want to read the original you can find it under "Moving from interpolation to summation".

Simplex noise instead uses a straight summation of contributions from each corner, where the contribution is a multiplication of the extrapolation of the gradient ramp and a radially symmetric attenuation function. In signal processing terms, this is a signal reconstruction kernel. The radial attenuation is carefully chosen so that the influence from each corner reaches zero before crossing the boundary to the next simplex. This means that points inside a simplex will only be influenced by the contributions from the corners of that particular simplex.

1

There are 1 answers

0
stewbasic On

I’ll need to step back a bit and define some notation, so apologies for not getting straight to that paragraph.

For both classical Perlin noise and simplex noise, to get the value at a point x, the steps are:

  • Find the vertices x_1,...,x_k of the cell containing x, where the cell is a square or cube (etc) for Perlin noise, and a triangle or tetrahedron (etc) for simplex noise.
  • For each vertex x_i, generate a random unit vector n_i, and compute grad(x_i,x) = (x-x_i) dot n_i This is the “gradient ramp” mentioned in the paragraph.
  • Combine these together with some weights, so the output is

    w_1 * grad(x_1,x) + … + w_k * grad(x_k,x)

The paragraph describes how to generate the weights w_i. For Perlin noise, the weights linearly interpolate (ignoring smoothing), so they always add to 1. For simplex noise, we can see how w_i is computed in the code later in your link; it’s

w_i = max(0.6 - d_i^2, 0)^4,

where d_i = |x-x_i| is the distance from x to x_i. This is the “radially symmetric attenuation function”. It’s radially symmetric because it only depends on the distance, not the direction of x-x_i. Attenuation just means it decreases as d_i increases.

The second half of the paragraph says that when we cross a boundary between two simplices, and replace one of the neighbours, say x_1, with a different vertex x_1’, the coefficient w_1 should become 0, so that the values match up at the boundary. This ascii diagram may or may not clarify:

1--2
| /|
|/ |
3--1’

The noise value is

w_1 grad(x_1,x) + w_2 grad(x_2,x) + w_3 grad(x_3,x)

in the top left triangle and

w_1’ grad(x_1’,x) + w_2 grad(x_2,x) + w_3 grad(x_3,x)

in the bottom right triangle. For these to match, w_1 and w_1’ should be zero on the boundary.