Razaekel / noise-rs

Procedural noise generation library for Rust.
Apache License 2.0
854 stars 120 forks source link

[BUG] Simplex Noise generates Artifacts #325

Closed isiko closed 1 year ago

isiko commented 1 year ago

I'm trying to generate Simplex Noise, but there it has some weird Artifacts.

I'm using the following Code to create and sample a PlaneMapBuilder:

let luma_map = PlaneMapBuilder::new_fn(|point, nh| simplex_2d(point.into(), nh).0, &hasher)
    .set_size(width as usize, height as usize)
    .set_is_seamless(tiling)
    .build();

for y in 0..height {
    for x in 0..width {
        let luminance: f64 = luma_map.get_value(x as usize, y as usize) / 2. + 0.5;
        // Insert sample into Image
    }
}

The resulting output for 100x100 Image looks like this for me: export

Lazauya commented 1 year ago

Also seeing this issue. It looks like it's probably selecting gradients incorrectly in the obtuse corners.

Razaekel commented 1 year ago

This should be fixed in eee47438e3b8cc64d02f7416592d19a69be78b4e.