Closed cgyurgyik closed 4 years ago
Also wanted your thoughts on this. Is this a common case that we should tackle, where all ray origins are knowingly outside the spherical volume?
Is it not worth the time?
I think it will not be uncommon for ray origins to be outside the sphere. But it may not need to be prioritized now.
Currently, we call initializeVoxelBoundarySegments() once per ray. If we're following an orthographic projection, we know the ray will always enter through the outermost radius, and thus the boundary segments will be the same for each ray. Then, we can call initializeVoxelBoundarySegments() once in SphericalVoxelGrid.
This is pretty simple to tackle. We always need to calculate pMaxAngular, pMaxAzimuthal; this is done in SphericalVoxelGrid. In the algorithm, we just need to check if the ray origin is outside the grid. If it is, we know pAngular == pMaxAngular (similar for azimuthal).