Closed yyzzyy78 closed 1 year ago
This repo has a nice go-thru illustration of the algorithm of ray-voxel-traversal. The tmax
section is the answer for your question (you might need to read from the start to follow the flow).
Thanks,I will read it!
Thanks for the great work!
I'm confused about the function single_traversal. In the code, https://github.com/KAIR-BAIR/nerfacc/blob/master/nerfacc/cuda/csrc/include/utils_grid.cuh#L119 , it seems that the smallest component of tdist is chosen to march one step in the voxel. That means, if tdist.x <tdist.y<tdist.z, then the current_index will march one step in the direction of step_index.x. I don't understand why the smallest component is chosen.
For example, if a ray which basically parallels to the y-axis travels through the voxel(tdist.x&tdist.y&tdist.z!=0), and the hit voxels will travel along the y-axis. I think the tdist(tmax_xyz) means the distance emitted from the ray origin to the currently calculated voxel. In this case, the dist.x and dist.z will be smaller than dist.y, which means the voxel will travel along the x-axis or z-axis in the code. But I think the current_index voxel will go in y-axis only. Maybe I didn't understand the meaning of tdist(tmax_xyz). I am looking forward to your reply.