Presented here without commentary, but feel free to get in touch if this interests you.

Input data: convex brushes, thin area portals, spawn coordinates

Input data

Step 1: break map up into non-overlapping convex brushes and visleaves

Pass 1

Step 2: add extra vertices to remove T-junctions

Pass 2

Step 3: flood fill reachable areas & visleaves

Pass 3

Step 4: assign visible geometry to areas delimited by portals, throw away the rest

Pass 4