facebookresearch / neuralvolumes

Training and Evaluation Code for Neural Volumes
Other
420 stars 52 forks source link

Is there a way to render a 3D file from this? #10

Closed arlorostirolla closed 1 year ago

arlorostirolla commented 1 year ago

Hello, I was wondering if there is a way to export an .obj/,fbx file along with corresponding materials from this? If not, do you have any suggestions as to how to go about that if I were to try extend the code to incorporate that functionality?

stephenlombardi commented 1 year ago

Hi, There's no canonical way to produce an obj with materials from this. There are two reason for this: the first is that the model uses a dense volumetric representation of opacity values to represent the geometry of the scene whereas obj uses a triangle mesh. The second is that the model doesn't learn any materials or BRDFs, it just learns the color of the object (also in a dense volumetric representation).

To generate a mesh from this, one simple way would be to threshold the opacity values and then apply marching cubes. However this might miss some of the geometry depending on how you threshold. Depending on the quality of result you're looking for, this might be okay.

However, if what you want is a mesh I would recommend just using NeuS which learns a signed distance function and then performs marching cubes on it to produce a mesh. It's a bit more suited for this purpose. NeuS won't give you materials, however. There are some papers out trying to recover BRDFs with these volumetric models but I don't think they're at the point of spitting out a obj/fbx quite yet (at least not to my knowledge).