nerfstudio-project / nerfacc

A General NeRF Acceleration Toolbox in PyTorch.
https://www.nerfacc.com/
Other
1.37k stars 113 forks source link

Inconsistency in the use of dirs and view_dirs when obtaining 3D points #170

Closed NagabhushanSN95 closed 1 year ago

NagabhushanSN95 commented 1 year ago

In the original nerf implementation, directions and views were two different variables. Essentially, views were unit vectors along directions. views were used as input to the second NeRF MLP, whereas directions were used to compute the location of 3D points as pts_loc = origins + t_vals * directions. But rays_marching() takes only the normalized views as input, which means the same is passed to sigma_fn and thus 3D point locations are computed as pts_loc = origins + t_vals * views.

Wouldn't this cause a problem? Or did I understand something incorrectly?

MMMazart commented 1 year ago

The t_vals in nerf are the distances in the z-axis direction, and t_vals * directions are translated into the actual distance between the two points. And nerfacc uses t_start and t_end to calculate the distance, which is the actual distance between two points.

NagabhushanSN95 commented 1 year ago

Thank you for the clarification.