spherical-volume-rendering / svr-algorithm

A spherical volume rendering algorithm that performs ray casting through a spherical voxel grid.
Other
6 stars 7 forks source link

Optimize initializeVoxelBoundarySegments() for orthographic case. #127

Closed cgyurgyik closed 4 years ago

cgyurgyik commented 4 years ago

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).

cgyurgyik commented 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?

matthewturk commented 4 years ago

I think it will not be uncommon for ray origins to be outside the sphere. But it may not need to be prioritized now.