Hi folks,
I have data binned into a sparse grid of axis-aligned voxels, and I was trying to think of how best to calculate the LOD needed for each voxel. The obvious approach in my mind would be to transform the corners of the voxel's AABB into screen space, and then use that pixel size to determine the LOD. This mostly works great, except that the voxel could be large, and be some combination of the following edge cases:
- some of the corners may be behind the clipping plane (so they might contribute a larger pixel size than the visible part of the voxel)
- some of the corners may be behind the focal point of the camera (and so they are reflected in the final image)
- some of the corners might actually be in the visible frustrum, so I can't just ignore the voxel in the above cases
So, is there a good way to handle the above case? Or is there a better way to calculate some LOD for a voxel? I've seen hackish methods that make all kinds of assumptions about the projection matrix. However, I need a solution that is pretty general, and would work with pick matrices and things with shear, etc.
Thanks for reading. Any ideas are greatly appreciated.
Dave