Date post: | 02-Jan-2016 |
Category: |
Documents |
Upload: | wilfrid-ambrose-todd |
View: | 216 times |
Download: | 0 times |
1
AdvancedAdvancedScene ManagementScene Management
2
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
Advanced Scene GraphsAdvanced Scene Graphs
3
Hierarchical structure of bounding spheres
R
B
Bounding Volume Hierarchies (BVHs)Bounding Volume Hierarchies (BVHs)
4
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.
BSP TreeBSP Tree
5
plane1
plane
0
plane2
plane
3
0
1 2
3
Axis-aligned BSP TreeAxis-aligned BSP Tree
6
AB
C
D
E
F
G
A
B C
D E F G
Polygon-aligned BSP TreePolygon-aligned BSP Tree
7
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)
Why BSP Tree ?Why BSP Tree ?
8
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 & QuadtreeOctree & Quadtree
9
Quadtree - ExampleQuadtree - Example
10
Data structure coherence Apply visibility culling from parents Split or not split ? Outdoor game scene ?
Octree – Some DiscussionOctree – Some Discussion
11
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 (1/2)Culling (1/2)
12
eye
View frustum
Visibilityculling
Backfaceculling
Occlusionculling
Culling (2/2)Culling (2/2)
A Pre-processorA Pre-processor– Space partition the scene data from artistSpace partition the scene data from artist– Generate the BSP data structureGenerate the BSP data structure– Generate the PVSGenerate the PVS
BSP Walk ThroughBSP Walk Through– Identify the room where you areIdentify the room where you are– Show/hide the rooms according to the PVSShow/hide the rooms according to the PVS
13
BSP ImplementationBSP Implementation
InputInput– A scene from artistA scene from artist– Cutting planes (optional)Cutting planes (optional)
» Can be procedurally generated by algorithmCan be procedurally generated by algorithm
– Cutting policyCutting policy» Split or not splitSplit or not split
– Ray casting resolution for PVSRay casting resolution for PVS OutputOutput
– A BSP fileA BSP file» BSP TreeBSP Tree» PVSPVS» Geometry DataGeometry Data
14
BSP Preprocessor (1/2)BSP Preprocessor (1/2)
ProcessProcess– Generate the BSP tree according to the cutting policyGenerate the BSP tree according to the cutting policy– Split or sort the geometry into BSP room (leaves)Split or sort the geometry into BSP room (leaves)– For each “room”, perform ray casting for all rooms to For each “room”, perform ray casting for all rooms to
generate the possible visible room setgenerate the possible visible room set– 3D3D– Time consumingTime consuming– Pre-processing process (can be done off-line)Pre-processing process (can be done off-line)
15
BSP Preprocessor (2/2)BSP Preprocessor (2/2)
Effectiveness of PVSEffectiveness of PVS– Data setData set
Dynamic ObjectsDynamic Objects Room sizeRoom size
16
BSP ChallengesBSP Challenges