3

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?

W268
  • 65
  • 4

1 Answers1

5

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.

KdotJPG
  • 811
  • 4
  • 6
  • Thank you for the very clear answer. So 4D noise can either yield a sphere shaped model that loops in both directions on its surface, or a doughnut shaped model that has a looping 1D cross section that also loops moving along the doughnut (time). Is my understanding correct? – W268 Jan 03 '21 at 05:27
  • 1
    Technically the one that loops in both directions is torus (doughnut) shaped, just a 4D torus that lacks the kind of distortion you get from mapping a 3D torus to a square. The 2D+time looping noise is more like an infinite cylinder, but with a second copy of the infinite direction so you can create a 2D looping pattern instead of just a 1D one. – KdotJPG Jan 03 '21 at 07:31
  • 1
    To cover a sphere with noise, all you need is 3D noise, to map every point on the sphere. – KdotJPG Jan 03 '21 at 07:35