Auburn / FastNoiseLite

Fast Portable Noise Library - C# C++ C Java HLSL GLSL JavaScript Rust Go
http://auburn.github.io/FastNoiseLite/
MIT License
2.79k stars 327 forks source link

Weird artifacts in noise #38

Closed sietse85 closed 4 years ago

sietse85 commented 4 years ago

Sorry don't know where else to ask. Can't find the solution in the Wiki.

See this screenshot: https://i.gyazo.com/142f9f83cf4b5fe35d5c28800edc4a37.jpg If you look closely you see weird loose artifacts all over.

Code used for generation of Noise


            _fastNoise.SetSeed((int) seed);
            _fastNoise.SetNoiseType(FastNoise.NoiseType.PerlinFractal);
            _fastNoise.SetFractalLacunarity(0.9f);
            _fastNoise.SetFractalGain(0f);
            _fastNoise.SetFractalOctaves(30);
Auburn commented 4 years ago

Hi there, it seems you are using a very weird noise settings. First off you have 30 octaves which is a huge amount and will make the noise generation very slow and anything past about 8 octaves will have almost no noticeable difference. Secondly you have gain at 0, meaning that all of the octaves will effectively be ignored.

If you want to submit an issue please reproduce it in the FastNoise Preview tool, since the issue you are seeing may be caused by other factors.

sietse85 commented 4 years ago

In the end it was entirely my fault. 2 threads were settings the SetFrequency functions at different values and thats how i ended up with the artifacts.

Thread A public float GetNoise(float x, float z) { _fastNoise.SetFrequency(0.02f); float noise = _fastNoise.GetNoise(x + 0.01f * (seed / 10000f) + seed , z + 0.01f * (seed / 10000f) + seed );

Thread B (using same FastNoise instance.) public float GetTerrainNoise(float x, float z) { _fastNoise.SetFrequency(0.90f); float noise = _fastNoise.GetNoise(x - 1f / 2 - seed, z - 10f / 2 - seed);

Major DERP from my side. Issue can be closed.