YueJiang-nj / CVPR2020-SDFDiff

SDFDiff: Differentiable Rendering of Signed Distance Fields for 3D Shape Optimization
275 stars 19 forks source link

Congratulation and some question #1

Closed lvjiahui closed 3 years ago

lvjiahui commented 4 years ago

Hi, Jiang Yue, Congratulation on your work! It is a clever idea to combine rendering with optimizing SDF.

Inmulti_view_code/code/main.py 754 line:
grid_res_update_x = grid_res_update_y = grid_res_update_z = voxel_res_list.pop(0) Eventually voxel_res_list will pop from an empty list and raise error.

YueJiang-nj commented 4 years ago

Sorry for the delay.. Thank you for pointing out the error. I have fixed it.

I wonder what if light move across the surface . To my understanding, SDF is not accurate during optimizing, so sphere marching might not guarantee that light never move across the boundary of the object.

Compared with other concurrent work for SDF-based diff rendering, our approach would never move across the boundary since in each ray matching step, we always move forward by the distance to the closest surface. This guarantees that we will never move across the boundaries. Other approaches often move across since they speeded up the renderer by moving more than the distance to the closest surface. We speeded up the renderer by only making the last step differentiable rather than the entire process differentiable. In this case, we actually get more accurate results.

The direct result of multi-view optimization seems a bit noisy (in rendering image), do you reconstruct the mesh from the SDF field? Please tell me if I missed something. Thanks!

Oh.. We actually don't need to reconstruct the mesh from SDF. It is noisy because some parameter tuning needs to be done. Sorry I forgot to save the parameters for my paper, so I lost the exact parameters I used for generating images in the paper now. But I changed a little bit now. You can try the current version to see whether it is better now. There are two kinds of parameters you can change:

  1. In the line: loss = image_loss[cam] + sdf_loss[cam] + Lp_loss you can make it weighted.. loss = a image_loss[cam] + b sdf_loss[cam] + c * Lp_loss and try different a, b, c. The surface would be smoother if you increase c.
  2. In the line: voxel_res_list = [8,16,24,32,40,48,56,64] You can add more intermediate resolutions in the list. It can also produce better results when we have more intermediate resolutions.
Kai-46 commented 3 years ago

I think I have the same question regarding "ray crosses the surface". The thing is, if some SDF values are not correct during optimization, then there's still a chance for the ray to cross the surface? By "not correct", I meant the voxelized SDF is not a mathematically valid SDF function.