News for hackers. Stuff that matters.
Re:Show HN: 3D Meshes of Signed Distance Functions in Python by fogleman on Tuesday February 16, 2021 @10:58PM (#26162487)
Can they load an STL?
Re:Show HN: 3D Meshes of Signed Distance Functions in Python by jmiskovic on Wednesday February 17, 2021 @03:53AM (#26164216)
I don't think rendering is the end goal here - the bigger potential is real-time manipulation of SDFs similar to Dreams geometry editor.

As for rendering, the SDF can be rasterized in shader, or it can be cube-marched to mesh and rendered in standard pipeline. It would be great to hear your opinions on both methods in context of real-time graphics.

Edit: Here's a video of Dreams shape manipulation https://youtu.be/D4Kk36oqGMY?t=589

Re:Show HN: 3D Meshes of Signed Distance Functions in Python by hjaarnio on Wednesday February 17, 2021 @04:45AM (#26164577)
By rasterizing the SDF in the shader, are you referring to slicing multiple planes through the volume and sampling the function in the shader (as described in https://developer.nvidia.com/gpugems/gpugems/part-vi-beyond-...), or some other technique I'm not aware of?
Re:Show HN: 3D Meshes of Signed Distance Functions in Python by user-the-name on Wednesday February 17, 2021 @05:09AM (#26164743)
Well-formed SDFs are extremely efficient to raycast.

The basic idea is that if you evaluate the SDF at a given point, you get the distance to the nearest surface. Thus, you know it is safe to step that far in any direction without crossing a surface. So you can step along a ray with a step size determined by the SDF at each point to quickly converge on a surface.

Re:Show HN: 3D Meshes of Signed Distance Functions in Python by jmiskovic on Wednesday February 17, 2021 @05:18AM (#26164797)
That is a good explanation of ray casting with ray marching as optimization. Here is interactive implementation from Quilez: https://www.shadertoy.com/view/Xds3zN

How would you end up with badly-formed SDFs?

Re:Show HN: 3D Meshes of Signed Distance Functions in Python by user-the-name on Wednesday February 17, 2021 @05:39AM (#26164929)
Honestly, most SDFs you use in practice will be badly formed. Creating a well-formed SDF is very, very hard, and only possible in a few special cases.

So in practice what you try to do is find an SDF that is not TOO far off from what it should be. Ideally, it should always have an absolute value that is equal to or less than (but not by too much) the real, ideal SDF.

Re:Show HN: 3D Meshes of Signed Distance Functions in Python by andybak on Wednesday February 17, 2021 @09:48AM (#26166841)
Depending on your goals - the failure modes of non-well-formed SDFs are often quite interesting. ;-)