What is the randomness quality of Perlin / Simplex Noise algorithms?

What is the randomness quality of the Perlin Noise algorithm and the Simplex Noise algorithm?

Which algorithm of the two has the best chance?

Compared to standard pseudo-random generators, does it make sense to use Perlin / Simplex as a random number generator?

Update: I know what Perlin / Simplex Noise is used for. I'm only curious about randomness.

+6
source share
4 answers

As stated in the "Random Number Statistics", AI Game Wisdom 2 , the question that produces the "best" randomness depends on re using it for. Typically, the quality of a PRNG is compared using test batteries. During printing, the author points out that the most famous and most widely used test batteries for checking PRNG randomness are ENT and Diehard . Also see related questions on how to check random numbers and why random randomness tests seem ad-hoc .

Besides the standard testing problems of typical PRNGs, testing Perlin noise or simplex noise as a PRNG is more difficult because:

  • And internally, PRNG is required, so the underlying PRNG affects the randomness of their output.
  • Most PRNGs do not have configurable parameters. In contrast, Perlin noise is the summation of one or more functions of coherent noise (octave) with constantly increasing frequencies and constantly decreasing amplitudes. Since the final image depends on the number and nature of the octaves used, the quality of randomness will change accordingly. libnoise: modifying noise modulus parameters
  • An argument similar to # 2 is used to change the number of measurements used in simplex noise, because "the 3D section of 4D simplex noise is different from 3D simplex noise." Stefan Gustavson Simplex noise is demystified .
+3
source

Perlin noise and simplex noise are designed to create usable noise, not completely random noise. These algorithms are usually used to create landscape-processed landscapes, etc. For example, it can generate terrain such as this (image here ):

Terrain generated from perlin noise

In this image, noise generates a 2D elevation map such as this (image from here ):

Heightmap generated by perlin noise

Each pixel color represents a height. After creating a height map, rendering is used to create a landscape corresponding to the "heights" (colors) of the image.

Therefore, the results of the algorithm are not really “random”; There are many easily distinguishable patterns, as you can see.

The simplex supposedly looks a little “better," which implies less randomness, but its main purpose is that it produces similar noise, but scales to higher dimensions. That is, if you were to produce 3D, 4D, 5D noise, simplex noise would exceed Perlin noise and get similar results.

If you want a pseudo random number generator generator, check out Mersenne twister or other prngs . Be careful cryptography, prngs may be full of reservations.

Update:

(answer to an updated OPs question)

Regarding the random properties of these noise functions, I know that perlin noise uses a (very) bad person as input and does some smoothing / interpolation between adjacent “random” pixels. Random randomness is actually just pseudo-random indexing into a precomputed random vector.

An index is calculated using some simple integer operations, nothing unusual. For example, the noise ++ project uses the precomputed "randomVectors" (see here ) to get the original noise and interpolate between different values ​​from this vector. It generates a “random” index into this vector with some simple integer operations, adding a small amount of pseudo-randomness. Here is a snippet:

int vIndex = (NOISE_X_FACTOR * ix + NOISE_Y_FACTOR * iy + NOISE_Z_FACTOR * iz + NOISE_SEED_FACTOR * seed) & 0xffffffff; vIndex ^= (vIndex >> NOISE_SHIFT); vIndex &= 0xff; const Real xGradient = randomVectors3D[(vIndex<<2)]; ... 

Some random noise is then smoothed out and actually mixed with neighboring pixels, producing patterns.

After creating the initial noise, perlin / simplex noise has the concept of octave noise; that is, shifting the noise onto itself at different scales. This gives even more patterns. Thus, the initial noise quality is probably as good as before the calculated random arrays, plus the effect of pseudoscientific indexing. But after all that perlin noise does to it, the apparent randomness is greatly reduced (it really spreads over a wider area, I think).

+5
source

I think you are confused.

perlin and simplex take random numbers from some other source and make them less random, so that they look more like natural landscapes (only random numbers don't look like natural landscapes).

therefore, they are not a source of random numbers — they are a way of processing random numbers from another place.

and even if they were a source, they would not be a good source (numbers are strongly correlated).

+3
source

DO NOT use perlin or simplex for accident. they are not intended for this. they / app / chance.

people choose them for their visual appeal, which has not yet been sufficiently discussed, so I will focus on this.

Perlin / Simplex with smooth pitch are perfectly smooth. no matter how far you get closer, they will always be a gradient, not a vertex or an edge.

output range (+ / - 1/2 x # sizes), so you need to compensate for this to get it in the range from 0 to 1 or -1 to 1, if necessary. fix it is standard. adding octaves will increase this range by an octave scaling factor (usually, of course, this is half the larger octave).

Perlin / simplex noise has an odd quality: brown noise when increasing and blue noise when decreasing. neither one nor the average zoom is particularly good for prng purposes, but they are great for simulating natural phenomena (which are not actually random and /// biased).

both perlina and simplex noise tend to be displaced along the axes, while perlin has several more problems in this area. edit: getting rid of even greater bias in three dimensions is very difficult. it is difficult (impossible?) to create a large number of unbiased points on the sphere.

Perlin results tend to be round with an octagonal offset, while simplex tends to generate ovals with a hexagonal offset.

a piece of a simplex of a higher dimension is not like a simplex of a lower dimension. but the 2nd piece of 3d hawser looks almost the same as the 2nd hawser.

most people think that a simplex cannot actually work with higher dimensions — it tends to “look worse and worse” for higher dimensions. Perlin supposedly does not have this problem (although it still has a bias).

I believe that after "octavation" they have the same triangular distribution of the output when layered (similar to a roll of 2 dice) (that is, love, if someone can double check this for me.) And therefore both benefit from smoothing. this is standard. (It is possible to bias the results for the same output, but it will still have dimensional biases that will not pass prng quality tests due to the high spatial correlation, which is // a feature, not an error.)

note that the octave technique is not part of the definition of perlin or simplex. it's just a trick often used with them. perlin and simplex blending gradients at evenly distributed points. the octaves of this noise combine to create larger and smaller structures. it is also often used in the “noise value”, which uses mainly white noise equivalent to this concept, instead of perlin noise. the value of noise with octaves will also show / even worse / octagonal displacement. hence why Perlin or simplex are preferred.

simplex is faster in all cases - / especially / in large sizes.

Thus, a simplex solves perlin problems in both performance and visual elements, but creates its own problems.

0
source

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


All Articles