Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
697 views
in Technique[技术] by (71.8m points)

processing - What is the intent of using 4D OpenSimplex Noise instead of 2D Perlin Noise to create a looping noise?

While I was learning about ways to create a looping generative art GIF, I encountered two different ways of making noise loops.

  1. Etienne Jacob's example code in his tutorial uses 4D OpenSimplex Noise as follows.

    (float)noise.eval(scl * x, scl * y, R * cos(TWO_PI * t), R * sin(TWO_PI * t));

  2. Daniel Shiffman's example code in his tutorial uses 2D Perlin Noise as follows.

    noise(cos(a) + 1, sin(a) + 1);

Golan Levin's work

What I understand is that both achieves the loop by "walking in circle" in the noise space like above gif. But the difference between two are unclear to me. What is the intent of choosing 4D OpenSimplex over 2D Perlin Noise to create a looping noise?

question from:https://stackoverflow.com/questions/65540942/what-is-the-intent-of-using-4d-opensimplex-noise-instead-of-2d-perlin-noise-to-c

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

2D noise can yield a 1D loop. 4D noise can yield either a 2D plane that loops in both directions (different example), or an unlooping 2D plane with a looping time axis (this example). Basically, it takes two unlooping dimensions to create one looping one.

The 4D example produces a looping 1D line at each (x, y) point on the image, but the difference is that you can vary that (x, y) to generate a 2D image that itself animates over time. With the looping line yielded by the 2D noise, you only have that line itself. The (x, y) come from the two extra dimensions of the 4D noise.

Also, Perlin shows a lot of 45 and 90 degree bias. Simplex is a lot better in that regard, and I designed OpenSimplex to satisfy that too. Perlin works fine for the looping 1D line, but if you're using the 2D noise to produce a 2D result, then you'll see that bias.

I will however suggest that you now use OpenSimplex2 instead of OpenSimplex (shameless plug), because it is supposed to be more uniform over the space. Esp. OpenSimplex2S, which is a direct replacement to 2014 OpenSimplex.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...