1 / 123

CHAPTER 13 Scene Management

CHAPTER 13 Scene Management. ( 友鈞 , 思元 , 紘瑋 , 章民 , 昭泉 , 琮凱 , 冠逸 ). Introduction ( 友鈞 ) The Concept of Scene Management ( 友鈞 ) Scene Management Techniques ( 紘瑋 ) Implementing a BSP Tree ( 思元 ) Class Declaration ( 章民 ) Implementing an Octree ( 琮凱 )

elton
Download Presentation

CHAPTER 13 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. CHAPTER 13Scene Management (友鈞,思元,紘瑋,章民,昭泉,琮凱,冠逸) 13. Scene Management

  2. Introduction (友鈞) • The Concept of Scene Management (友鈞) • Scene Management Techniques (紘瑋) • Implementing a BSP Tree (思元) • Class Declaration (章民) • Implementing an Octree (琮凱) • Demo Application: Octree and BSP Tree (冠逸) • One Look Back, Two Steps Forward (昭泉) Agenda 13. Scene Management

  3. Introduction & The Concept of Scene Management Speaker: Icarus 13. Scene Management

  4. ■ Learning the concepts of scene management • ■ Understanding quadtrees and terrain rendering • ■ Using BSP trees and octrees for collision detection • ■ Understanding what a portal engine is • ■ Implementing a BSP tree and an octree • ■ Using the code in the demo application Introduction 13. Scene Management

  5. The term scene management describes algorithms and methods that let you select only the polygons that are needed for a certain location and orientation of the viewer out of the whole set of a hundred thousand polygons of the level.Most of those polygons are not visible to the user. The Concept of Scene Management 13. Scene Management

  6. The removal of polygons that cannot be seen from a certain position and orientation of the viewer (because they are completely hidden behind other polygons) is called hidden surface removal, or HSR. • Another term for this is occlusion culling --------------------HOM, Occlusion frustum • View frustum culling The Concept of Scene Management 13. Scene Management

  7. Q&A 13. Scene Management

  8. Scene Management Techniques Speaker: XJACK, Hsu GAMELab/CSIE/NDHU 13. Scene Management 8

  9. Outline Overview No Solution Is Also a Solution Continuous and Discrete Level of Detail Quadtrees Octrees Binary Space Partitioning Trees Portal Engines Potential Visibility Set GAMELab/CSIE/NDHU 13. Scene Management 9

  10. Outline Overview No Solution Is Also a Solution Continuous and Discrete Level of Detail Quadtrees Octrees Binary Space Partitioning Trees Portal Engines Potential Visibility Set GAMELab/CSIE/NDHU 13. Scene Management 10

  11. Overview • You should always separate your algorithm in terms of the setting in which they should be used • Types of games • Indoor • Outdoor • No-door GAMELab/CSIE/NDHU 13. Scene Management 11

  12. Outline Overview No Solution Is Also a Solution Continuous and Discrete Level of Detail Quadtrees Octrees Binary Space Partitioning Trees Portal Engines Potential Visibility Set GAMELab/CSIE/NDHU 13. Scene Management 12

  13. No Solution Is Also a Solution The basic method : brute force approach In outdoor games that feature a number of small buildings Using this to save you a lot of development time and headaches GAMELab/CSIE/NDHU 13. Scene Management 13

  14. Outline Overview No Solution Is Also a Solution Continuous and Discrete Level of Detail Quadtrees Octrees Binary Space Partitioning Trees Portal Engines Potential Visibility Set GAMELab/CSIE/NDHU 13. Scene Management 14

  15. Continuous and Discrete Level of Detail • Scene management • Not only about removing whole objects from scene • More you can do • Level of detail (LOD) GAMELab/CSIE/NDHU 13. Scene Management 15

  16. Continuous and Discrete Level of Detail • Discreet LOD • Continuous LOD • Start from the most detailed version of the model and calculates a less detailed version on-the-fly • Suited for big, complex objects GAMELab/CSIE/NDHU 13. Scene Management 16

  17. Outline Overview No Solution Is Also a Solution Continuous and Discrete Level of Detail Quadtrees Octrees Binary Space Partitioning Trees Portal Engines Potential Visibility Set GAMELab/CSIE/NDHU 13. Scene Management 17

  18. Quadtrees • You already know the frustum culling text • Disadvantage • You have to test each object in the game • Quadtrees • Suited to tread 2D problem • 3D => 2D GAMELab/CSIE/NDHU 13. Scene Management 18

  19. Quadtrees GAMELab/CSIE/NDHU 13. Scene Management 19

  20. Quadtrees • Suppose the game is played in first-person view with the player walking around village • Why? • Less calculate • How? • Start from the root by subdividing the big rectangle in to 4 rectangles • When? • A leaf must not contain polygons from more than a single house GAMELab/CSIE/NDHU 13. Scene Management 20

  21. Quadtrees GAMELab/CSIE/NDHU 13. Scene Management 21

  22. Quadtrees Heightmap is the most common way to represent the data of a terrain GAMELab/CSIE/NDHU 13. Scene Management 22

  23. Quadtrees It is rather stupid to generate four rectangles with eight triangles You can achieve the same result by using only one rectangle with two triangles GAMELab/CSIE/NDHU 13. Scene Management 23

  24. Quadtrees • The theory of applying quadtrees to terrain rendering • For example • 9 * 9 heightmap • 3 * 3 terrain block GAMELab/CSIE/NDHU 13. Scene Management 24

  25. Quadtrees The theory of applying quadtrees to terrain rendering GAMELab/CSIE/NDHU 13. Scene Management 25

  26. Quadtrees GAMELab/CSIE/NDHU 13. Scene Management 26

  27. Quadtrees No gain in performance? Normal view frustum culling with the nodes bounding boxes If a node is not inside, you can ignore it and all of its child nodes Implement LOD GAMELab/CSIE/NDHU 13. Scene Management 27

  28. Quadtrees GAMELab/CSIE/NDHU 13. Scene Management 28

  29. Quadtrees GAMELab/CSIE/NDHU 13. Scene Management 29

  30. Quadtrees GAMELab/CSIE/NDHU 13. Scene Management 30

  31. Outline Overview No Solution Is Also a Solution Continuous and Discrete Level of Detail Quadtrees Octrees Binary Space Partitioning Trees Portal Engines Potential Visibility Set GAMELab/CSIE/NDHU 13. Scene Management 31

  32. Octrees The same thing that you do with quadtrees in 2D can be done in 3D Octrees GAMELab/CSIE/NDHU 13. Scene Management 32

  33. Octrees • The stop condition is basically the same as in the quatree • Two solution for the situation of when an object will not fit completely into one single node • Cut the object into two separate objects • Not cut but store them only on the node where their point lies • We implement an octree at the end of this chapter GAMELab/CSIE/NDHU 13. Scene Management 33

  34. Outline Overview No Solution Is Also a Solution Continuous and Discrete Level of Detail Quadtrees Octrees Binary Space Partitioning Trees Portal Engines Potential Visibility Set GAMELab/CSIE/NDHU 13. Scene Management 34

  35. Binary Space Partitioning Trees • The BSP tree can partition the space or the geometry that occupies space using arbitrary partitioning planes • Advantage • You do not need to split as many polygons • You can even adjust the algorithm’s heuristic to avoid splits • The BSP tree is a data structure that stores the result of the BSP algorithm GAMELab/CSIE/NDHU 13. Scene Management 35

  36. Binary Space Partitioning Trees • Convex polygon Concave polygon GAMELab/CSIE/NDHU 13. Scene Management 36

  37. Binary Space Partitioning Trees A collection of polygons in 3D space is convex when you can go into each position inside the convex and look in each direction By dividing a complex 3D level into a lot of convex groups, you can render a whole level without the need for a depth buffer GAMELab/CSIE/NDHU 13. Scene Management 37

  38. Binary Space Partitioning Trees GAMELab/CSIE/NDHU 13. Scene Management 38

  39. Binary Space Partitioning Trees GAMELab/CSIE/NDHU 13. Scene Management 39

  40. History of BSP tree in Video games BSP algorithm was originally developed in the end of the 1970s at the university of Texas at Dallas Henry Fuchs and Zvi Kedem Bruce Naylor Predetermining Visibility Priority in 3D Scenes [SIGGRAPH 79] On Visible Surface Generation by A Priori Tree Structures[SIGGRAPH 80] A priori Based Techniques for Determining Visibility Priority for 3D Scenes GAMELab/CSIE/NDHU 13. Scene Management 40

  41. History of BSP tree in Video games DOOM 1 in December 1993 GAMELab/CSIE/NDHU 13. Scene Management 41

  42. History of BSP tree in Video games DOOM 1 uses a 2D BSP algorithm and BSP tree GAMELab/CSIE/NDHU 13. Scene Management 42

  43. History of BSP tree in Video games Quake 1 by id software in June 1996 This was the first video game that used a real 3D BSP algorithm GAMELab/CSIE/NDHU 13. Scene Management 43

  44. Finding the best splitter(BSP) • The BSP algorithm is not very complicated • The secret of the algorithm is to select one of the polygons at each node as splitter to divide the list of polygons into two smaller lists • Which polygon do you choose as a splitter? • Two attributes • How many polygons get cut by a certain splitter? • The balance of the tree GAMELab/CSIE/NDHU 13. Scene Management 44

  45. Finding the best splitter(BSP) Score GAMELab/CSIE/NDHU 13. Scene Management 45

  46. Finding the best splitter(BSP) GAMELab/CSIE/NDHU 13. Scene Management 46

  47. Finding the best splitter(BSP) GAMELab/CSIE/NDHU 13. Scene Management 47

  48. BSP Tree Variants • Three variants • Node-Based BSP Trees • To do collision detection without doing any kind of calculation • Leafy BSP Tree • You do not retain the solid information • Solid BSP Tree • Combines both of the advantages of the approaches into a single BSP tree GAMELab/CSIE/NDHU 13. Scene Management 48

  49. Outline Overview No Solution Is Also a Solution Continuous and Discrete Level of Detail Quadtrees Octrees Binary Space Partitioning Trees Portal Engines Potential Visibility Set GAMELab/CSIE/NDHU 13. Scene Management 49

  50. Portal Engines There was another scene management approach working its way into the industry Portal Engines It is not a tree structure GAMELab/CSIE/NDHU 13. Scene Management 50

More Related