160 likes | 290 Views
Advanced Scene Management. Advanced Scene Graphs. This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake” Octree PVS (Potentially visible set) Culling Skills. Bounding Volume Hierarchies (BVHs).
E N D
Advanced Scene Management
Advanced Scene Graphs • This is a game-type-oriented issue • Bounding Volume Hierarchies (BVHs) • Binary space partition trees (BSP Trees) • “Quake” • Octree • PVS (Potentially visible set) • Culling Skills
Bounding Volume Hierarchies (BVHs) • Hierarchical structure of bounding spheres R B
BSP Tree • Two varients • Axis-aligned • Polygon-aligned • The trees are created by using a plane to divide the space into two, and then sorting the geometry into two spaces.
Axis-aligned BSP Tree 0 plane0 2 plane3 1 plane2 plane1 3
Polygon-aligned BSP Tree A F C G B A B C D E D F G E
Why BSP Tree ? • Quickly to identify where you are • BSP = Sorting • Need a pre-processor to generate the PVS • Visibility culling + occlusion culling • PVS : Potentially Visible Set • Optimized for in-door game environment • [Fuch80] • Fuchs, H., • On Visible Surface Generation by a Priori Tree Structures, • Computer Graphics, 14, 124-33, (Proc. SIGGRAPH’80)
Octree & Quadtree • Octree • Similar to axis-aligned BSP tree • A box is split simultaneously along all three axes • The split point must be the center of the box • This creates eight new smaller boxes • Quadtree is the 2D version of octree
Octree – Some Discussion • Data structure coherence • Apply visibility culling from parents • Split or not split ? • Outdoor game scene ?
Culling (1/2) • Culling means “remove from a flock” • Visibility culling • Remove the object not in view frustum • A “must” for game engine • Backface culling • Remove the polygons facing away from camera • Hardware standard • Occlusion culling • Remove the objects hidden by the others
Culling (2/2) View frustum Occlusion culling eye Visibility culling Backface culling
BSP Implementation • A Pre-processor • Space partition the scene data from artist • Generate the BSP data structure • Generate the PVS • BSP Walk Through • Identify the room where you are • Show/hide the rooms according to the PVS
BSP Preprocessor (1/2) • Input • A scene from artist • Cutting planes (optional) • Can be procedurally generated by algorithm • Cutting policy • Split or not split • Ray casting resolution for PVS • Output • A BSP file • BSP Tree • PVS • Geometry Data
BSP Preprocessor (2/2) • Process • Generate the BSP tree according to the cutting policy • Split or sort the geometry into BSP room (leaves) • For each “room”, perform ray casting for all rooms to generate the possible visible room set • 3D • Time consuming • Pre-processing process (can be done off-line)
BSP Challenges • Effectiveness of PVS • Data set • Dynamic Objects • Room size