1 advanced scene management. 2 this is a game-type-oriented issue bounding volume hierarchies (bvhs)...

16
1 Advanced Advanced Scene Management Scene Management

Upload: wilfrid-ambrose-todd

Post on 02-Jan-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”

1

AdvancedAdvancedScene ManagementScene Management

Page 2: 1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”

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

Page 3: 1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”

3

Hierarchical structure of bounding spheres

R

B

Bounding Volume Hierarchies (BVHs)Bounding Volume Hierarchies (BVHs)

Page 4: 1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”

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

Page 5: 1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”

5

plane1

plane

0

plane2

plane

3

0

1 2

3

Axis-aligned BSP TreeAxis-aligned BSP Tree

Page 6: 1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”

6

AB

C

D

E

F

G

A

B C

D E F G

Polygon-aligned BSP TreePolygon-aligned BSP Tree

Page 7: 1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”

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 ?

Page 8: 1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”

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

Page 9: 1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”

9

Quadtree - ExampleQuadtree - Example

Page 10: 1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”

10

Data structure coherence Apply visibility culling from parents Split or not split ? Outdoor game scene ?

Octree – Some DiscussionOctree – Some Discussion

Page 11: 1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”

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)

Page 12: 1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”

12

eye

View frustum

Visibilityculling

Backfaceculling

Occlusionculling

Culling (2/2)Culling (2/2)

Page 13: 1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”

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

Page 14: 1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”

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)

Page 15: 1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”

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)

Page 16: 1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”

Effectiveness of PVSEffectiveness of PVS– Data setData set

Dynamic ObjectsDynamic Objects Room sizeRoom size

16

BSP ChallengesBSP Challenges