density_grid_bitfield and density_grid_mean #353
Replies: 1 comment
-
Hi there, the occupancy bitfield uses a single bit per cell of the density grid to either mark that cell as occupied (1) or as empty (0). As such, one byte (8 bits) can hold the occupancy of 8 cells of the density grid, hence the division by 8. The mean computation is your typical parallel sum reduction (along with a division by the number of elements to turn the sum into a mean). Parallel reduction on the GPU is somewhat tricky to make efficient, which is probably why the implementation looks confusing. It's ultimately a mish-mash of some of the techniques described here: https://developer.download.nvidia.com/assets/cuda/files/reduction.pdf Lastly, Cheers! |
Beta Was this translation helpful? Give feedback.
-
Hi, I read the code and I got lost in the density_grid_bitfield and density grid mean.
I am confused about what is density_grid_bitfield. As the size is density_grid.size()/8. It seems to combines 8 grids into one big grid and to test whether the 8 smaller grids in the bigger cube are larger than the threshold.
I am also quite confused about the density_grid_mean which is used for the threshold after min(0.01f, density_grid_mean). It is calculated after the sum_reduce operation with the input of density_grid. But I am a little confused about how it is calculated.
instant-ngp/src/testbed_nerf.cu
Line 2445 in 833f730
Many thanks.
Beta Was this translation helpful? Give feedback.
All reactions