]> git.localhorst.tv Git - blank.git/blobdiff - src/world/Generator.cpp
block type prototypability and new types
[blank.git] / src / world / Generator.cpp
index 466139b8943a4fadc1187736e6b29509d462642b..edb7e9caa51bc879ec7181c66153710dc5e24a34 100644 (file)
@@ -91,6 +91,8 @@ Block Generator::Generate(const glm::vec3 &pos) const noexcept {
                return Block(0);
        }
        float random = GetValue(random_noise, pos, config.randomness);
+       // as weird as it sounds, but this is faster tham glm::fract and generates a
+       // better distribution than (transformed variants of) erf, erfc, atan, and smoothstep
        if (random < 0.0f) random += 1.0f;
        float value = random * total;
        // TODO: change to binary search