[Genhis][2.0.66] voronoi noise functions don't always find the nearest point

Hanodest
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sun Aug 11, 2024 10:55 pm
Contact:

[Genhis][2.0.66] voronoi noise functions don't always find the nearest point

Post by Hanodest »

For demonstration of the issue I used noise expression

Code: Select all

if(x >= 320 & x < 512 & y >= 128 & y < 320,
  voronoi_spot_noise{x = x, y = y, seed0 = 241014965, seed1 = 0, grid_size = 64, distance_type = 1, jitter = 1},
0)
(3x3 grid squares of voronoi spot noise on a fixed seed). It was visualized with noise tools using

Code: Select all

noise_debug.tiles_to_visualisation("visualisation", 0, 2, "greyscale")
Here's the result of the visualization:
noise_raw.png
noise_raw.png (5.1 KiB) Viewed 187 times
The problem can be seen at the bottom of the top middle square, marked with the green arrow
noise_annotated.png
noise_annotated.png (19.18 KiB) Viewed 187 times
For these points only the points generated in the same and the neighbor squares are checked for being the nearest (the ones marked with yellow arrows, plus 3 squares above that aren't relevant here). Because they are all in the far corners, the actual nearest point is the one marked by the red arrow, which is two squares below. But it doesn't get checked, as can be seen from both gradient of the expression and the jump in the value at the border of the square (the horizontal line just below green arrow).

The same exact problem seems to affect all types of voronoi noise functions.
Hanodest
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sun Aug 11, 2024 10:55 pm
Contact:

Re: [2.0.66] voronoi noise functions don't always find the nearest point

Post by Hanodest »

Here's probably a better visualization.

Code: Select all

abs(
    voronoi_spot_noise{x = x, y = y, seed0 = 241014965, seed1 = 0, grid_size = 64, distance_type = 1, jitter = 1} -
    voronoi_spot_noise{x = x, y = y + 1, seed0 = 241014965, seed1 = 0, grid_size = 64, distance_type = 1, jitter = 1}
) * 64
Because of triangle inequality, any shift by 1 tile should change the value of voronoi_spot_noise by at most 1/grid_size, so this expression should be all in range [0,1]. But it's not:
voronoi_gradient.png
voronoi_gradient.png (10.67 KiB) Viewed 112 times
Post Reply

Return to “Assigned”