Advanced Scene Management - Computer Graphics Laboratory
Advanced Scene Management - Computer Graphics Laboratory
Advanced Scene Management - Computer Graphics Laboratory
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Advanced</strong> <strong>Scene</strong><br />
<strong>Management</strong><br />
1
<strong>Advanced</strong> <strong>Scene</strong> Graphs<br />
• This is a game-type-oriented issue<br />
• Bounding Volume Hierarchies (BVHs)<br />
• Binary space partition trees (BSP Trees)<br />
• “Quake”<br />
• Octree<br />
• PVS<br />
• Culling Skills<br />
2
Bounding Volume Hierarchies (BVHs)<br />
• Bounding spheres in hierarchy<br />
R<br />
B<br />
3
BSP Tree<br />
• Two variants<br />
• Axis-aligned<br />
• Polygon-aligned<br />
• The trees are created by using a plane to divide the space<br />
into two, and then sorting the geometry into two spaces.<br />
4
Axis-aligned BSP Tree<br />
0<br />
plane<br />
3<br />
plane1<br />
plane<br />
0<br />
plane2<br />
1 2<br />
3<br />
5
Polygon-aligned BSP Tree<br />
F<br />
C<br />
A<br />
B<br />
A<br />
G<br />
B<br />
C<br />
D<br />
E<br />
D E F G<br />
6
Why BSP Tree ?<br />
• Quickly to identify where you are<br />
• BSP = Sorting<br />
• Need a pre-processor to generate the PVS<br />
• Visibility culling + occlusion culling<br />
• PVS : Possible Visible Set<br />
• Optimized for in-door game environment<br />
• [Fuch80]<br />
• Fuchs, H.,<br />
• On Visible Surface Generation by a Priori Tree Structures,<br />
• <strong>Computer</strong> <strong>Graphics</strong>, 14, 124-33, (Proc. SIGGRAPH’80)<br />
7
Octree & Quadtree<br />
• Very similar to axis-aligned BSP tree.<br />
• Except that a box is split simultaneously along all three<br />
axes.<br />
• The split point must be the center of the box.<br />
• This creates eight new boxes.<br />
• Quadtree is the 2D version of octree.<br />
8
Quadtree - Example<br />
9
Octree – Some Discussion<br />
• Data structure coherence<br />
• Apply visibility culling from parents<br />
• Split or not split ?<br />
• Outdoor game scene ?<br />
10
Culling (1/2)<br />
• Culling means “remove from a flock”<br />
• Visibility culling<br />
• Remove the object not in view frustum<br />
• A “must” for game engine<br />
• Backface culling<br />
• Remove the polygons facing away from camera<br />
• Hardware standard<br />
• Occlusion culling<br />
• Remove the objects hidden by the others<br />
11
Culling (2/2)<br />
View frustum<br />
eye<br />
Occlusion<br />
culling<br />
Visibility<br />
culling<br />
Backface<br />
culling<br />
12
BSP Implementation<br />
• A Pre-processor<br />
• Space partition the scene data from artist<br />
• Generate the BSP data structure<br />
• Generate the PVS<br />
• BSP walk through<br />
• Identify the room where you are<br />
• Show/hide the rooms according to the PVS<br />
13
BSP Preprocessor (1/2)<br />
• Input<br />
• A scene from artist<br />
• Cutting planes (optional)<br />
• Can be procedurally generated by algorithm<br />
• Cutting policy<br />
• Split or not split<br />
• Ray casting resolution for PVS<br />
• Output<br />
• A BSP file<br />
• BSP Tree<br />
• PVS<br />
• Geometry Data<br />
14
BSP Preprocessor (2/2)<br />
• Process<br />
• Generate the BSP tree according to the cutting policy<br />
• Split or sort the geometry into BSP room (leaves)<br />
• For each “room”,, ray cast all rooms to generate the possible visible<br />
room set<br />
• 3D<br />
• Time consuming<br />
15
BSP Challenges<br />
• Effectiveness of PVS<br />
• Data set<br />
• Dynamic objects<br />
• Room size<br />
16