3 float PerlinNoise2D::linearInterpolation(
float a,
float b,
float t)
5 return a + t * (b - a);
12 long long randVal = generator(i, j);
13 float angle =
static_cast<float>(randVal % 360) * 3.14159f / 180.f;
18 float PerlinNoise2D::fade(
const float& t)
20 return t * t * t * (t * (t * 6 - 15) + 10);
30 float u = localCoord.
x;
31 float v = localCoord.
y;
45 float dot00 = d00.
dot(g00);
46 float dot10 = d10.
dot(g10);
47 float dot01 = d01.
dot(g01);
48 float dot11 = d11.
dot(g11);
55 float ix0 = linearInterpolation(dot00, dot10, fu);
56 float ix1 = linearInterpolation(dot01, dot11, fu);
57 float value = linearInterpolation(ix0, ix1, fv);
float sample(const float &x, const float &y)