Reputeless / PerlinNoise

Header-only Perlin noise library for modern C++ (C++17/C++20)
MIT License
673 stars 77 forks source link

How to make infinite worlds #9

Closed MartinTintin3 closed 2 years ago

MartinTintin3 commented 2 years ago

I noticed that all the functions require normalized coordinates from 0 to 1, but how do I normalize coordinates if I have an infinite world? This is very important and kind of counterintuitive, since Perlin noise is used for infinite world generation a lot...

Reputeless commented 2 years ago

Perlin noise repeats every 256 units in each coordinate direction (noise(0.1, 2.3, 4.5) == noise(256.1, 258.3, 260.5)) You can produce non-repeating results by synthesizing multiple noise functions or manually controlled influences. Related article: https://developer.nvidia.com/gpugems/gpugems3/part-i-geometry/chapter-1-generating-complex-procedural-terrains-using-gpu (see 1.3.3 and 1.3.4)