Added FBM 3D & 4D and HybridMultiFractal 2D + cleaned code

this commit will change the scale of values produced by fbm2d. This will
probably not happen again. As a consequence, fbm values will always be
constrained between -1 and 1, but do not perfectly stick to that scale.
There is no easy solution, if the user wants the best dynamic between -1
and 1, he should adjust manually the value by multiplying by a gain slightly superior to 1.


Former-commit-id: ebdba9e9f4bbb972abe355c07ec9f8bce42329b9
This commit is contained in:
Remi Beges
2012-11-09 18:38:50 +01:00
parent 7bd6202389
commit 8f04f3e6a0
10 changed files with 270 additions and 28 deletions

View File

@@ -17,13 +17,13 @@ NzComplexNoiseBase::NzComplexNoiseBase()
for (int i(0) ; i < m_octaves; ++i)
{
exponent_array[i] = 0;
m_exponent_array[i] = 0;
}
}
const std::array<float, 30>& NzComplexNoiseBase::GetExponentArray() const
{
return exponent_array;
return m_exponent_array;
}
float NzComplexNoiseBase::GetLacunarity() const
@@ -80,11 +80,10 @@ void NzComplexNoiseBase::RecomputeExponentArray()
for (int i(0) ; i < static_cast<int>(m_octaves) ; ++i)
{
exponent_array[i] = std::pow( frequency, -m_hurst );
m_exponent_array[i] = std::pow( frequency, -m_hurst );
frequency *= m_lacunarity;
//m_sum += 1.0f/exponent_array[i];//A tester
m_sum += exponent_array[i];
m_sum += m_exponent_array[i];
}
m_parametersModified = false;