Auburn / FastNoise_CSharp

FastNoise C# Version
MIT License
368 stars 77 forks source link

Possible flaw in Simplex Noise #4

Closed Silentor closed 7 years ago

Silentor commented 7 years ago

Hello! I'm looking around for some coherent noise generation solution for landscape generator demo and have spotted a FastNoise C#. After some visualization tests I catch a some flaw in Simpex noise output.

Visualization screenshots: shaded http://take.ms/9QVGI wireframe http://take.ms/cG1bN

Noise params: Just 2D Simplex noise, 1 octave. Frequency - 0.002 Amplification - 100

Perlin noise doesn't produce visible artifacts for given parameters.

Auburn commented 7 years ago

What coordinates is this at?

Silentor commented 7 years ago

The stripes on first screenshot intersects in (0, 0) point. Checked 2d slice (x, 0, z) from Simplex 3D noise, it doesn't produce visible flaws. For all experiments used double precision, because its faster.

Auburn commented 7 years ago

I think this may be an issue in the 2D simplex algorithm, I checked several other 2D simplex implementations and they function they exact same as mine. It seems to be a rounding error along the simplex grid axis origins, and it's only noticeable at very tiny frequencies. The original simplex algorithm was only in 3D and 4D I think, the 2D version was created after by someone else. I'm wondering though if it may also be present in 3+ D just harder to notice since it is a line in 3D space not 2D. Not sure how to go about solving it.

Silentor commented 7 years ago

Just for curious have tried Open Simpex noise implementation from https://gist.github.com/digitalshadow/134a3a02b67cecd72181 (yes, I understand difference between original Simplex and Open Simplex methods) and there are no errors on same frequencies/amplifications. But this implementation is definitely slower. So I stick with FastNoise, if stripes will be really bother me - i will link FastNoise Simplex 3D SIMD to my C# project. Thanks for you work!