Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Worley Noise generates similar pattern regardless the seed #326

Open
isiko opened this issue May 30, 2023 · 0 comments
Open

[BUG] Worley Noise generates similar pattern regardless the seed #326

isiko opened this issue May 30, 2023 · 0 comments

Comments

@isiko
Copy link

isiko commented May 30, 2023

The Worley Noise Generation has a Bug were it generates the same pattern in some areas, regardless the seed

I'm instantiating a PlaneMapBuilder and sampling from it like this:

let noise_fn = Worley::new(seed)
    .set_frequency(frequency as f64)
    .set_return_type(if use_distance_fn { ReturnType::Distance } else { ReturnType::Value })
    .set_distance_function(match distance_function {
        DistanceFunction::Euclidean => distance_functions::euclidean,
        DistanceFunction::EuclideanSquared => distance_functions::euclidean_squared,
        DistanceFunction::Manhattan => distance_functions::manhattan,
        DistanceFunction::Chebyshev => distance_functions::chebyshev,
        DistanceFunction::Quadratic => distance_functions::quadratic,
    });

let luma_map = PlaneMapBuilder::<_, 2>::new(noise_fn).set_size(width as usize, height as usize).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;
    }
}

When I take the resulting Image using 3 different Seeds and combine them by writing them to the RGB channels of a new Image, I get the following: (Using 50 as the Frequency and the 0, 1 and 2 as the seeds)

Untitled Document

You can see that there is an area near the Center where the Image is basically black and white, this happens no matter what seed you enter, although it gets a little bit more random with bigger seeds. Also, there are Patterns above and below that seem to be quite repetitive, I think there might also be a bug there.

@isiko isiko changed the title [BUG] Worley generates same pattern regardless the seed [BUG] Worley Noise generates similar pattern regardless the seed May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant