NVlabs / nvdiffrec

Official code for the CVPR 2022 (oral) paper "Extracting Triangular 3D Models, Materials, and Lighting From Images".
Other
2.09k stars 222 forks source link

Dose DMTet support irregular tet grids? #132

Closed fzy139 closed 11 months ago

fzy139 commented 1 year ago

Hi,

Thanks for your excellent work.

I wonder if the current DMTet implementation supports irregular tet grids, e.g. after subdivision of a subset of tets, so that it can produce more detailed geometry like the original DMTet paper shows.

Thanks

jmunkberg commented 1 year ago

Thanks,

No, the current code base assumes a regular tet grid. As you suggest, it should be possible to experiment with both uniform and non-uniform subdivisions, following the DMTet paper, but that is not supported in the current code base. Feel free to explore it!

fzy139 commented 1 year ago

I see. I've tried to apply the current dmtet code to irregular tet grids. It can still extract reasonable surfaces but there are lots of isolated faces inside the extracted mesh. Could you please give me some hints about how to modify the current dmtet code to work with irregular tet grids?

Thanks

frankshen07 commented 11 months ago

Hi @fzy139, MT cannot guarantee a watertight output with an irregular grid. In the original DMTet paper, we subdivide all surface tets (tets with different signs at the corners) and their one-ring neighbors. The unsubdivided cells are discarded, so the new grid remains "regular" in the sense that all cells have the same subdivision level. If you're planning to further optimize the SDF after subdivision, it's important to ensure there is no sign change at the grid boundary to avoid creating open surfaces. To achieve this, you can fix the SDF values at the grid boundary immediately after subdivision.

fzy139 commented 11 months ago

Thanks! Very helpful. I'll have a try.