Spatial Data Structures and Acceleration Algorithms

Similar documents
Spatial Data Structures and Speed-Up Techniques. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Spatial Data Structures and Acceleration Algorithms

Spatial Data Structures and Speed-Up Techniques. Ulf Assarsson Department of Computer Science and Engineering Chalmers University of Technology

Spatial Data Structures

Spatial Data Structures

Scene Management. Video Game Technologies 11498: MSc in Computer Science and Engineering 11156: MSc in Game Design and Development

Computer Graphics (CS 543) Lecture 13b Ray Tracing (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Speeding up your game

Spatial Data Structures

Spatial Data Structures

Spatial Data Structures

Announcements. Written Assignment2 is out, due March 8 Graded Programming Assignment2 next Tuesday

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

CS 563 Advanced Topics in Computer Graphics Culling and Acceleration Techniques Part 1 by Mark Vessella

CPSC / Sonny Chan - University of Calgary. Collision Detection II

Ray Tracing Acceleration Data Structures

Acceleration Data Structures. Michael Doggett Department of Computer Science Lund university

Computer Graphics. Bing-Yu Chen National Taiwan University

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

Acceleration Data Structures

Motivation. Culling Don t draw what you can t see! What can t we see? Low-level Culling

CS535 Fall Department of Computer Science Purdue University

Project Gotham Racing 2 (Xbox) Real-Time Rendering. Microsoft Flighsimulator. Halflife 2

Intersection Acceleration

Computer Graphics. - Spatial Index Structures - Philipp Slusallek

Using Bounding Volume Hierarchies Efficient Collision Detection for Several Hundreds of Objects

Computer Graphics. - Ray-Tracing II - Hendrik Lensch. Computer Graphics WS07/08 Ray Tracing II

Accelerated Raytracing

Lecture 25 of 41. Spatial Sorting: Binary Space Partitioning Quadtrees & Octrees

Ray Tracing: Intersection

Algorithms for GIS:! Quadtrees

Data Structures and Algorithms

COMP 175: Computer Graphics April 11, 2018

Ray Tracing. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

Bounding Volume Hierarchies

Overview. Pipeline implementation I. Overview. Required Tasks. Preliminaries Clipping. Hidden Surface removal

Collision Detection. These slides are mainly from Ming Lin s course notes at UNC Chapel Hill

Solid Modeling. Thomas Funkhouser Princeton University C0S 426, Fall Represent solid interiors of objects

Advanced 3D-Data Structures

MSBVH: An Efficient Acceleration Data Structure for Ray Traced Motion Blur

INFOGR Computer Graphics. J. Bikker - April-July Lecture 11: Acceleration. Welcome!

Comparison of hierarchies for occlusion culling based on occlusion queries

Hidden Surface Elimination: BSP trees

Acceleration Data Structures for Ray Tracing

Accelerating Ray Tracing

Spatial Data Structures for Computer Graphics

Recall: Inside Triangle Test

improving raytracing speed

Binary Space Partition Trees. Overview. Binary Space Partitioning Trees (Fuchs, Kedem and Naylor `80)

Collision Detection. Pu Jiantao.

Visibility and Occlusion Culling

Collision and Proximity Queries

VIII. Visibility algorithms (II)

Topic 10: Scene Management, Particle Systems and Normal Mapping. CITS4242: Game Design and Multimedia

Lesson 05. Mid Phase. Collision Detection

Universiteit Leiden Computer Science

Real-Time Rendering (Echtzeitgraphik) Dr. Michael Wimmer

Lecture 18 of 41. Scene Graphs: Rendering Lab 3b: Shader

Homework 1: Implicit Surfaces, Collision Detection, & Volumetric Data Structures. Loop Subdivision. Loop Subdivision. Questions/Comments?

Accelerating Ray-Tracing

Drawing the Visible Objects

9. Visible-Surface Detection Methods

Page 1. Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms

Collision Detection based on Spatial Partitioning

More Hidden Surface Removal

Computer Graphics II

Speeding Up Ray Tracing. Optimisations. Ray Tracing Acceleration

Lecture 2 - Acceleration Structures

Collision Detection with Bounding Volume Hierarchies

Ray Tracing with Spatial Hierarchies. Jeff Mahovsky & Brian Wyvill CSC 305

Row Tracing with Hierarchical Occlusion Maps

Accelerating Geometric Queries. Computer Graphics CMU /15-662, Fall 2016

Computer Graphics. Lecture 9 Hidden Surface Removal. Taku Komura

Clipping. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

A Survey on Collision Detection Techniques for Virtual Environments

Topics. Ray Tracing II. Intersecting transformed objects. Transforming objects

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

11 - Spatial Data Structures

CS452/552; EE465/505. Clipping & Scan Conversion

Space-based Partitioning Data Structures and their Algorithms. Jon Leonard

Bounding Volume Hierarchies. CS 6965 Fall 2011

Collision Detection II. These slides are mainly from Ming Lin s course notes at UNC Chapel Hill

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

Kinetic BV Hierarchies and Collision Detection

Geometry proxies (in 2D): a Convex Polygon

MODELING AND HIERARCHY

Topics. Ray Tracing II. Transforming objects. Intersecting transformed objects

Simulation in Computer Graphics Space Subdivision. Matthias Teschner

Computer Graphics Ray Casting. Matthias Teschner

Geometric Algorithms. Geometric search: overview. 1D Range Search. 1D Range Search Implementations

INFOGR Computer Graphics. J. Bikker - April-July Lecture 11: Visibility. Welcome!

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

CS580: Ray Tracing. Sung-Eui Yoon ( 윤성의 ) Course URL:

Last Time: Acceleration Data Structures for Ray Tracing. Schedule. Today. Shadows & Light Sources. Shadows

l Without collision detection (CD), it is practically impossible to construct e.g., games, movie production tools (e.g., Avatar)

CS 563 Advanced Topics in Computer Graphics QSplat. by Matt Maziarz

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

Culling. Computer Graphics CSE 167 Lecture 12

Computational Geometry. Lecture 17

Real-Time Collision Detection for Dynamic Virtual Environments

Transcription:

Spatial Data Structures and Acceleration Algorithms Real-time Renderg Performance Goals Spatial Structures Boundg Volume Hierarchies (BVH) Bary Space Partiong(BSP) Trees, Octrees Scene Graphs Cullg Techniques Backface Cullg View Frustum, Portal Cullg Occlusion Cullg Level of Detail Renderg ITCS 4010/5010:Game Enge Design 1 Spatial Structures/ Acceleration Algorithms

Real-Time Renderg Performance Goals High frame rate (60-85 fps) High resolution (1600 by 1200) More realistic objects : no upper limit, Boeg 777 model - 500M polygons! Spatial data structures, cullg techniques and LOD renderg work towards these goals. ITCS 4010/5010:Game Enge Design 2 Spatial Structures/ Acceleration Algorithms

Spatial Data Structures Data structures that organize geometry 2D or 3D or higher The goal is faster processg Needed for most speed-up techniques Primary Applications: Games, movie production renderg tools permittg Faster real-time renderg, tersection testg, collision detection, ray tracg, global illumation ITCS 4010/5010:Game Enge Design 3 Spatial Structures/ Acceleration Algorithms

Spatial Data Structures Organize geometry to some type of a hierarchy In general, parents enclose the children s (geometry) extents. Performance Advantage: Generally from O(n) to O(lg n) Construction is expensive, done as preprocess. ITCS 4010/5010:Game Enge Design 4 Spatial Structures/ Acceleration Algorithms

Spatial Data Structures: Why? Example: Want to pick the object user clicks on (shoot a monster, move towards an object) A hierarchcy can be used to improve performance of spatial queries: Test the root first Descend recursively as needed Termate traversal when possible ITCS 4010/5010:Game Enge Design 5 Spatial Structures/ Acceleration Algorithms

Boundg Volume Hierarchies (BVH) Sphere, Boxes (Axis- Most common boundg volumes (BVs): aligned (AABB) and Oriented OBB) The BV does not contibute to the rendered image rather, encloses an object Data Structure is a k-ary tree Leaf nodes have geometry Internal nodes have at most k children Internal nodes BV encloses all geometry its subtree ITCS 4010/5010:Game Enge Design 6 Spatial Structures/ Acceleration Algorithms

Tree Structures Height of tree, h: longest path from root to leaf Balanced Tree: All leaves at height h or h + 1 Height of balanced tree with n nodes: lg k n k = 2 (bary tree) is most common, also k = 4, 8, quadtrees and octrees. ITCS 4010/5010:Game Enge Design 7 Spatial Structures/ Acceleration Algorithms

Buildg a BVH Example: Axis-aligned BB, top-down approach Split along longest axis ITCS 4010/5010:Game Enge Design 8 Spatial Structures/ Acceleration Algorithms

Buildg a BVH:Termation Criteria Boundg Volume is empty When only one primitive (e.g. triangle) is side BV Less than n (user defed) primitives is side BV When recursion level l has been reached ITCS 4010/5010:Game Enge Design 9 Spatial Structures/ Acceleration Algorithms

Bary Space Partitiong Trees Pioneered by Sutherland, advanced by Naylor (1978) Idea: Recursive subdivision of space: Divide space with a planes Sort geometry to the space it belongs Resultg orderg is view dependent The earliest games to use BSP trees : Doom (early 90s) Applications: visible surface determation, ray tracg, collision detection Two types: Axis-aligned, Polygon alighned ITCS 4010/5010:Game Enge Design 10 Spatial Structures/ Acceleration Algorithms

Axis-Aligned BSP Tree Partitiong planes are aligned with the prcipal axes, X, Y, Z ITCS 4010/5010:Game Enge Design 11 Spatial Structures/ Acceleration Algorithms

Axis-Alighned BSP Tree Each ternal node holds a partitiong plane Leaf nodes hold geometry Different from Boundg Volume Hierarchy: Encloses entire space and provides sortg (approximate) The BV hierarchy can be constructed any way (no sort), use any BV ITCS 4010/5010:Game Enge Design 12 Spatial Structures/ Acceleration Algorithms

Usg an Axis-Alighned BSP Tree Test the planes agast view pot, startg from the root. Contue on the far side to sort front to back Rough sortg order. ITCS 4010/5010:Game Enge Design 13 Spatial Structures/ Acceleration Algorithms

Polygon (Plane)-Aligned BSP Tree Partitioners are aligned with polygon faces Provides an exact sortg order Orderg can be generated near real-time for any viewg position; no z-buffer required ITCS 4010/5010:Game Enge Design 14 Spatial Structures/ Acceleration Algorithms

Polygon (Plane)-Aligned BSP Tree Contuous Space Representation. Represents geometry with hyperplanes. Convex decomposition of space by recursive subdivision. Internal nodes conta discontuities(planes), leaf nodes represent convex regions. a a c d b c b Viewer d ITCS 4010/5010:Game Enge Design 15 Spatial Structures/ Acceleration Algorithms

Polygon Aligned BSP Tree: Tree Construction a c d b ITCS 4010/5010:Game Enge Design 16 Spatial Structures/ Acceleration Algorithms

a c d b a ITCS 4010/5010:Game Enge Design 17 Spatial Structures/ Acceleration Algorithms

a c d b a b ITCS 4010/5010:Game Enge Design 18 Spatial Structures/ Acceleration Algorithms

a c d b a c b ITCS 4010/5010:Game Enge Design 19 Spatial Structures/ Acceleration Algorithms

a c d b a c b d ITCS 4010/5010:Game Enge Design 20 Spatial Structures/ Acceleration Algorithms

Determg Visible Surface usg the BSP Tree a a c d b c b Viewer d Pat faces back to front, as faces front cannot obscure those that are behd. Classification is performed recursively, resultg generatg a priority order of faces, for a given viewer position. The BSP tree is dependent of viewer location, so long as the objects ITCS 4010/5010:Game Enge Design 21 Spatial Structures/ Acceleration Algorithms

Octrees Similar to axis-aligned BSP trees, but subdivision is done simultaneously along all 3 dimensions 2D variant is the quadtree, shown above: In 3D each square (or rectangle) becomes a box, and 8 children ITCS 4010/5010:Game Enge Design 22 Spatial Structures/ Acceleration Algorithms

Octrees Expensive to rebuild (as are BSPs) Loose octrees: a relaxation to avoid problems Octrees can be used to Speed up ray tracg Faster pickg Cullg techniques Are not used that often real-time contexts ITCS 4010/5010:Game Enge Design 23 Spatial Structures/ Acceleration Algorithms

Scene Graphs Boundg Volume Hierarchies have 2 advantages, (1) Simple to understand, (2) Simple to implement BVHs store only geometry Scene Graph is an extended BVH with lights, textures, transforms, and more. ITCS 4010/5010:Game Enge Design 24 Spatial Structures/ Acceleration Algorithms

Scene Graphs Scene Graphs add structure to environments Instancg (hierarchical modelg) makes this structure graph (rather than a tree) Origally troduced SGI Inventor, followed by VRML, Java3D, etc. Scene Graph Traversal: top to bottom, left to right ITCS 4010/5010:Game Enge Design 25 Spatial Structures/ Acceleration Algorithms

ITCS 4010/5010:Game Enge Design 26 Spatial Structures/ Acceleration Algorithms