1 / 22

BSP Trees

Binary Space Partitioning Trees variants from many papers Eric Etheridge. BSP Trees. Introduction: Space Partitionings. What are space partitionings? Divide space semantically using a data structure Same general goal as bounding-box hierarchies Usually a tree structure

rphillip
Download Presentation

BSP Trees

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Binary Space Partitioning Trees variants from many papers Eric Etheridge BSP Trees

  2. Introduction: Space Partitionings • What are space partitionings? • Divide space semantically using a data structure • Same general goal as bounding-box hierarchies • Usually a tree structure • Nodes store or implicitly define spatial boundaries

  3. Nodes / Cells • Nodes, or “cells”, refer to regions of space • Each object in the world is in one or more cells • Some options for data stored at a cell: • objects entirely in a cell / also those partly in a cell • data in leaves only / data in all nodes in a tree • store references to the objects in a cell • store polygons from the parts of objects in the cell • The exact data stored depends on the algorithm

  4. Simpler Space Partitionings • Grid: • multidimensional array over a fixed maximum space • fixed-size cells • axis-aligned

  5. Simpler Space Partitionings • Quad- / Oct-Trees: • tree structure over a fixed maximum space • each node divides the parent cell into four or eight sub-cells • the tree is not balanced • axis-aligned

  6. Simpler Space Partitionings • K-D Trees • tree structure over an unbounded space • each node divides the parent into two cells • axis-aligned • usually rotates the choice of dimension to split at each level

  7. General Space Partitioning Uses • Fast approximate object intersection detection: possibly intersecting vs. definitely not • line / object: efficient ray-tracing • volume / object: volume culling for rendering • object / object: avoid many collision detection checks

  8. Binary Space Partitioning • BSP Trees • tree structure over an unbounded space • each node divides the parent into two cells • NOT axis-aligned • polygons that intersects planes are split along the plane

  9. BSP Tree Original Purpose • Avoid the overhead of the painter's algorithm and Z-buffer for graphical display • First used for this purpose in the game Doom by Id Software, released in 1993 • Uses trees that cut along polygon faces

  10. BSP Trees For Rendering • Tree created once • Each node stores a polygon in the environment • Space is divided into 'in front' and 'behind' that polygon • A viewpoint is chosen for rendering • The planes in the nodes are tested against the viewpoint, each time determining the near side • Objects on near sides are before far objects

  11. BSP Trees vs. Other Partitionings • Allows exact ordering of polygons for rendering • Able to pre-compute “visibility lists”, i.e. what objects are visible from what locations • Less nodes are needed than for axis-aligned structures: • http://portal.acm.org/citation.cfm?id=1115371 • Allows simple Level-of-Detail approximations by picking tree order to match detail level

  12. Specific BSP Abilities • Simple exact object intersection, returning the point or space of collision, many uses: • Exact ray tracing with a single data structure • Exact collision detection, single structure • And returning the volume of the collision, not just a point • Approximate intersections within specified error • Can make a partial tree that approximates an object • Number of nodes required is linear in object size, vs. quadratic when using axis-aligned partitionings

  13. BSP Trees vs. Other Structures • BSP Trees can quickly model or approximate non-rectangular objects • Compare modeling a pyramid (next slides): • Axis-Aligned Bounding Boxes • Non-Axis-Aligned Bounding Boxes • Oct-Tree • BSP Tree

  14. Non-Rectangular: AA BB

  15. Non-Rectangular: Grid

  16. Non-Rectangular: Oct-Tree

  17. Non-Rectangular: BSP Tree

  18. Creating BSP Trees • Usually done by pre-processing • Artist does not have to specify anything • When splitting an object, it must be a hull • Needs a clear 'inside' and 'outside' for intersection • Does not have to be convex • When splitting space, objects are often not split • Heuristics used to make nearly-optimal trees • (Perfect Binary Decision Trees are NP-Complete)‏

  19. Return Values: Simple Yes / No Contents lists for intersected cells Exact space of the intersection BSP Trees: Intersection Basics • Intersection types: • Point • Ray • Plane • Bounding Box • BSP Tree / BSP Tree

  20. Some Other BSP Applications • medical image compression: • http://portal.acm.org/citation.cfm?id=949685.949714 • shadow computation: • http://portal.acm.org/citation.cfm?id=199412 • general set operations on polyhedra: • http://portal.acm.org/citation.cfm?id=97880.97892

  21. BSP Tree Limitations • Deformation of objects stored in a BSP Tree: • Deformations move polygons across planes • Can't recompute the tree or re-cut faces quickly • Exact collision using BSP Trees is impractical • Moving objects stored in a BSP Tree: • Simple BSP Tree algorithms do not handle this well • Complex algorithms can: • http://portal.acm.org/citation.cfm?id=97880.97892

  22. BSP Tree General References • Compiled BSP Tree FAQ: • ftp://ftp.sgi.com/other/bspfaq/faq/bspfaq.html • “Classic” BSP Tree Starting Point Mentioned: • http://portal.acm.org/citation.cfm?id=807481 • Bruce Naylor's Doctoral Thesis at UTD: • http://portal.acm.org/citation.cfm?id=909951 • Wikipedia Article: • http://en.wikipedia.org/wiki/Binary_space_partitioning

More Related