6 ms·
> some of the established practice on generating SDFs from masks is incorrect SDFs are for some reason riddled with false beliefs. Earlier this year it drove m
by bun_terminator 2y ago
> some of the established practice on generating SDFs from masks is incorrect
SDFs are for some reason riddled with false beliefs. Earlier this year it drove me nuts to learn that boolean operations for SDFs are not correct
- like_any_other 2y ago> boolean operations for SDFs are not correct They're not?
- skykooler 2y agoThey return approximations which can be very slow to iterate over depending on how far off of the actual value they are.
- ChadNauseam 2y agoI mentioned it in another comment, but Inigo Quilez has a page on this: https://iquilezles.org/articles/sdfxor/ https://iquilezles.org/articles/sdfxor/.
- edflsafoiewq 2y agoWhat do you mean by "boolean operations for SDFs are not correct"?
- kevingadd 2y agoMost of them are approximations instead of exact, so they can produce incorrect SDFs.
- msk-lywenn 2y agoHow would you even do a boolean operation over two distances ?
- ChadNauseam 2y agoInigo Quilez (who is basically the CEO of SDFs in my book) has a page on this: https://iquilezles.org/articles/interiordistance/ https://iquilezles.org/articles/interiordistance/. The goal isn't boolean operations over distances themselves, because as you point out that makes no sense. What you often want though is boolean operations over the surfaces the functions are returning the distance to. For example, you have one function that gives the distance to the surface of a sphere, and another that gives the distance to the surface of a cube, and you want to AND them, to get a function that gives you the distance to whichever surface is closer. That explanation probably doesn't make any sense, so just check out the page I linked which has some great visualizations.
- ww520 2y agoIt's important to use the correct names for things. Using the boolean lingo AND/OR/XOR to describe distance function operations just creates confusion. For example in this case, getting the distance to whichever closer surface is not an AND operation. It's a UNION operation, including the surfaces from both objects. Even if using the boolean lingo, it's more like the OR operation, cube OR sphere. It's best to use the set lingo UNION/INTERSECTION/DIFFERENCE.
- msk-lywenn 2y agoThat makes much more sense indeed
- ww520 2y agoI believe the "boolean" operations is really set operations - union, intersection, subtraction, etc.