n/fractal: increment fractal pos between octave

given summation occurs with only scaling of positions between octaves,
points around the origin are likely to remain self-similar between
octaves. but nudging the point out range of the origin's unit surrounds
we can avoid degenerate highlights.
This commit is contained in:
Danny Robson 2015-06-17 03:06:05 +10:00
parent d9f4f5116c
commit 7b9a01c790
4 changed files with 5 additions and 0 deletions

View File

@ -67,6 +67,7 @@ namespace util { namespace noise { namespace fractal {
for (size_t i = 0; i < this->m_octaves; ++i) {
total += this->m_basis (p) * scale;
p += T{1};
p *= this->m_lacunarity;
scale *= this->m_invGH;
}

View File

@ -77,6 +77,7 @@ namespace util { namespace noise { namespace fractal {
result += increment;
p += T{1};
p *= this->m_lacunarity;
}

View File

@ -77,6 +77,7 @@ namespace util { namespace noise { namespace fractal {
weight = min (weight, T{1});
scale *= this->m_invGH;
p += T{1};
p *= this->m_lacunarity;
}

View File

@ -91,6 +91,8 @@ namespace util { namespace noise { namespace fractal {
result += signal * scale;
scale *= this->m_invGH;
p += T{1};
p *= this->m_lacunarity;
}