]> git.localhorst.tv Git - blank.git/blobdiff - src/noise.hpp
added distance fog
[blank.git] / src / noise.hpp
index 30bf5279defb3d36b5f2fed5548135d25a561191..4c26de92eadf0ae3bacd679cc069e0337bf27861 100644 (file)
@@ -19,11 +19,26 @@ private:
        const glm::vec3 &Grad(size_t idx) const;
 
 private:
-       unsigned char perm[256];
+       unsigned char perm[512];
        glm::vec3 grad[12];
 
 };
 
+
+/// implementation of Worley noise (aka Cell or Voroni noise)
+class WorleyNoise {
+
+public:
+       explicit WorleyNoise(unsigned int seed);
+
+       float operator ()(const glm::vec3 &) const;
+
+private:
+       const unsigned int seed;
+       const int num_points;
+
+};
+
 }
 
 #endif