1 #ifndef BLANK_NOISE_HPP_
2 #define BLANK_NOISE_HPP_
14 // seed should be non-zero
15 explicit GaloisLFSR(std::uint64_t seed);
21 void operator ()(T &out) {
22 constexpr int num_bits =
23 std::numeric_limits<T>::digits +
24 std::numeric_limits<T>::is_signed;
25 for (int i = 0; i < num_bits; ++i) {
28 out = static_cast<T>(state);
33 // bits 64, 63, 61, and 60 set to 1 (counting from 1 lo to hi)
34 static constexpr std::uint64_t mask = 0xD800000000000000;
38 /// (3D only) adaptation of Stefan Gustavson's SimplexNoise java class
42 explicit SimplexNoise(unsigned int seed);
44 float operator ()(const glm::vec3 &) const;
47 unsigned char Perm(size_t idx) const;
48 const glm::vec3 &Grad(size_t idx) const;
51 unsigned char perm[512];
57 /// implementation of Worley noise (aka Cell or Voroni noise)
61 explicit WorleyNoise(unsigned int seed);
63 float operator ()(const glm::vec3 &) const;
66 const unsigned int seed;