-
Notifications
You must be signed in to change notification settings - Fork 119
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
Worley noise has incomplete kernels #176
Comments
Thank you for pointing this out. Could you provide the settings that you used when you discovered this error? The way a basic implementation of Worley noise is supposed to work is that it divides the sampled space into squares with a size of 1/frequency, and then places a point in a random location within each square. It then takes the point you're asking for, finds the square that it's located in, and tests the surrounding squares for the nearest points.
The Worley noise was a direct conversion of the older functional implementation. It wasn't checked for correctness. |
Actually I discovered you need to consider exactly twelve points for 2D. See The screenshot I attached was given as an example of “correct” output in issue #175 (worley-linear-range_2d). It’s in the center-left of the image there. 3D forces us to expand the kernel to two layers in some cases, I haven’t worked it out. It is probably on the order of ~40 or so points… |
Did the math. Exactly 90 cells must be considered for 3D worley noise. Early exit is possible if the cells are checked in groups in a certain order. Working implementation: |
Sampling worley noise at half-kernels requires a minimum of eight generating points to be samples. Your library only wanders the control points around a disk of radius 0.5 instead of filling out the whole grid cell though, so it may be possible to only consider 6 points though I haven’t worked out the math.
The generating points marked with an X are missing from the kernel.
Here is an example of an artifact caused by this:
The text was updated successfully, but these errors were encountered: