Razaekel / noise-rs

Procedural noise generation library for Rust.
Apache License 2.0
842 stars 118 forks source link

[BUG] RidgedMulti not seeding sources properly #330

Closed Nebulous5 closed 1 year ago

Nebulous5 commented 1 year ago

Hello,

I'm using noise 0.8.2 and RidgedMulti. Though RidgedMulti::new() takes in a seed, it does not appear to be seeding its sources correctly and is generating identical noise regardless of seed.

Here is my test, the assertions fail.

`use noise::{NoiseFn, SuperSimplex};

[cfg(test)]

mod tests { use super::*;

#[test]
fn test_ridged_multi(){
    let n1: noise::RidgedMulti<noise::SuperSimplex> = noise::RidgedMulti::new(10); //Seed 10
    let n2: noise::RidgedMulti<noise::SuperSimplex> = noise::RidgedMulti::new(99); //Seed 99

    let x1 = 19.0;
    let y1 = 22.0;

    let x2 = 19445.0;
    let y2 = 22445.0;

    //Should output different noise for the same points
    //Assertions fail
    assert_ne!(n1.get([x1, y1]), n2.get([x1,y1]));
    assert_ne!(n1.get([x2, y2]), n2.get([x2,y2]));
}

} ` tests.rs.txt

Razaekel commented 1 year ago

This was fixed in commit b41d966b3e78199bfd6dd4efd6f257244d70f9bb, which has not been released yet.

Nebulous5 commented 1 year ago

Ok, I did not realize a fix was already in the works. Thank you for the quick response and for the hard work.