Simplex noise. Skew.

C3642f8dc236c9815b7c95f68df24e85
0
Igrekun 101 Oct 03, 2011 at 14:01

Hi.

I’ve been trying to understand the inner workings of simplex noise for two weeks. All the papers I found tell about obvious stuff, and don’t explain much more important concepts in my opinion.

I would be very glad if someone explain me how the grid is skewed. I’ve read Ken papers, all Gustavson articles. No success. Maybe I’m dumb and should stop making games.

Can someone show with pictures and explanations how do they get all those weird numbers like F2 = 0.366 and others. Not just “The factor has to be sqrt(n+1)”, but exactly why the factor has to be like this.

My algorithm works ok, but I just don’t want to use something I don’t understand.

Thanks in advance.

7 Replies

Please log in or register to post a reply.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Oct 03, 2011 at 16:47

I don’t understand all the details, but I believe simplex noise uses a tetrahedral grid. Maybe that will give you some clue to work it out; some of the numbers are likely related to factors like the ratio of a tetrahedron’s height to its side length, etc.

C3642f8dc236c9815b7c95f68df24e85
0
Igrekun 101 Oct 03, 2011 at 17:44

Studied the tetrahedral grid. Still can’t figure out how they find the factors for 2D, 4D. Maybe you can understand it better. This are the best papers I’ve found so far http://www.cs.umbc.edu/\~olano/s2002c36/ch02.pdf and http://webstaff.itn.liu.se/\~stegu/simplexnoise/simplexnoise.pdf

6eaf0e08fe36b2c23ca096562dd7a8b7
0
__________Smile_ 101 Oct 03, 2011 at 19:21

When n-dimensional hypercube squeezed by a factor of sqrt(n+1) along main diagonal that diagonal become equalized with hypercube edges.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Oct 04, 2011 at 03:56

Igrekun, that second article you posted seems to be fairly in-depth as to how each step of the algorithm works. If you look at the diagram at the top of page 6, that tells the whole story of how the grid is set up, doesn’t it? Is there something *specific* you are having trouble with?

B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 Oct 04, 2011 at 08:46

If you are having problems understanding why a particular variable is a particular value, try changing it.

Generate a bitmap, save it, change variable to zero, generate bitmap, save it, change variable to maximum, generate bitmap, save it.

Compare three bitmaps.

Or if you have the noise function as a shader, make the constant a variable and alter it on the fly.

I use simplex noise all the time, and I don’t care how it works. I know what it looks like when I feed it various inputs and how to get the result I want from it, but I really don’t care about anything else.

If you need to fully understand everything you use, you will NEVER get anywhere.

After all by the time you have FULLY understood windows 7, the universe will have descended into chaos, the stars gone cold, and we would all be sitting at the restaurant at the end of the universe waiting for the appearance of the great prophet Zarkwan.

C3642f8dc236c9815b7c95f68df24e85
0
Igrekun 101 Oct 04, 2011 at 13:13

First of all, thanks for all your replies. This is the only place I’ve got answers.

The only thing that confuses me is F2 and G2 coeff. I got it why the factor has to be sqrt(n+1) for n dimensions. The part that makes the most trouble is when they set F2 to be F2 = (sqrt(n+1)-1)/n. Then s = (x+y+z)*F2. The rest is clear and quiet understandable.

6eaf0e08fe36b2c23ca096562dd7a8b7
0
__________Smile_ 101 Oct 04, 2011 at 16:09

Scaling along vector v by the factor A can be done by the following formula:

y = x + B(xv)v, where B = (A - 1) / (vv).

For the scaling by the factor 1/sqrt(n+1) along main diagonal vector {1,1,…,1} we have

B = (1/sqrt(n+1) - 1) / n.

For the scaling by the factor sqrt(n+1) (reverse transformation) we have

Binv = (sqrt(n+1) - 1) / n.