nerfacc icon indicating copy to clipboard operation
nerfacc copied to clipboard

Issue with pack_info

Open kzhang2 opened this issue 1 year ago • 1 comments

Hi,

I needed to hack the nerfacc framework into my custom rendering pipeline, which required me to manually modify the ray_indices variable that gets passed around the various rendering functions from within the framework. However, I discovered that pack_info requires that ray_indices is contiguous with respect to indices, which is somewhat problematic for me. More specifically, suppose we have ray_indices=[0, 0, 1, 1, 0, 1]. Then pack_info(ray_indices, n_rays=2) will return the torch.Tensor

[[0, 3],
 [3, 3]]

implying that the first three samples are on ray 0 and the second three samples are on ray 1, but my actual desired behavior is for the system to recognize that the first, second, and fifth samples are on ray 0 and the third, fourth, and sixth samples are on ray 1. At this point, I know that I can do some torch indexing magic to get around this, but I think it might be a good idea for the documentation about ray_indices to be updated so other people like me who are trying to incorporate components of nerfacc into custom rendering pipelines don't fall into the same trap.

kzhang2 avatar Feb 12 '23 14:02 kzhang2

Thanks for pointing this out. Yeah having that marked on the doc would be nice. I will try to find some time to do it.

liruilong940607 avatar Feb 17 '23 06:02 liruilong940607