Closed foricee closed 1 year ago
After reading https://nvlabs.github.io/nvdiffrast/, I think I've found the solution
These codes are added in render/render.py, at the end of function render_mesh(), https://github.com/NVlabs/nvdiffrec/blob/main/render/render.py#L251
rast = layers[0][1]
tri_id_col = rast[..., 3]
visible_tri_id = torch.unique(tri_id_col[tri_id_col > 0]).long() - 1
visible_tri = mesh.t_pos_idx[visible_tri_id]
Is this the right way to extract all visible triangles?
Thank you for your interest in our work! Yes, the way you extract visible triangles is correct. Another thing you should need is https://github.com/NVIDIAGameWorks/kaolin/blob/6569ea3e89f3f70ec7885ec053d900653ade67f3/kaolin/ops/conversions/tetmesh.py#L105 which maps visible faces to tetrahedra.
Thank you for your interest in our work! Yes, the way you extract visible triangles is correct. Another thing you should need is https://github.com/NVIDIAGameWorks/kaolin/blob/6569ea3e89f3f70ec7885ec053d900653ade67f3/kaolin/ops/conversions/tetmesh.py#L105 which maps visible faces to tetrahedra.
It works. Thank you!
Thank you for your great works! While I have something not clear. Supplemental Material, at the end of the SDF Regularizer part, the paper writes:
My question is that how to define 'visible' in current training views. I've read the code, but still can't find the implementation. buffers['occlusion'] in dmtet.py seems like to be relative. But I'm not sure. Could you give me some other supplemental material or advices?