ashawkey / torch-ngp

A pytorch CUDA extension implementation of instant-ngp (sdf and nerf), with a GUI.
MIT License
2.11k stars 275 forks source link

Possible bug and difference between scale and resolution? #153

Closed Guptajakala closed 1 year ago

Guptajakala commented 1 year ago

https://github.com/ashawkey/torch-ngp/blob/b6e080468925f0bb44827b4f8f0ed08291dcf8a9/gridencoder/src/gridencoder.cu#L138

What's the difference between scale and resolution? Shouldn't they both refer to the number of voxels along one dimension?

And here you are trying to get the voxel center, why do you add 0.5 when align_corners is false? https://github.com/ashawkey/torch-ngp/blob/b6e080468925f0bb44827b4f8f0ed08291dcf8a9/gridencoder/src/gridencoder.cu#L148

ashawkey commented 1 year ago

@Guptajakala Hi, scale is float and resolution is int, it follows the original implementation's notation. For the second one, you may refer to this.