5
$\begingroup$

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) enter image description here (F1 Worley Noise with separate Minimum node applied)

enter image description here (F1 Worley Noise with separate Smooth Minimum node applied)

enter image description here (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!

$\endgroup$
1
  • $\begingroup$ Nice question, nice answer. :) $\endgroup$
    – Robin Betts
    Commented May 23, 2023 at 8:23

1 Answer 1

3
$\begingroup$

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

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .