Presented here without commentary, but feel free to get in touch if this interests you.
Input data: convex brushes, thin area portals, spawn coordinates
Step 1: break map up into non-overlapping convex brushes and visleaves
Step 2: add extra vertices to remove T-junctions
Step 3: flood fill reachable areas & visleaves
Step 4: assign visible geometry to areas delimited by portals, throw away the rest