# How does Smooth F1 Voronoi work mathematically?

I’m told that Smooth F1 Voronoi uses Smooth Minimum to visually smooth out the Voronoi Edges.

But how does it do that? I know the math behind Smooth Minimum and F1 Worley Noise, but how does Smooth Minimum selectively smooth out the Voronoi Edges instead of the top or bottom of the Voronoi Diagram?

(F1 Worley Noise) (F1 Worley Noise with separate Minimum node applied)

(F1 Worley Noise with separate Smooth Minimum node applied)

(Smooth F1 Worley Noise)

You can see that the separate Minimum function slices the top of the displaced Voronoi Diagram, but to make that slice looks more organic, we can use Smooth Minimum (smin) instead of Minimum (min). smin literally does the same job as min, it also visually smooth out the sharp corners generated by min.

So, Smooth F1 Voronoi is different to F1 Voronoi + Smooth Minimum. Please help me understand what the math behind Smooth F1 Voronoi is. Also, what is “Smoothness” input? Is it the same as parameter “Distance” of Smooth Minimum?

Thank you!

• Nice question, nice answer. :) Commented May 23, 2023 at 8:23

It uses a weighted sum of neighbour voronoi cells. Hopefully the below code helps?

ccl_device float smooth_step(float edge0, float edge1, float x)
{
float result;
if (x < edge0)
result = 0.0f;
else if (x >= edge1)
result = 1.0f;
else {
float t = (x - edge0) / (edge1 - edge0);
result = (3.0f - 2.0f * t) * (t * t);
}
return result;
}


Source - GitHub commit:

https://github.com/blender/blender/commit/613b37bc2c81202a34346b40465923e8f47cebbf