NVlabs / instant-ngp

Instant neural graphics primitives: lightning fast NeRF and more
https://nvlabs.github.io/instant-ngp
Other
16k stars 1.93k forks source link

Is it possible to export mesh from NGLOD SDF? #776

Closed StillSpeedo closed 2 years ago

StillSpeedo commented 2 years ago

Hi!

When using config takiwawa.json and trying to build mesh, I got strange results.

Here is rendered SDF, and it is ok:

takiwawa_sdf

Mesh:

takiwawa_mesh

Mesh for same object, but using hashgrid.json:

ingp_mesh

I believe that's because NGLOD is only defined within the octree and wondering is it possible to export clear mesh? The question arises because NGLOD achieves better visual quality than I-NGP as mentioned in the paper and after all optimizations has comparable speed.

Thanks in advance!

Tom94 commented 2 years ago

Hi there, unfortunately I don't see an obvious way to determine inside vs. outside for vertices that don't touch the triangle octree (as used in NGLOD) and so marching cubes (the mesh generation algorithm) will fail. For now, I've disabled the "Mesh it!" button if such an octree is used to prevent unexpected results like the one you've encountered: https://github.com/NVlabs/instant-ngp/commit/46a8cb0104725d3a8985a1aa5fa6f7bcf21d6fff

Good chance I'm missing an obvious tweak to marching cubes that'll make it work without snapping to the octree resolution -- please feel free to re-open the issue if there is one and I'll implement the corresponding fix.