I had a blog post on something similar (but less sophisticated)

https://jacobdoescode.com/2025/05/18/precomputing-transparen...

This is… essentially a BSP tree traversal without splitting polys that straddle a partition plane, right?