X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fnoise.hpp;h=4c26de92eadf0ae3bacd679cc069e0337bf27861;hb=b368ecb2c0f34e27b1d3b97cceb218b554dee324;hp=30bf5279defb3d36b5f2fed5548135d25a561191;hpb=f62562b0f87d571bd7b32ae2f8ca659c24e9911b;p=blank.git diff --git a/src/noise.hpp b/src/noise.hpp index 30bf527..4c26de9 100644 --- a/src/noise.hpp +++ b/src/noise.hpp @@ -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