nerf icon indicating copy to clipboard operation
nerf copied to clipboard

A question about the trick of ndc_rays

Open ttaoREtw opened this issue 3 years ago • 1 comments

Hi all experts, I am confused why the near is set to tf.cast(1., tf.float32) here.
In the NeRF paper it states the origin is shifted to the near plane, does this mean that it always assumes the near plane starts from z=-1? (Appendix C in NeRF paper: NDC ray space derivation)

# In func render()
if ndc:
    # for forward facing scenes
    rays_o, rays_d = ndc_rays(
        H, W, focal, tf.cast(1., tf.float32), rays_o, rays_d)

Thanks in advance for the kindly answer and discussion

ttaoREtw avatar Jul 16 '22 15:07 ttaoREtw

At some point, they scale the translation of all the poses by 1/near (they use min value of bds), which essentially moves the nearest point to a distance of 1. I think they also use bd_factor to make the nearest point at 1.33 and then use near=1, may be for better sampling.

NagabhushanSN95 avatar Jul 22 '22 10:07 NagabhushanSN95