Kai-46 / ARF-svox2

Artistic Radiance Fields
BSD 2-Clause "Simplified" License
524 stars 40 forks source link

how to render zdepth in cuda code? #12

Open zhw-github opened 2 years ago

zhw-github commented 2 years ago

Hi, I saw on github that you doublet the code of the original author of plenoxels. And see you want to optimize depth. This is relevant to my research.In svox2.py file,define a volume_render_depth function? I think this code is important: out_depth += (weight ((t / opt.step_size) * ray.world_step);How to change this code to render zdepth? But the original author said this is the absolute length along the ray, not the z-depth as usually expected.So how should I modify this code to get zdepth!

Kai-46 commented 1 year ago

Two things:

1) we did not optimize depth in this work. 2) an easy way to fulfill your goal might be to first render absolute length, and then apply a scaling factor to get zdepth. The scaling factor for each ray is the reciprocal of the L2 norm of unnormalized ray direction defined here: https://github.com/Kai-46/nerfplusplus/blob/ebf2f3e75fd6c5dfc8c9d0b533800daaf17bd95f/nerf_sample_ray_split.py#L26