Razaekel / noise-rs

Procedural noise generation library for Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting octaves to any value above 6 causes crash with Fbm.

Merlin1846 opened this issue · comments

Whenever I set octaves above 6 the program crashes with this error.
thread 'main' panicked at 'index out of bounds: the len is 6 but the index is 6', /home/REDACTED/.cargo/registry/src/github.com-1ecc6299db9ec823/noise-0.7.0/src/noise_fns/generators/fractals/fbm.rs:138:30
There doesn't seem to be anything saying that 6 is the limit though. Is this a bug or just a lack of documentation? Or am I just doing something wrong?

let noise:Fbm = Fbm::new().set_seed(seed);
noise.octaves = 6;
//Does not crash
let noise:Fbm = Fbm::new().set_seed(seed);
noise.octaves = 7;
//Crashes

https://github.com/Razaekel/noise-rs/blob/develop/src/noise_fns/generators/fractals/fbm.rs
According to this, the max octaves should be 32. Is there a set_octaves() function I'm missing?

The maximum number of octaves is 32, but you need to use the set_octaves() method to increase the number beyond the default of 6. set_octaves is provided by the MultiFractal trait. See #229.