Jump to content


- - - - -

Simplex noise. Skew.


7 replies to this topic

#1 Igrekun

    New Member

  • Members
  • Pip
  • 4 posts

Posted 03 October 2011 - 02:01 PM

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.

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 5309 posts
  • LocationSanta Clara, CA

Posted 03 October 2011 - 04:47 PM

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.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 Igrekun

    New Member

  • Members
  • Pip
  • 4 posts

Posted 03 October 2011 - 05:44 PM

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.e...002c36/ch02.pdf and http://webstaff.itn....implexnoise.pdf

#4 }:+()___ (Smile)

    Member

  • Members
  • PipPipPip
  • 169 posts

Posted 03 October 2011 - 07:21 PM

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

#5 Reedbeta

    DevMaster Staff

  • Administrators
  • 5309 posts
  • LocationSanta Clara, CA

Posted 04 October 2011 - 03:56 AM

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?
reedbeta.com - developer blog, OpenGL demos, and other projects

#6 Stainless

    Member

  • Members
  • PipPipPipPip
  • 582 posts
  • LocationSouthampton

Posted 04 October 2011 - 08:46 AM

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.

#7 Igrekun

    New Member

  • Members
  • Pip
  • 4 posts

Posted 04 October 2011 - 01:13 PM

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.

#8 }:+()___ (Smile)

    Member

  • Members
  • PipPipPip
  • 169 posts

Posted 04 October 2011 - 04:09 PM

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.
Sorry my broken english!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users