You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When computing a fractal noise, the sum of all octaves is normalized by dividing it by the sum of the amplitudes of the octaves. Here's the code of the function which computes the normalizing factor amp_fractal:
fn calculate_fractal_bounding(&mut self) {
let mut amp: f32 = self.gain;
let mut amp_fractal: f32 = 1.0;
for _ in 0..self.octaves {
amp_fractal += amp;
amp *= self.gain;
}
self.fractal_bounding = 1.0 / amp_fractal;
}
The computed sum amp_fractal has one more term than the number of octaves. I believe this is wrong. For example, in the particular case where you have one octave only, it ends up rescaling the noise by dividing it by (1 + gain) as if we had two octaves when it should divide by 1 instead (i.e. no normalization needed since there's only one octave). This can be confirmed by looking at Auburn's original code.
The text was updated successfully, but these errors were encountered:
When computing a fractal noise, the sum of all octaves is normalized by dividing it by the sum of the amplitudes of the octaves. Here's the code of the function which computes the normalizing factor
amp_fractal
:The computed sum
amp_fractal
has one more term than the number of octaves. I believe this is wrong. For example, in the particular case where you have one octave only, it ends up rescaling the noise by dividing it by (1 + gain) as if we had two octaves when it should divide by 1 instead (i.e. no normalization needed since there's only one octave). This can be confirmed by looking at Auburn's original code.The text was updated successfully, but these errors were encountered: