4
$\begingroup$

The voronoi texture itself comes with a distance to edge option, however it only lets you use the euclidean distance to edge. What I want is the distance to edge for the Manhatten and Chebichev voronoi types and preferebly the Minkowski voronoi type.

I know that you can do the F2-F1 trick, however it is only an approximation of the actual distance to edge and not really precise.

So does anyone know how to get the exact distance to edge for those types of voronoi textures?

$\endgroup$

1 Answer 1

2
$\begingroup$

If someone wonders about the F2-F1 trick, here's one way to do it:

$\endgroup$
6
  • $\begingroup$ Hi, MVB .. (I've gone and +1'd it now.. but..) I guess this just about squeaks into being an answer, but would it be better as an "as shown below" edit of OP? Since this is specifically what is not being asked for? $\endgroup$
    – Robin Betts
    Feb 5, 2023 at 19:10
  • $\begingroup$ @RobinBetts I'm not 100% sure that's what tempdev nova meant by F2-F1 so that's one reason not to edit the question 🤔 I just had this problem and of course googled it, found no solution so I shared my workaround, maybe it would be better as a comment. $\endgroup$ Feb 5, 2023 at 20:23
  • $\begingroup$ That would mean losing the lovely pictures :) , and the demo... The problems of F2-F1 nicely described here, along with a couple of GLSL solutions, from scratch. Let's say a squeak is good enough .. and useful to others, too :) $\endgroup$
    – Robin Betts
    Feb 5, 2023 at 20:47
  • $\begingroup$ Your F2-F1 seems much more sophisticated than just simply subtracting the F1 Distance from the F2 Distance. Could you please elaborate on your implementation? $\endgroup$ Feb 5, 2023 at 21:25
  • $\begingroup$ @tempdevnova what it does is it looks at the position of F2 and moves current position some distance towards F2 to sample if it will end up in F2's cell, if so, it's considered to be near edge with F2. It doesn't actually tell you the distance, therefore it's a bit offtopic. Sadly you can't iterate to do something similar to raymarching known from SDFs… Link provided by R.B. unfortuntely also shows a solution relying on loops. $\endgroup$ Feb 6, 2023 at 16:51

You must log in to answer this question.

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