The visibility of a planar set of n disjoint line segments, arising from the scanline approach to rendering three-dimensional scenes, is one of the classic problems in computer graphics. In order to solve the problem quickly, many authors proposed binary space partitioning (BSP) as a preprocessing, possibly breaking up the input line segments so that visibility is determined in time linear in the number of resulting segments. Tóth [Discrete & Comput. Geometry 30,1 pp. 3–16, 2003] demonstrated that a BSP may result in $\mathit{\Omega}(n \log n / \log \log n)$ line segments. We demonstrate that the time and space complexities of the problem are $\mathit{\Theta}(n\log n)$ and $\mathit{\Theta}(n)$ respectively, under the algebraic RAM model of computation. Introducing a more realistic model, a RAM with arbitrary-precision rational arithmetics, a deterministic algorithm is given that solves the problem directly, without the need of preprocessing, in $\mathcal{O}(n\log\log n)$ time and $\mathcal{O}(n)$ space, regardless of the precision of the input data.