1 / 25

Advanced Scene Management

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).

torgny
Download Presentation

Advanced Scene Management

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Advanced Scene Management

  2. 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

  3. Bounding Volume Hierarchies (BVHs) • Hierarchical structure of bounding spheres R B

  4. 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.

  5. Axis-aligned BSP Tree 0 plane0 2 plane3 1 plane2 plane1 3

  6. Polygon-aligned BSP Tree A F C G B A B C D E D F G E

  7. 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)

  8. 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

  9. Quadtree - Example

  10. Octree – Some Discussion • Data structure coherence • Apply visibility culling from parents • Split or not split ? • Outdoor game scene ?

  11. 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

  12. Culling (2/2) View frustum Occlusion culling eye Visibility culling Backface culling

  13. 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

  14. 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

  15. 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)

  16. BSP Challenges • Effectiveness of PVS • Data set • Dynamic Objects • Room size

  17. Spatial Partition: Grid Cells Divide the space into grid cells regularly. Hash objects to grid cells based on their positions. Use link list to maintain the objects which lay in the same grid cell.

  18. Searching for neighboring objects • Use the linked list to search for neighboring objects • Determine the grid coordinates to obtain the grid cell • Search the objects at the grid cell

  19. Linked List: Examples struct ObjList { Obj *myObj; ObjList *next; }; struct ObjList { int objID; int nextListID; };

  20. Grid Cells: Hashing Space dimension [x0, x1] × [y0, y1] × [z0, z1] Grid dimension Nx × Ny × Nz Given position (x, y, z), compute ( Ix,Iy,Iz ) Ix = Nx * (x - x0) / (x1 -x0) Iy = Ny * (y - y0) / (y1 -y0) Iz = Nz * (z - z0) / (z1 -z0)

  21. Grid Cells: Hashing Space dimension [x0, x1] × [y0, y1] × [z0, z1] Grid dimension Nx × Ny × Nz Given position (x, y, z), compute ( Ix,Iy,Iz ) Ix = Nx * (x - x0) / (x1 -x0) Iy = Ny * (y - y0) / (y1 -y0) Iz = Nz * (z - z0) / (z1 -z0) Do you see the problem?

  22. Grid Cells: Hashing Space dimension [x0, x1] × [y0, y1] × [z0, z1] Grid dimension Nx × Ny × Nz Given position (x, y, z), compute ( Ix,Iy,Iz ) Ix = Nx * (x - x0) / (x1 -x0) Iy = Ny * (y - y0) / (y1 -y0) Iz = Nz * (z - z0) / (z1 -z0) Do you see the problem? E.g., Ix in [0, Nx]. Ix = Nx only when x = x1. Clamp Ix to [ 0, Nx – 1 ]. Do it for Iy and Iz too.

  23. Grid Cells: Hashing Use if then to clamp? Ix = Nx * (x - x0) / (x1 -x0) Iy = Ny * (y - y0) / (y1 -y0) Iz = Nz * (z - z0) / (z1 -z0) Do you see the problem? E.g., Ix in [0, Nx]. Ix = Nx only when x = x1. Clamp Ix to [ 0, Nx – 1 ]. Do it for Iy and Iz too.

  24. Grid Cells: Hashing To do so, we do this: Ix = Nx * (x - x0) / (x1 -x0 + ε) Iy = Ny * (y - y0) / (y1 -y0 + ε) Iz = Nz * (z - z0) / (z1 -z0 + ε) where ε > 0 and its value is much smaller than min ( x1 -x0 , y1 -y0 , z1 -z0 ) - Other methods?

  25. Spatial Partition: Grid Cells But some objects overlap with more than one grid cell. Thus, we need larger regions for searching the neighboring objects, e.g. 3x3 or 5x5, etc.

More Related