Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Why do some meshes produce artifacts in distance fields?
#1
Some models always generate these artifacts in their distance field, and I don't understand why. I played around with the max error and depth parameters, but they never fully go away. I don't think the model is faulty either, it's fairly simple and I made sure that there are no holes, wrongly oriented faces or duplicate vertices in the mesh. This is what it looks like:

https://imgur.com/a/3Y61QRY

And here's a link to the model I used:

https://skfb.ly/otJIJ
Reply
#2
Hi!

The mesh is probably just too small/thin to reliably tell if a point in the sdf is inside or outside of it. This is exacerbated by creased edges, since they are physically different vertices in memory (with the same, or close to same position, but different normals) which can be interpreted as disjoint surfaces.

Scaling your mesh x5 made the artifacts go away. Note that colliders using distance fields can be uniformly scaled just fine, so a workaround to this is to generate the distance field using a scaled up version of your mesh, and then scale its transform down on the scene.
Reply
#3
Thanks, the field looks fine now. Just removing the creased edges already made a huge differnence by itself, I'm saving backup versions of my models with simple geometry before detailing from now on to later generate distance fields from them.
Reply