CS535 Fall Department of Computer Science Purdue University

Similar documents
Spatial Data Structures

Spatial Data Structures

Spatial Data Structures

Spatial Data Structures

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

Spatial Data Structures

Ray Tracing Acceleration Data Structures

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

Acceleration Data Structures

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

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

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

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

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

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

improving raytracing speed

Accelerated Raytracing

Collision and Proximity Queries

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

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

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

Spatial data structures in 2D

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

Intersection Acceleration

Organizing Spatial Data

MODELING AND HIERARCHY

COMP 175: Computer Graphics April 11, 2018

Foundations of Multidimensional and Metric Data Structures

Geometric data structures:

Spatial Data Structures and Acceleration Algorithms

Recall: Inside Triangle Test

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

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

9. Visible-Surface Detection Methods

Speeding Up Ray Tracing. Optimisations. Ray Tracing Acceleration

Image Rotation Using Quad Tree

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

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

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

Accelerating Ray Tracing

11 - Spatial Data Structures

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

Acceleration Data Structures for Ray Tracing

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

Second degree equations - quadratics. nonparametric: x 2 + y 2 + z 2 = r 2

Algorithms for GIS:! Quadtrees

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

Spatial Data Structures. Steve Rotenberg CSE168: Rendering Algorithms UCSD, Spring 2017

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

Collision Detection based on Spatial Partitioning

Lecture 2 - Acceleration Structures

Accelerating Ray-Tracing

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

Bounding Volume Hierarchies. CS 6965 Fall 2011

Universiteit Leiden Computer Science

Computer Graphics II

Computer Graphics. Bing-Yu Chen National Taiwan University

Subdivision Of Triangular Terrain Mesh Breckon, Chenney, Hobbs, Hoppe, Watts

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

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

Ray Tracing Acceleration. CS 4620 Lecture 20

CMSC 425: Lecture 10 Geometric Data Structures for Games: Index Structures Tuesday, Feb 26, 2013

Dynamic Bounding Volume Hierarchies. Erin Catto, Blizzard Entertainment

Ray Tracing: Intersection

Spatial Data Structures for Computer Graphics

FMM Data Structures. Content. Introduction Hierarchical Space Subdivision with 2 d -Trees Hierarchical Indexing System Parent & Children Finding

Motivation for B-Trees

Questions from Last Week? Extra rays needed for these effects. Shadows Motivation

CS 431/636 Advanced Rendering Techniques

Ray Tracing Acceleration. CS 4620 Lecture 22

Speeding up your game

Spatial Data Structures and Acceleration Algorithms

An improvement in the build algorithm for Kd-trees using mathematical mean

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Drawing the Visible Objects

Comparison of hierarchies for occlusion culling based on occlusion queries

Collision Detection with Bounding Volume Hierarchies

The exam begins at 2:40pm and ends at 4:00pm. You must turn your exam in when time is announced or risk not having it accepted.

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

Data Structures and Algorithms

Parallel Physically Based Path-tracing and Shading Part 3 of 2. CIS565 Fall 2012 University of Pennsylvania by Yining Karl Li

Geometry proxies (in 2D): a Convex Polygon

CSG obj. oper3. obj1 obj2 obj3. obj5. obj4

Computing Visibility. Backface Culling for General Visibility. One More Trick with Planes. BSP Trees Ray Casting Depth Buffering Quiz

Collision Detection. Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering

More Hidden Surface Removal

Simulation in Computer Graphics Space Subdivision. Matthias Teschner

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

CS 352: Computer Graphics. Hierarchical Graphics, Modeling, And Animation

Hidden Surface Elimination: BSP trees

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

Ray-tracing Acceleration. Acceleration Data Structures for Ray Tracing. Shadows. Shadows & Light Sources. Antialiasing Supersampling.

Advanced 3D-Data Structures

CPSC GLOBAL ILLUMINATION

Ray Casting. Outline in Code. Outline. Finding Ray Direction. Heckbert s Business Card Ray Tracer. Foundations of Computer Graphics (Fall 2012)

Computer Graphics. - Spatial Index Structures - Philipp Slusallek

VIII. Visibility algorithms (II)

Lesson 05. Mid Phase. Collision Detection

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

Geometric Data Structures

Transcription:

Spatial Data Structures and Hierarchies CS535 Fall 2010 Daniel G Aliaga Daniel G. Aliaga Department of Computer Science Purdue University

Spatial Data Structures Store geometric information Organize geometric information Permit fast access to/of geometric information i Applications Heightfields Collision detection (core to *many* uses) Simulations (e.g., surgery, games) Rendering (e.g., need to render fast!)

Hierarchical Modeling Concept is old but fundamental Hierarchical geometric models for visible surface algorithms, James Clark 1976

Hierarchical Modeling Trees and Scene Graphs

Hierarchical Modeling Trees and Scene Graphs

Hierarchical Modeling Trees and Scene Graphs

Bounding Volumes Problem: Suppose you need to intersect rays with a scene Suppose you have a scene divided into objects Solution: bottom up Wrap complex objects into simple ones Boxes, spheres, other shapes Organize into a tree

Bounding Volume Hierarchy (BVH) How to building an axis aligned bounding box (AABB) BVH? How to intersect? Complexity? Problem cases?

AABB BVH Example construction Given M 2D points, use k means clustering to determine clusters Then group nearby clusters (e.g., use Voronoi diagram or Delaunay triangulation) And iteratively form a tree from the bottom up In each node, approximate the contained points using an axis aligned bounding box e.g., box = [min of all contained pts, max of all contained pts]

Bounding Volume Hierarchy (BVH) How to building an oriented bounding box (OBB) BVH? How to intersect? Complexity? Problem cases? Advantages over axis aligned?

OBB BVH Example construction Similar to AABB BVH but fit an oriented box to the points within each cluster/node of the tree Methods: Sample possible rotations and sizes in order to pick the best box Compute distance of points to a line and optimize the line equation parameters until finding the line that best approximates all points Then compute a box width consider the benefit/cost of the box size e.g., totally containing all points might make the box very large; could also choose to mostly contain the points however, what does this mean with regards to operations using the BVH?

Space Subdivision Binary tree / Quadtree / Octree k D tree Binary Space Partitioning (BSP) Tree

Binary Tree A directed edge refers to the link from the parent to the child (the arrows in the picture of the tree). The root node of a tree is the node with no parents; there is at most one root node in a rooted tree. A leaf is a node that has no children. The depth of a node is the length of the path from the root to the node. The root node is at depth zero. The height of a tree is the depth of its furthest leaf. A tree with only a root node has a height of zero. Siblings are nodes that share the same parent node Size = 9 Height = 3 Root node = 2

Binary Tree Operations Search Insert Delete

Quadtree Similar to binary tree, but have 4 children per node Each node corresponds to one of four rectangular regions of the current quad

Quadtree Similar to binary tree, but have 4 children per node Each node corresponds to one of four rectangular regions of the current quad

Quadtree Point quadtree Partitions depend on the data Thequad is divided using the previous point within it

Quadtree Point quadtree Partitions depend on the data Thequad is divided using the previous point within it Advantage Data dependent subdivision reduces (unnecessary) number of quads Disadvantage Quads do not tightly hl approximate region surrounding the point

Quadtree Matrix (MX) quadtree Location of partition lines independent of the data Theoccupied nodes areallsubdivided all until a tight fitting box

Quadtree MX quadtree Location of partition lines independent of the data Theoccupied nodes areallsubdivided all until a tight fitting box Advantage Quads leaf nodes always tightly approximate region surrounding the point Disadvantage Potentially lots of levels l from root to a point

Quadtree Point Region (PR) quadtree Location of partition lines independent of the data Thenodes areallsubdivided all until p or less points per node (e.g., p=1)

Quadtree PR quadtree Location of partition lines independent of the data Thenodes areallsubdivided all until p or less points per node (e.g., p=1) Advantage Partition lines are known and paths from root to point is only as long as needs to be Disadvantage Quads do not tightly hl approximate region surrounding the point

Quadtree Comparison Point QT MX QT PR QT

Demo http://donar.umiacs.umd.edu/quadtree/ umd

Octree Analogous to Quadtree but extended to 3D Each node is divided into eight subboxes

Octree Analogous to Quadtree but extended to 3D Each node is divided into eight subboxes Similar, il there are Point octrees MX octrees PR octrees

K D tree Partition each dimension in a cyclical fashion Thus, can be applied to 2D, 3D, or higher dimensions Each node stores a next partitioned halfspace of data points (or of the data space)

k D tree A 3 dimensional kd tree The first split (red) cuts the root cell (white) into two Each of which is then split (green) into two subcells Each of those four is split (blue) into two subcells The final eight called leaf cells The yellow spheres represent the tree vertices The resulting kd tree decomposition The resulting kd tree

Demo http://donar.umiacs.umd.edu/quadtree/ umd

Binary Space Partitioning (BSP) Similar to k D tree but splitting lines/planes are not necessarily axis aligned Can adapt better to data Was algorithm used for visibility sorting

Binary Space Partitioning (BSP) Suitable for any number of dimensions Separating planes are shown in black and objects in blue) BSP trees

Demo More stuff at http://donar.umiacs.umd.edu/quadtree R tree? See H. Samet, Foundations of Multidimensional and Mti Metric Data Structures, t Morgan Kaufmann, San Francisco, 2006