Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Binary space partitioning (BSP) is a method in computer graphics and computational geometry that divides space recursively with planes (or, in two dimensions, lines) and stores the result as a binary tree, called a BSP tree. Each split creates two half-spaces, and each node of the tree corresponds to a convex region of space. Because the side of a plane that a viewpoint lies on decides which half-space can hide the other, a BSP tree built once for a static scene gives a correct back-to-front or front-to-back drawing order for any viewing position.[1][2]

The BSP tree was introduced as a named data structure by Henry Fuchs, Zvi Kedem and Bruce Naylor in a 1980 SIGGRAPH paper on hidden-surface removal, building on dividing-plane methods from 1960s visual simulation research for the US Air Force.[1] It was later applied to real-time rendering, occlusion culling, constructive solid geometry, shadow generation and collision detection, and id Software used it in the renderers of Doom and Quake.[2][3][4] Early virtual reality research used BSP subdivision to make interactive walkthroughs of virtual buildings fast enough to navigate, and later work applied it to sound propagation and collision detection in virtual environments.[5][6]

Reviewed 13 October 2026. All citations re-opened: Fuchs-Kedem-Naylor 1980, Airey 1990, Funkhouser 1992/1998 and Chin-Feiner PDFs, Toth survey, Doom r_bsp.c, Sanglard, Abrash 1996 and Unreal docs read; paper metadata and abstracts checked via Crossref/OpenAlex/arXiv. About review dates.

How it works

Building the tree

In the 1980 formulation, the input is a set of polygons that describe a scene. The algorithm picks one polygon and uses the plane it lies in to divide the rest of space into two half-spaces, a positive (front) side and a negative (back) side. Every other polygon is placed on one side or the other; a polygon that crosses the plane is split into two pieces. The chosen polygon becomes the root of a binary tree, and each subtree holds the polygons of one half-space. The same step is then repeated inside each half-space until no polygons remain.[1]

Splitting can make the tree larger than the input. In the original paper's test scenes, one 72-polygon environment produced 100 polygons in its BSP tree. To limit growth, Fuchs, Kedem and Naylor chose at each step the polygon whose plane split the fewest other polygons, and described a second criterion that also counted "polygon conflicts" removed by a choice.[1] In general more than one tree can describe the same scene, and the order in which splitting planes are chosen changes both the shape of the resulting regions and the size of the tree.[1]

The construction works in any number of dimensions. A two-dimensional tree partitions a plane with line segments; a three-dimensional tree partitions space with planes. Every node corresponds to a convex region, the intersection of the half-spaces of all the splitting planes above it, and the leaves together form a convex partition of the whole space.[1][2] Csaba Tóth's 2005 survey notes that BSP trees generalize several common spatial search structures, including quadtrees, octrees and k-d trees.[2]

Drawing in visibility order

The rendering use of the tree rests on a simple property: if the viewpoint is in one half-space of a plane, nothing in the other half-space can hide anything on the viewer's side. To draw the scene, a program walks the tree from the root and, at each node, checks which side of the node's plane the eye is on. For a back-to-front order it visits the subtree on the far side first, then the node's polygon, then the subtree on the near side. Drawing polygons in that order over one another (the painter's algorithm) leaves the nearest surface visible at every pixel. Reversing the choice gives a front-to-back order.[1]

The expensive work, building the tree and splitting polygons, happens once in a preprocessing step. At run time the program only classifies the eye against node planes, so the tree stays valid for every viewpoint as long as the scene geometry does not change. Fuchs, Kedem and Naylor gave pilots practicing repeated landings at the same airport in a simulator, an architect "walking" through a new house and a biochemist turning a protein model as cases where this assumption holds.[1] Tóth points out that a BSP also solves scenes whose objects overlap cyclically, where no valid depth order exists for the whole objects, because the tree cuts them into fragments that can always be ordered.[2]

The same tree answers a point location question. Testing a point against the plane at each node and following the matching branch leads to the leaf region that contains it, which is how engines find the cell the viewer is standing in.[1]

Size of the tree

How much splitting is unavoidable is a question in computational geometry. Tóth summarizes results by Michael Paterson and Frances Yao (1990): for n disjoint line segments in the plane, a BSP of size O(n log n) and height O(log n) always exists, and for n disjoint triangles in three dimensions a BSP of size O(n2) exists, which is the best possible bound in general because some sets of segments in 3D need a quadratic number of fragments.[2]

History

Visual simulation origins

The idea of ordering scene elements by separating planes came from earlier visual simulation research. Fuchs, Kedem and Naylor wrote that the first appearance of a BSP tree in the general literature was in the 1974 survey "A Characterization of Ten Hidden-Surface Algorithms" by Ivan Sutherland, Bob Sproull and Robert Schumacker, which reviewed a 1969 study by Schumacker and colleagues on applying computer-generated images to visual simulation, prepared for the US Air Force Human Resources Laboratory. In that method a designer placed invisible vertical dividing planes by hand between clusters of objects such as buildings, trees and mountains, so that a priority order among the clusters could be computed from the viewer's position. The tree was not named and its general properties were not developed.[1][7]

The 1980 BSP tree and its extensions

Fuchs was then at the University of North Carolina at Chapel Hill, and Kedem and Naylor at the University of Texas at Dallas. Their 1980 paper named the "Binary Space Partitioning" tree, automated its construction from the scene's own polygons, and developed its theory.[1] In 1983 Fuchs, Gregory Abram and Eric Grant described an implementation that produced shaded images of objects with hundreds of polygons at several images per second, fast enough for interactive use, running inside the graphics processor of a general-purpose raster system.[8]

Later work showed that the tree is more than a sorting aid. William Thibault and Naylor (1987) used BSP trees as an exact representation of polyhedra and evaluated Boolean set operations (union, intersection, difference) with them, and described an interactive 3D design program in which an object could be modified incrementally with a tool, with the set operation performed at interactive speeds for modestly complex objects.[9] Naylor, John Amanatides and Thibault (1990) then gave an algorithm for merging two BSP trees, which provides set operations between two objects that are both stored as trees.[10] Norman Chin and Steven Feiner of Columbia University (1989) built a BSP tree for each point light source that represents the shadow volume of the polygons facing it, and computed lit and shadowed fragments by filtering each polygon down that tree, reaching near real-time performance for scenes of modest size.[11]

Video games

id Software used BSP trees in the renderers of several games. According to Fabien Sanglard's Game Engine Black Book: Wolfenstein 3D, John Carmack replaced the ray caster of Wolfenstein 3D with a BSP-based wall renderer for the Super Nintendo port, sorting walls near to far and using an occlusion array to avoid overdraw.[12]

Doom (1993) used a two-dimensional BSP built over the level's floor plan. In Sanglard's review of the engine, each finished map was sliced by binary space partitioning: lines from the map (linedefs) were extended into splitting lines, chosen to balance the tree and limit the number of wall segments created, and the map was split until only convex "subsectors" remained.[3] The released source code shows the traversal. The function R_RenderBSPNode tests which side of each node's partition line the viewer's x and y position lies on, renders the subtree on the viewer's side first, and descends into the other side only if that subtree's bounding box might be visible.[13] Walls are drawn front to back and clipped against an occlusion array, and whole parts of the map are discarded through these bounding box tests.[3]

Quake moved to a full three-dimensional tree. Writing in 1996 while working on the game at id Software, Michael Abrash explained that each Quake level was stored as "a single, huge 3-D BSP tree" whose polygons sat in the empty leaves rather than in the nodes. A good-sized level held on the order of 10,000 polygons, about three times a comparable Doom level. Because each leaf is convex and its polygons lie on the leaf's boundaries facing inward, the polygons in one leaf cannot hide each other and can be drawn in any order. Abrash credited Carmack with the idea of precalculating and storing in each leaf a list of all leaves visible from it, a potentially visible set (PVS), so that at run time only the visible leaves were drawn, back to front. A raw PVS was several megabytes, but storing it as a bit vector with one bit per leaf, applying zero-byte compression, choosing as each splitter the polygon that splits the fewest others, and sealing the outside of levels so the BSP tool could remove surfaces that can never be seen brought it down to about 20 KB for a good-size level.[4]

The term also survives in level editing tools. Epic Games' current Unreal Engine documentation describes Geometry Brushes, "also known as Binary Space Partitioning (BSP) brushes", as the engine's tool for level construction, but says that role "has been passed on to Static Meshes and in-engine modeling tools, which are far more efficient". It does not recommend them as a final method of level design, but says they can still help with rapid prototyping of levels and objects in the early stages of a project.[14]

Applications in VR and AR

Virtual building walkthroughs

The Building Walkthrough project at the University of North Carolina at Chapel Hill aimed to build a "virtual building environment", a system that simulates the visual experience of a building without constructing it, to help architects (sometimes with their clients) explore design options. The project navigated models with input devices including a box with two joysticks and a slider, and a treadmill with bicycle handlebars, and named a treadmill with a head-mounted display or a large screen as a natural interface for infrequent users such as clients. In 1986 the project could show a 7,125-polygon model of the university's Sitterson Hall at about four updates per second on the Pixel-Planes 4 graphics machine. The team observed that at around six updates per second the illusion of a virtual building began to work, and wanted at least six and preferably twenty.[5]

John Airey's 1990 dissertation in that project, supervised by Fred Brooks, used recursive binary space partitioning to divide a building model into cells, which corresponded roughly to rooms. Openings in a cell's boundary became portals, and a potentially visible set was precomputed for each cell, so the display only had to process the geometry visible from the viewer's current cell. The Sitterson Hall model was split into 269 cells; the average cell could see a little over 230 polygons and the worst cell 2,195. Together with the precomputed visible sets, the subdivision cut the number of polygons processed by an average factor of about 30 and by at least 3.25 in the worst case, and the model ran at 14 or more updates per second on the same machine.[5][15]

At the University of California, Berkeley, Seth Teller and Carlo Séquin (1991) subdivided axis-aligned architectural models into cells whose boundaries coincide with major opaque surfaces such as walls, found the portals between them and computed cell-to-cell visibility ahead of time for interactive walkthroughs.[16] In the follow-up walkthrough system by Thomas Funkhouser, Séquin and Teller (1992), the subdivision was a variant of the k-d tree (a BSP restricted to axis-aligned planes) with splitting planes placed along walls, door frames, floors and ceilings. For one floor model with 1,920 split faces it produced 1,280 cells and 3,600 portals in 23 seconds.[17]

Head-tracked viewing

With a head-mounted display the viewpoint moves constantly while most of the scene stays still, which is the case a BSP tree handles well, but the standard traversal still classifies the eye against every node plane on every frame. Amela Sadagić and Mel Slater (2000) proposed a "Viewpoint Movement Space" method for head-slaved viewing in virtual environments that divides space into cells in which the back-to-front polygon order does not change; when the viewpoint crosses a cell boundary, only a small, predictable update to the order is needed. They described this as a notable reduction in cost compared with resolving visibility from the BSP tree.[18]

Sound propagation

BSP subdivision also supports spatial audio. Funkhouser and colleagues at Bell Laboratories (1998) built a BSP of a virtual environment into convex polyhedral cells, linked neighboring cells in an adjacency graph, and traced pyramidal beams of sound through that graph to find reflection and transmission paths. In a building model with more than 10,000 polygons, the system computed specular reflection paths up to eighth order about six times per second for a listener moving freely, and the authors were using it for applications in which a user experiences a virtual environment through simultaneous auralization and visualization.[6]

Collision detection

Sigal Ar, Bernard Chazelle and Ayellet Tal (2000) wrote that efficient collision detection is essential in virtual reality environments and applications such as walkthroughs, and re-examined the BSP tree as a classical structure for it. Their "self-customized" BSP trees adapt to the queries an application actually makes, on the assumption that events that happened in the past are more likely to happen again.[19]

Relation to culling and other visibility methods

A BSP tree on its own orders geometry; it does not remove hidden geometry. Engines combine it with culling steps. Viewing frustum culling discards geometry outside the field of view; a tree lets this be done for whole regions at once, and Doom's traversal skips an entire subtree when its bounding box cannot be visible.[13] Back-face culling skips polygons facing away from the viewer. The traversal already tests which side of each node polygon the eye is on, and in the 1980 paper this test is just a check of the sign of the z component of the polygon's normal after transformation to screen coordinates.[1] Occlusion culling goes further by skipping geometry hidden behind nearer surfaces. In the UNC walkthrough and in Quake, precomputed potentially visible sets were stored for each BSP cell or leaf.[5][4]

Abrash noted in 1996 that rasterization tasks were moving into hardware as 3D accelerators appeared, while visible-surface determination and culling, whose cost in a simple implementation scales directly with scene complexity, would become the dominant problem in real-time PC 3D.[4]

Research

Research on the combinatorics of BSPs continued into the 2000s, with work on disjoint segments in the plane, axis-aligned objects in higher dimensions and kinetic BSPs for moving objects; Tóth's 2005 survey lists the partition complexity of disjoint simplices in four or more dimensions as an open problem.[2]

The structure has also been adopted in machine learning for 3D shapes. BSP-Net, by Zhiqin Chen, Andrea Tagliasacchi and Hao Zhang, is a neural network that represents a 3D shape as a set of convex parts obtained from a BSP tree built on a set of planes. It is trained without convex decompositions as supervision and outputs compact, watertight, low-polygon meshes directly, without an iso-surfacing step. The paper appeared at CVPR 2020 and received the conference's Best Student Paper Award.[20]

See also

References

  1. ↑ 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 Henry Fuchs, Zvi M. Kedem, Bruce F. Naylor (1980-07). "On visible surface generation by a priori tree structures". ACM SIGGRAPH Computer Graphics, vol. 14, no. 3 (SIGGRAPH '80), pp. 124-133. ACM. doi:10.1145/965105.807481. https://www.cs.unc.edu/~fuchs/publications/VisSurfaceGeneration80.pdf. Retrieved 2026-10-13.
  2. ↑ 2.0 2.1 2.2 2.3 2.4 2.5 2.6 Csaba D. Tóth (2005). "Binary Space Partitions: Recent Developments". Combinatorial and Computational Geometry, MSRI Publications, vol. 52, pp. 529-556. Mathematical Sciences Research Institute. https://library.slmath.org/books/Book52/files/29toth.pdf. Retrieved 2026-10-13.
  3. ↑ 3.0 3.1 3.2 Fabien Sanglard (2010-01-13). "Doom engine code review". fabiensanglard.net. https://fabiensanglard.net/doomIphone/doomClassicRenderer.php. Retrieved 2026-10-13.
  4. ↑ 4.0 4.1 4.2 4.3 Michael Abrash (1996). "Inside Quake: Visible-Surface Determination (Ramblings in Real Time column)". Dr. Dobb's Sourcebook (Dr. Dobb's Journal archive). https://jacobfilipp.com/DrDobbs/articles/DDJ/1996/9613/9613f/9613f.htm. Retrieved 2026-10-13.
  5. ↑ 5.0 5.1 5.2 5.3 John Milligan Airey (1990-07). "Increasing Update Rates in the Building Walkthrough System with Automatic Model-Space Subdivision and Potentially Visible Set Calculations". Ph.D. dissertation, Technical Report TR90-027. University of North Carolina at Chapel Hill, Department of Computer Science. https://techreports.cs.unc.edu/papers/90-027.pdf. Retrieved 2026-10-13.
  6. ↑ 6.0 6.1 Thomas Funkhouser, Ingrid Carlbom, Gary Elko, Gopal Pingali, Mohan Sondhi, Jim West (1998). "A Beam Tracing Approach to Acoustic Modeling for Interactive Virtual Environments". Proceedings of SIGGRAPH '98, pp. 21-32. ACM. doi:10.1145/280814.280818. https://www.cs.princeton.edu/~funk/sig98.pdf. Retrieved 2026-10-13.
  7. ↑ Ivan E. Sutherland, Robert F. Sproull, Robert A. Schumacker (1974-03). "A Characterization of Ten Hidden-Surface Algorithms". ACM Computing Surveys, vol. 6, no. 1, pp. 1-55. ACM. doi:10.1145/356625.356626. https://doi.org/10.1145/356625.356626. Retrieved 2026-10-13.
  8. ↑ Henry Fuchs, Gregory D. Abram, Eric D. Grant (1983-07). "Near real-time shaded display of rigid objects". ACM SIGGRAPH Computer Graphics, vol. 17, no. 3 (SIGGRAPH '83), pp. 65-72. ACM. doi:10.1145/800059.801134. https://doi.org/10.1145/800059.801134. Retrieved 2026-10-13.
  9. ↑ William C. Thibault, Bruce F. Naylor (1987-08). "Set operations on polyhedra using binary space partitioning trees". ACM SIGGRAPH Computer Graphics, vol. 21, no. 4 (SIGGRAPH '87), pp. 153-162. ACM. doi:10.1145/37401.37421. https://doi.org/10.1145/37401.37421. Retrieved 2026-10-13.
  10. ↑ Bruce Naylor, John Amanatides, William Thibault (1990-09). "Merging BSP trees yields polyhedral set operations". ACM SIGGRAPH Computer Graphics, vol. 24, no. 4 (SIGGRAPH '90), pp. 115-124. ACM. doi:10.1145/97879.97892. https://doi.org/10.1145/97879.97892. Retrieved 2026-10-13.
  11. ↑ Norman Chin, Steven Feiner (1989-07). "Near Real-Time Shadow Generation Using BSP Trees". ACM SIGGRAPH Computer Graphics, vol. 23, no. 3 (SIGGRAPH '89), pp. 99-106. doi:10.1145/74334.74343. https://www.cs.princeton.edu/courses/archive/spr01/cs598b/papers/chin89.pdf. Retrieved 2026-10-13.
  12. ↑ Fabien Sanglard. "Article 10 - The Wolf Front (excerpt from Game Engine Black Book: Wolfenstein 3D)". Wolfenstein3D.nl. https://wolfenstein3d.nl/blackbook10/. Retrieved 2026-10-13.
  13. ↑ 13.0 13.1 "r_bsp.c: BSP traversal, handling of LineSegs for rendering (Doom source code, linuxdoom-1.10)". GitHub. id Software. https://github.com/id-Software/DOOM/blob/master/linuxdoom-1.10/r_bsp.c. Retrieved 2026-10-13.
  14. ↑ "Geometry Brush Actors in Unreal Engine". Unreal Engine Documentation. Epic Games. https://dev.epicgames.com/documentation/en-us/unreal-engine/geometry-brush-actors-in-unreal-engine. Retrieved 2026-10-13.
  15. ↑ John M. Airey, John H. Rohlf, Frederick P. Brooks Jr. (1990). "Towards image realism with interactive update rates in complex virtual building environments". ACM SIGGRAPH Computer Graphics, vol. 24, no. 2 (1990 Symposium on Interactive 3D Graphics), pp. 41-50. ACM. doi:10.1145/91385.91416. https://doi.org/10.1145/91385.91416. Retrieved 2026-10-13.
  16. ↑ Seth J. Teller, Carlo H. Séquin (1991-07). "Visibility preprocessing for interactive walkthroughs". ACM SIGGRAPH Computer Graphics, vol. 25, no. 4 (SIGGRAPH '91), pp. 61-70. ACM. doi:10.1145/122718.122725. https://doi.org/10.1145/122718.122725. Retrieved 2026-10-13.
  17. ↑ Thomas A. Funkhouser, Carlo H. Séquin, Seth J. Teller (1992). "Management of Large Amounts of Data in Interactive Building Walkthroughs". Proceedings of the 1992 Symposium on Interactive 3D Graphics, pp. 11-20. ACM. doi:10.1145/147156.147158. https://people.csail.mit.edu/teller/pubs/FunkST-i3d92.pdf. Retrieved 2026-10-13.
  18. ↑ Amela Sadagić, Mel Slater (2000-06). "Dynamic Polygon Visibility Ordering for Head-Slaved Viewing in Virtual Environments". Computer Graphics Forum, vol. 19, no. 2, pp. 111-122. doi:10.1111/1467-8659.00448. https://doi.org/10.1111/1467-8659.00448. Retrieved 2026-10-13.
  19. ↑ Sigal Ar, Bernard Chazelle, Ayellet Tal (2000). "Self-customized BSP trees for collision detection". Computational Geometry: Theory and Applications, vol. 15, no. 1-3, pp. 91-102. doi:10.1016/S0925-7721(99)00049-8. https://doi.org/10.1016/S0925-7721(99)00049-8. Retrieved 2026-10-13.
  20. ↑ Zhiqin Chen, Andrea Tagliasacchi, Hao Zhang (2020). "BSP-Net: Generating Compact Meshes via Binary Space Partitioning". 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 42-51. doi:10.1109/CVPR42600.2020.00012, arXiv:1911.06971. https://arxiv.org/abs/1911.06971. Retrieved 2026-10-13.