Replies: 1 comment 3 replies
-
We have related discussions in #561, in short the problem is that a lot of useful SDFs are not really distance functions. The reliable thing is just the change of sign. So this seems not general enough. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @elalish,
What an awesome library! I was playing around with the SDF generation capabilities and I noticed that on rotated geometry, the Marching Tetrahedra algorithm creates jagged edges.
I understand the reason and thought of a correction algorithm that may help correct this. I tried to visualize the algorithm in the following picture.
The algorithm would loop through all faces that have any edge that is smaller than the grid step size (which is a criterion that kind of encodes problematic regions) and calculates the normal vector of the SDF at the midpoint. The correction is then a projection of the triangle vertices to the plane created by the normal vector of the SDF and a chosen vertex of the current triangle, which acts as an anchor. This anchoring vertex could be the one that has a vertex normal that is most aligned with the SDF vector.
I would like to get your thoughts on this 🙂
Beta Was this translation helpful? Give feedback.
All reactions