Introduction General Data Structures - Arrays, Linked Lists - Stacks & Queues - Hash Tables & Binary Search Trees - Graphs Spatial Data Structures -Why.

Slides:



Advertisements
Similar presentations
Christian Lauterbach COMP 770, 2/16/2009. Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques.
Advertisements

Collisions and Intersections When objects move, test for collision. When projecting surfaces, check for intersections. (Many slides adapted from Amitabh.

Computer graphics & visualization Collisions. computer graphics & visualization Simulation and Animation – SS07 Jens Krüger – Computer Graphics and Visualization.
©Silberschatz, Korth and Sudarshan12.1Database System Concepts Chapter 12: Part C Part A:  Index Definition in SQL  Ordered Indices  Index Sequential.
AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application.
03/12/02 (c) 2002 University of Wisconsin, CS559 Last Time Some Visibility (Hidden Surface Removal) algorithms –Painter’s Draw in some order Things drawn.
CSE 381 – Advanced Game Programming Scene Management
Visibility Culling using Hierarchical Occlusion Maps Hansong Zhang, Dinesh Manocha, Tom Hudson, Kenneth E. Hoff III Presented by: Chris Wassenius.
Korea Univ. Graphics Lab. 3D Game Engine Design Chapter 12. Spatial Sorting Chung Ji Hye
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
SASH Spatial Approximation Sample Hierarchy
1 Dr. Scott Schaefer Hidden Surfaces. 2/62 Hidden Surfaces.
Tomas Mőller © 2000 Speeding up your game The scene graph Culling techniques Level-of-detail rendering (LODs) Collision detection Resources and pointers.
Introduction General Data Structures - Arrays, Linked Lists - Stacks & Queues - Hash Tables & Binary Search Trees - Graphs Spatial Data Structures -Why.
A lion in the desert How do you find a lion in the desert? How about when you have a predicate that tells you if the lion is in front or behind a separating.
UNC Chapel Hill M. C. Lin Overview of Last Lecture About Final Course Project –presentation, demo, write-up More geometric data structures –Binary Space.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Space Partitions.
A lion in the desert How do you find a lion in the desert? How about when you have a predicate that tells you if the lion is in front or behind a separating.
Bounding Volume Hierarchies and Spatial Partitioning Kenneth E. Hoff III COMP-236 lecture Spring 2000.
1 Advanced Scene Management System. 2 A tree-based or graph-based representation is good for 3D data management A tree-based or graph-based representation.
Estruturas de Dados Espaciais MC-930 MO-603. Speeding Up Ray Tracing.
Collision Detection Michael Fuller. Overlap testing Most Common Technique Most Error Prone Test if two bodies overlap.
10/11/2001CS 638, Fall 2001 Today Kd-trees BSP Trees.
10/02/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Octrees.
Hidden Surface Removal
BSP Trees, Quadtrees & Octrees Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Wednesday, January 28, 2004.
Computer Graphics 2 Lecture x: Acceleration Techniques for Ray-Tracing Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
10/29/02 (c) 2002 University of Wisconsin, CS559 Today Hidden Surface Removal Exact Visibility.
Spatial Data Structures Jason Goffeney, 4/26/2006 from Real Time Rendering.
Managing Your Objects Paul Taylor 2009 Assignment Due Fri 5/6/2009.
10/09/2001CS 638, Fall 2001 Today Spatial Data Structures –Why care? –Octrees/Quadtrees –Kd-trees.
Kansas State University Department of Computing and Information Sciences CIS 736: Computer Graphics Wednesday, February 23, 2000 William H. Hsu Department.
1 Speeding Up Ray Tracing Images from Virtual Light Field Project ©Slides Anthony Steed 1999 & Mel Slater 2004.
The Visibility Problem In many environments, most of the primitives (triangles) are not visible most of the time –Architectural walkthroughs, Urban environments.
CSE 381 – Advanced Game Programming Quickhull and GJK.
Project 2 Presentation & Demo Course: Distributed Systems By Pooja Singhal 11/22/
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
CS-378: Game Technology Lecture #10: Spatial Data Structures Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran.
PRESENTED BY – GAURANGI TILAK SHASHANK AGARWAL Collision Detection.
Using BSP for CD Ref: BSP in deBerg et al ’ s book (url)url.
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
Been-Chian Chien, Wei-Pang Yang, and Wen-Yang Lin 8-1 Chapter 8 Hashing Introduction to Data Structure CHAPTER 8 HASHING 8.1 Symbol Table Abstract Data.
David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
CSCE 552 Spring D Models By Jijun Tang. Triangles Fundamental primitive of pipelines  Everything else constructed from them  (except lines and.
Pure Path Tracing: the Good and the Bad Path tracing concentrates on important paths only –Those that hit the eye –Those from bright emitters/reflectors.
ISOM MIS 215 Module 5 – Binary Trees. ISOM Where are we? 2 Intro to Java, Course Java lang. basics Arrays Introduction NewbieProgrammersDevelopersProfessionalsDesigners.
Where We Stand At this point we know how to: –Convert points from local to window coordinates –Clip polygons and lines to the view volume –Determine which.
Maths & Technologies for Games Spatial Partitioning 2
Maths & Technologies for Games Spatial Partitioning 1 CO3303 Week 8-9.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
Game Engine Design Quake Engine Presneted by Holmes 2002/12/2.
Ray Tracing Optimizations
David Luebke 3/5/2016 Advanced Computer Graphics Lecture 4: Faster Ray Tracing David Luebke
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
CSC 143T 1 CSC 143 Highlights of Tables and Hashing [Chapter 11 p (Tables)] [Chapter 12 p (Hashing)]
Hierarchical Data Structure in Game Programming Yanci Zhang Game Programming Practice.
CS552: Computer Graphics Lecture 28: Solid Modeling.

Bounding Volume Hierarchies and Spatial Partitioning
BSP Trees Binary space partitioning trees.
Bounding Volume Hierarchies and Spatial Partitioning
Modeliranje kompleksnih modelov
3D Object Representations
CSCE 441: Computer Graphics Hidden Surface Removal
Lecture 32: Visible Surface Detection
CS679 - Fall Copyright Univ. of Wisconsin
Modeliranje kompleksnih modelov
Presentation transcript:

Introduction General Data Structures - Arrays, Linked Lists - Stacks & Queues - Hash Tables & Binary Search Trees - Graphs Spatial Data Structures -Why care? - Binary Space Partitioning (BSP) trees

Arrays & Linked Lists 2D arrays and linked lists are used as: - Single and multi- layered Tile maps in 2D scenes in which each tile acts like a pixel. - Terrain maps in 3D world where 2D array represents the height of each tile in a level. Utility: - Abstracts the idea of pixels to a higher level significantly simplifying a drawing engine: - Linked Lists can be used for inventory

Stacks & Queues Stacks: used to construct Menu, Submenus Queues: used for command queuing e.g. Real Time Strategy (RTS) games such as Command & Conquer, War craft, Star craft: Demo-5 Trade Off: When expandability is more important than speed, use linked stacks and queues; otherwise use arrayed stacks and queues.

Others.. Hash Tables & Binary Search Trees: - searching; Trees: - Map editor (hierarchy of maps); - Skill system like RPGs such as Diablo 2 do. option to choose the skills e.g. healing skills or fighting skills. Graphs: - Portal Engine; games like Descent, Quake 2. more efficient method for rendering things:Demo-7

Spatial Partitioning What do we mean by spatial partitioning? Spatial partitioning mean dividing up the game world into regions that can be used to find spatial relationships between objects. Why do we need spatial partitioning? Scenegraphs are great for recording the dynamic relationships between dynamic objects, e.g. parts of a body. They are not so good for storing information about static elements in a game world, e.g. walls in a building.

Using Spatial Partitioning Spatial partitioning data structures are used to: Determine which parts of large static objects are visible, e.g. buildings, terrains. Determine neighborhood relationships between dynamic objects, e.g. for collision detection. Determine how much data needs to be sent across a network, e.g. based on what is currently visible to the client.

Spatial data Structures Spatial data structures store data indexed in some way by their spatial location –For instance, store points according to their location, or polygons, … –Before graphics, used for queries like “Where is the nearest hotel?” or “Which stars are strong enough to influence the sun?”

Applications Multitude of uses in computer games –Visibility - What can I see? –Ray intersections - What did the player just shoot? –Collision detection - Did the player just hit a wall? –Proximity queries - Where is the nearest power- up?

Spatial Partitioning Schemes Two common spatial partitioning schemes are: - Binary Space Partitioning (BSP) - Quadtree/Octree Partitioning The partitioning schemes are similar in some ways, both: - Recursively subdivide a space into smaller spaces - Construct tree data-structure that can be searched quickly - Are expensive to modify, hence they are best used for static features of a world when they can be pre-computed once

Binary Space Partitioning Binary space partitioning works by dividing a space into two subspaces at each recursion with a plane Choosing the best plane to divide a given space into two equally complex subspaces is the most difficult part. Most game engines analyze the geometry of a world and choose an existing polygon to define a plane. The analysis should determine which polygon will result in the most balanced tree.

Binary Space Partitioning Example Suppose that this figure - 1 represents the walls of a building in a game We want to pre-process this complex shape into a BSP tree consisting of simpler regions to assist real-time rendering

Walls of a building as space

First subdivision: Split occurs at polygon 16

Second subdivision: Split at polygon 4, 21

Final BSP tree

Choosing Splitting Planes Goals: –Trees with few cells –Planes that are mostly opaque (best for visibility calculations) –Objects not split across cells Some heuristics: –Choose planes that are also polygon planes –Choose large polygons first –Choose planes that don’t split many polygons –Try to choose planes that evenly divide the data –Let the user select or otherwise guide the splitting process –Random choice of splitting planes doesn’t do too badly