A
leaf is the end node of any hierarchical tree data structure*. In the context of
BSP trees, it's the end node that describes a portion of the level geometry after the BSP partitioning stage is done.
Properties associated with each BSP leaf include:
- Contents - whether this leaf is solid, empty, water, ladder, etc.
- Faces
- Potentially Visible Set (PVS) - a yes/no list that indicates whether every other BSP leaf is visible from this leaf. This is what VIS generates. If VIS is not run the PVS list is empty, telling the game that every other leaf (essentially the whole map) is visible in every leaf.
When two leafs connect there is a
portal, and VIS does calculations for the PVS by doing algorithms against the area of the portal. The portal file is generated separately by the
BSP compiler and not included in the final BSP file.
Associated
Goldsource Error: leaf portals saw into leaf
* It follows the analogy of real life trees, which has a root, branches, and leaves at the end.
A triangular area/wedge of the map used by VIS to determine line of sight through portals to other leafs, so that the engine will know what wpolys to draw on screen. this relates to r_speed because if you can see from one leaf/portal into others, then all the wpolys are drawn and the r_speed is affected.