For every sub-sector I come across in the tree I'm supposed to test its bounding box against the frustum and then "clip" it and check if the screen is "full". If the screen is "full" the BSP reader stops(this is the speed part).
My frustum culling stuff isn't the best, but it works 99% of the time(the other 1% it draws nothing...). The problem now is testing wether the screen is "full". After looking at the source to several ports it seems the idea is to test the angles between the camera position and the line vertices and see if they're in the field of view, then write to some kind of 1D buffer.
Red is the camera and frustum, 1 and 2 are sub-sectors, and the green lines are the angles to test.
Anyone have any idea how to do this? I've been trying for a week to implement my own as well as converting the code from other ports, but have yet to find one that works. A massive rate++ to anyone with the solution(or some cookies if I've already rated you).
Not to disappoint in the screenshot department, here's a nice high-res one.
(warning the whole thing is about 1MB in size)