#ifndef CG1_TRACER_WORLEYNOISE_H #define CG1_TRACER_WORLEYNOISE_H #include #include "common/vector3d.h" #include "noise.h" // Based on: https://www.youtube.com/watch?v=4QOcCGI6xOU class WorleyNoise : public Noise { public: WorleyNoise(int size, int numberOfPoints); protected: int numberOfPoints; std::vector points; // Points in 3D space in [0, 1] std::uniform_real_distribution distribution; std::mt19937 generator; Vector3d getRandomPoint(); float distanceToClosestPoint(Vector3d point); float repeatableDistanceToClosestPoint(Vector3d point); void generateNoise(); }; #endif //CG1_TRACER_WORLEYNOISE_H