Is there a known linear "zero-overdraw 2D visibility" BSP algorithm, without using any intermediate data structures?



In Michael Abrash's Graphics Programming Black Book, Special Edition, Chapter 64 – Quake’s Visible-Surface Determination, he writes:

In the end, John [Carmack] decided that the beam tree was a sort of second-order structure, reflecting information already implicitly contained in the world BSP tree, so he tackled the problem of extracting visibility information directly from the world BSP tree. He spent a week on this, as a byproduct devising a perfect DOOM (2-D) visibility architecture, whereby a single, linear walk of a DOOM BSP tree produces zero-overdraw 2-D visibility. Doing the same in 3-D turned out to be a much more complex problem, though, and by the end of the week John was frustrated by the increasing complexity and persistent glitches in the visibility code. Although the direct-BSP approach was getting closer to working, it was taking more and more tweaking, and a simple, clean design didn’t seem to be falling out. When I left work one Friday, John was preparing to try to get the direct-BSP approach working properly over the weekend.

But, with the later chapters being about Quake's 3D engine, the 2D method is not mentioned again. I've been trying to find more information on this "zero-overdraw 2D visibility" BSP renderer, but I've had no luck.


Posted 2016-02-06T00:32:49.593

Reputation: 76


There's a detailed look into Quake's engine in this article. You'll also find one on Quake 2 on the same site. I think there's a link there somewhere to a GDC presentation talk by Michael Abrash where he briefly talks about the visibility problem and how it was solved using portals.

– glampert – 2016-02-06T18:01:34.113


Ah found it! That's the video I mentioned:

– glampert – 2016-02-06T18:08:16.550

1When I first read about this (15-16 years ago), I wanted to try applying it to Wolfenstein 3D to see if it was a major improvement over ray casting, especially at higher resolutions and/or when using OpenGL rendering. Just using BSP trees as the SNES and Macintosh Wolf 3D and DOOM did are probably a win regardless, but I was hung up on wanting to learn this potential best method before actually implementing anything. – rrrzx – 2016-06-10T21:53:40.930

1I think that any and all (BSP-based, specifically, unless it's just that awesome) algorithms that meet the criteria of being suitable for solving visibility and rendering in Wolfenstein 3D / DOOM-style games, including their implementations being practical on those games' target systems, would be sufficient in answering the question, and not necessarily any algorithms that were invented or known by John Carmack. – rrrzx – 2016-06-10T22:03:16.923

No answers