What is faster for 3D? Perlin or simplex noise?

Well, there are many comparisons on the Internet between Perlin and Simplex noise. But I really could not find one where there was a simple comparison of processing time for three dimensions that interests me the most. I read that the popular PDF (and even understood most of it is yay!), But I can not answer the simple question: which one is faster for 3D, subject to optimal implementation?

This https://stackoverflow.com/a/2129778/2/9138/2/3/9/11/13/7713/.jpg This Simplex is a pretty clear winner for my case. Of course, there are other resources that require the exact opposite.

However, the general statement, apparently, is that Perlin noise has complexity O (2 ^ N), and Simplex has O (N ^ 2). What for 3D will mean 8 for Perlin and 9 for Simplex. But , on some site, I found a statement that Simplex is actually O (N). So what does it mean true, and what does this mean for speed in 3D?

I am in difficulty here, I am really interested in a 3D application (for randomly creating terrain, including caves), and I cannot find a good answer to the question which one should I use if I want it to be as fast as possible.

So maybe someone can help me here :)

+4
source share
2 answers

1) http://www.fundza.com/c4serious/noise/perlin/perlin.html
2) http://www.6by9.net/b/2012/02/03/simplex-noise-for-c-and-python

Runtime in "my laptop" for 8M noise samples using these two implementations: (g ++ -O6)

1) 1.389, i.e. 5.7 million operations per second 2) 0.607 s, i.e. 13.2 million operations per second

But...

When really, really for optimization, you need to study

  • Higher level optimization (what is really done at each stage: are there any alternatives?)
  • Branches
  • Memory models
  • Dependencies
  • LUT Dimensions
  • Separate arithmetic operations, their delays and throughput are needed.
  • operational concurrency using SIMD
  • number of living variables
+9
source

Simplex noise looks better, but not necessarily faster. It all depends on the implementation. As a rule, this is "about the same speed", and there should not be a large penalty for using any option if your code is good.

Note that most of the code I wrote that floats on the Internet is not optimized for speed, but written for clarity. The GLSL implementations from Ian McEwan and me a couple of years ago were reasonably optimized for speed, but they were optimized for equipment that is now deprecated, and versions of GLSL that were current at the time. Important changes to GLSL since then include integer types and bitwise logical operations, which makes some of the hash functions uncomfortable and unnecessarily complex. The need for polynomial permutation was due to the lack of bitwise logical operators in GLSL. It is still missing from GLSL for WebGL, but all other platforms now have full support.

4D simplex noise is faster in most cases than 4D classic noise. All other cases depend on the language, platform, and amount of code optimization.

Simplex noise has a simple analytic derivative. Classic noise is more complicated in this regard. In many cases, like smoothing and mapping terrain, an analytical derivative is very useful.

+2
source

Source: https://habr.com/ru/post/1437971/


All Articles