Page 1 of 1

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

Posted: Fri Sep 19, 2025 12:06 am
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 186 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 186 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.

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

Posted: Fri Sep 19, 2025 6:08 pm
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 111 times