3#include "resources/Texture.hpp"
26 void generate(
Image & image, uint channel,
float scale,
float z,
const glm::vec3 & offset = glm::vec3(0.0f));
38 void generatePeriodic(
Image & image, uint channel,
float scale,
float z,
const glm::vec3 & offset = glm::vec3(0.0f));
50 void generateLayers(
Image & image, uint channel,
int octaves,
float gain,
float lacunarity,
float scale,
const glm::vec3 & offset = glm::vec3(0.0f));
64 float dotGrad(
const glm::ivec3 & ip,
const glm::vec3 & dp);
73 std::array<int, 2*kHashTableSize>
_hashes;
Represents an image composed of pixels with values in [0,1]. Provide image loading/saving utilities,...
Definition: Image.hpp:8
Generate 3D perlin noise and multi-layered noise.
Definition: PerlinNoise.hpp:10
PerlinNoise()
Definition: PerlinNoise.cpp:5
Image _directions
random unit sphere directions.
Definition: PerlinNoise.hpp:74
float perlin(const glm::vec3 &p, const glm::ivec3 &w=glm::ivec3(kHashTableSize-1))
Definition: PerlinNoise.cpp:75
void generateLayers(Image &image, uint channel, int octaves, float gain, float lacunarity, float scale, const glm::vec3 &offset=glm::vec3(0.0f))
Definition: PerlinNoise.cpp:32
std::array< int, 2 *kHashTableSize > _hashes
Permutation table.
Definition: PerlinNoise.hpp:73
void generate(Image &image, uint channel, float scale, float z, const glm::vec3 &offset=glm::vec3(0.0f))
Definition: PerlinNoise.cpp:9
float dotGrad(const glm::ivec3 &ip, const glm::vec3 &dp)
Definition: PerlinNoise.cpp:69
static const int kHashTableSize
Number of hashes used for the generation, limit the periodicity.
Definition: PerlinNoise.hpp:57
void generatePeriodic(Image &image, uint channel, float scale, float z, const glm::vec3 &offset=glm::vec3(0.0f))
Definition: PerlinNoise.cpp:19
void reseed()
Definition: PerlinNoise.cpp:47