4 ms·
So signed distance functions turn out to be quite hard to design for more complicated shapes. You can cheat by having the distance far aware from the surface be
by etaioinshrdlu 7y ago
So signed distance functions turn out to be quite hard to design for more complicated shapes. You can cheat by having the distance far aware from the surface being not quite accurate -- but there are limits to how much you can cheat before you have unwanted rendering artifacts such as blobs or holes.
"Boolean" operations on these signed distance fields pretty much always cheat, except for Union, which can be done with a max(a,b) operation.
Deep Learning can be used to attempt to learn a function approximating a true signed distance field for a shape. https://deepai.org/publication/deepsdf-learning-continuous-signed-distance-functions-for-shape-representation https://deepai.org/publication/deepsdf-learning-continuous-s...
I think signed distance fields may turn out to be significantly better than old school raytracing if we can have super-optimized distance field functions!
- Arelius 7y agoSo, it turns out you can actually loose quite a lot of accuracy at distance and not end up with artifacts so long as your accuracy is guaranteed to overestimate the distance to the surface, it will take a bit more time to converge on the surface, but it shouldn't impact the image itself. (Assuming you let the march converge all the way to the limit surface of course, and don't have a maximum steps.)
- kevingadd 7y agoThe union operator also produces incorrect distances for the interior of the union volume, which is a problem for things like shadow cone tracing. See http://iquilezles.org/www/articles/interiordistance/interiordistance.htm http://iquilezles.org/www/articles/interiordistance/interior..., I've actually been struggling with this in my SDF implementation. I'm still a big fan of the union operation since GPU rasterizers can trivially hardware accelerate it, which means you can render a bunch of objects in one go and know that it will be performed at near-optimal efficiency by the GPU. I've been combining that with a packing technique to render 3 depth slices at once in RGB (plus an extra duplicate slice in A) so that I can accurately sample any point in space with a single bilinear texture read.