Yesterday I posted a problem to math stack exchange that bothers me for a while now, and right after I've had a few exchanges on Twitter that inspired me to attempt a solution.
Basically, the problem is about a form of refined raytracing where we render a big list of convex 3D brushes (and I decided to start with Ellipsoids, since they're so useful) to the screen, without any precalculated accelleration structure. How does it work? Basically, if we had a way to figure out for a portion of the frustum whether it contained a brush, we could
- Start with a very low resolution
- Collect a list of ellipsoids contained in each tile, culling the ones we don't need
- Then subdivide each tile into four smaller tiles and repeat
- Until we hit per-pixel resolution, then we are done.
And this brings us to the problem: we want to solve for a tile on screen
- Whether an ellipsoid arbitrarily parametrized in world space is overlapping this tile
- What the near and far depth range of the overlapping portion is (important for culling, but also ray-space CSG)
- Whether the ellipsoid covers the tile fully (occludes its background completely, also important for culling)
- At which depth range the occlusion is 100% (so we can also cull overlapping ellipsoids)