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

Slides:



Advertisements
Similar presentations
GR2 Advanced Computer Graphics AGR
Advertisements

Sven Woop Computer Graphics Lab Saarland University
Restart Trail for Stackless BVH Traversal Samuli Laine NVIDIA Research.
CSE 681 Bounding Volumes. CSE 681 Bounding Volumes Use simple volume enclose object(s) tradeoff for rays where there is extra intersection test for object.
Collision Detection CSCE /60 What is Collision Detection?  Given two geometric objects, determine if they overlap.  Typically, at least one of.
Ray Tracing Ray Tracing 1 Basic algorithm Overview of pbrt Ray-surface intersection (triangles, …) Ray Tracing 2 Brute force: Acceleration data structures.
Computer graphics & visualization Collisions. computer graphics & visualization Simulation and Animation – SS07 Jens Krüger – Computer Graphics and Visualization.
Ray Tracing CMSC 635. Basic idea How many intersections?  Pixels  ~10 3 to ~10 7  Rays per Pixel  1 to ~10  Primitives  ~10 to ~10 7  Every ray.
Visibility Culling. Back face culling View-frustrum culling Detail culling Occlusion culling.
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
Christian Lauterbach COMP 770, 2/11/2009
Ray Tracing Acceleration Structures Solomon Boulos 4/16/2004.
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.
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.
Collision Detection David Johnson Cs6360 – Virtual Reality.
10/11/2001CS 638, Fall 2001 Today Kd-trees BSP Trees.
10/02/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Octrees.
Computer Graphics 2 Lecture x: Acceleration Techniques for Ray-Tracing Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
Spatial Data Structures Jason Goffeney, 4/26/2006 from Real Time Rendering.
10/09/2001CS 638, Fall 2001 Today Spatial Data Structures –Why care? –Octrees/Quadtrees –Kd-trees.
1 Speeding Up Ray Tracing Images from Virtual Light Field Project ©Slides Anthony Steed 1999 & Mel Slater 2004.
David Luebke10/9/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
Graphics Graphics Korea University cgvr.korea.ac.kr Solid Modeling 고려대학교 컴퓨터 그래픽스 연구실.
Stefan PopovHigh Performance GPU Ray Tracing Real-time Ray Tracing on GPU with BVH-based Packet Traversal Stefan Popov, Johannes Günther, Hans- Peter Seidel,
On a Few Ray Tracing like Algorithms and Structures. -Ravi Prakash Kammaje -Swansea University.
Real-Time Rendering SPEEDING UP RENDERING Lecture 04 Marina Gavrilova.
PRESENTED BY – GAURANGI TILAK SHASHANK AGARWAL Collision Detection.
Real-time Graphics for VR Chapter 23. What is it about? In this part of the course we will look at how to render images given the constrains of VR: –we.
Saarland University, Germany B-KD Trees for Hardware Accelerated Ray Tracing of Dynamic Scenes Sven Woop Gerd Marmitt Philipp Slusallek.
CIS 350 – I Game Programming Instructor: Rolf Lakaemper.
Interactive Rendering With Coherent Ray Tracing Eurogaphics 2001 Wald, Slusallek, Benthin, Wagner Comp 238, UNC-CH, September 10, 2001 Joshua Stough.
Fast BVH Construction on GPUs (Eurographics 2009) Park, Soonchan KAIST (Korea Advanced Institute of Science and Technology)
Binary Space Partitioning Trees Ray Casting Depth Buffering
David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
第五课 Ray Tracing. Overview of the Section Why Ray Tracing? What is Ray Tracing? How to tracing rays? How to accelerating ray-tracing?
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
Ray Tracing II. HW1 Part A due October 10 Camera module Object module –Read from a file –Sphere and Light only Ray tracer module: –No shading. No reflection.
Presented by Paul Phipps
Maths & Technologies for Games Spatial Partitioning 2
Advanced topics Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2006/01/04 with slides by Brian Curless, Zoran Popovic, Mario Costa Sousa.
CSE554Contouring IISlide 1 CSE 554 Lecture 5: Contouring (faster) Fall 2015.
CSE554Contouring IISlide 1 CSE 554 Lecture 3: Contouring II Fall 2011.
CSE554Contouring IISlide 1 CSE 554 Lecture 5: Contouring (faster) Fall 2013.
MIT EECS 6.837, Durand and Cutler Acceleration Data Structures for Ray Tracing.
01/28/09Dinesh Manocha, COMP770 Visibility Computations Visible Surface Determination Visibility Culling.
Ray Tracing Optimizations
David Luebke 3/5/2016 Advanced Computer Graphics Lecture 4: Faster Ray Tracing David Luebke
Ray Tracing Acceleration (5). Ray Tracing Acceleration Techniques Too Slow! Uniform grids Spatial hierarchies K-D Octtree BSP Hierarchical grids Hierarchical.
David Luebke3/12/2016 Advanced Computer Graphics Lecture 3: More 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”
Ray Tracing Acceleration (1). Acceleration of Ray Tracing Goal: Reduce the number of ray/primitive intersections.
Ray Tracing Acceleration (3)
Hierarchical Data Structure in Game Programming Yanci Zhang Game Programming Practice.
CSE 554 Lecture 5: Contouring (faster)
Bounding Volume Hierarchies and Spatial Partitioning
STBVH: A Spatial-Temporal BVH for Efficient Multi-Segment Motion Blur
Collision Detection Spring 2004.
Bounding Volume Hierarchies and Spatial Partitioning
Deformable Collision Detection
Modeliranje kompleksnih modelov
Real-Time Ray Tracing Stefan Popov.
Parts of these slides are based on
Ray Tracing, Part 1 Dinesh Manocha COMP 575/770.
Collision Detection.
Deformable Collision Detection
Ray Tracing Sung-Eui Yoon (윤성의) CS580: Course URL:
BVH Student: Jack Chang.
Modeliranje kompleksnih modelov
Presentation transcript:

Christian Lauterbach COMP 770, 2/16/2009

Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques  Ray packets  Optimized hierarchy construction

Last lecture  Ray Tracing  For each pixel: generate ray  For each primitive:  Does ray hit primitive?  Yes: Test depth / write color  That means linear time complexity in number of primitives!

Acceleration structures  Goal: fast search operation for ray that returns all intersecting primitives  Then test only against those  Operation should take sub-linear time  In practice: conservative superset

Acceleration structures  Broad classification:  Spatial hierarchies  Grids  Octrees  Kd-trees, BSP trees  Object hierarchies  Bounding volume hierarchies  Spatial kd-trees

Spatial hierarchies: grids  Regular subdivision of space into cells  Cells almost always cubes  Each object is referenced in each cell it overlaps  Nested grids also possible  Ray tracing with the grid:  Find entry cell of ray  For each cell:  Intersect with all objects in cell. If hit, terminate.  Otherwise, walk to next cell ray can hit

Spatial hierarchies: kd-trees  Binary tree of space subdivisions  Each is axis-aligned plane x yy

Spatial hierarchies: kd-trees  Traversing a kd-tree: recursive  Start at root node  For current node:  If inner node:  Find intersection of ray with plane  If ray intersects both children, recurse on near side, then far side  Otherwise, recurse on side it intersects  If leaf node:  Intersect with all object. If hit, terminate.

RT with the kd-tree (2) ray 1 ray 2 ray 3 split plane 'near' node 'far' node  what can the ray possibly hit?

RT with the kd-tree (3)  three cases:  hitpoint above split: far node only  hitpoint below split: near node only  otherwise: near, then far  'above' and 'below' rather vague  use distance t along ray ray = origin + t *direction

RT with the kd-tree (4)  when does the ray intersect? split plane 'near' node 'far' node t_min t_max t_split

Kd-tree traversal  Simple and fast implementation  In practice: using stack, not recursion  Very quick intersection test (couple FLOPS + tests)  Overall: logarithmic complexity for each ray

Object hierarchies: BVHs  Different approach: subdivide objects, not space  Hierarchical clustering of objects  Each cluster represented by bounding volume  Binary tree  Each parent node fully contains children

Bounding volumes  Practically anything can be bounding volume  Just need ray intersection method  Typical choices:  Spheres  Axis-aligned bounding boxes (AABBs)  Oriented bounding boxes (OBBs)  k-DOPs  Trade-off between intersection speed and how closely the BV encloses the geometry

BVH traversal  Recursive algorithm:  Start with root node  For current node:  Does ray intersect node’s BV? If no, return  Is inner node?  Yes, recurse on children  Is leaf node?  Intersect with object(s) in node, store intersection results  Note: can’t return after first intersection!

Choosing a structure  There is no ‘best’ acceleration structure  All have pros and cons  Grid: + fast construction - bad for high local detail (teapot/stadium)

Choosing a structure  There is no ‘best’ acceleration structure  All have pros and cons  kd-tree: + fast traversal - expensive build, only static scenes

Choosing a structure  There is no ‘best’ acceleration structure  All have pros and cons  BVH: + can be updated for dynamic scenes - traversal more expensive than kd-tree

Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques  Ray packets  Optimized hierarchy construction

Ray Packets  Often have large set of rays close together  Idea: trace rays in coherent groups (ray packets) Viewer Screen

Ray coherence  How does this change tracing?  Traversal and object intersection work on group of rays at a time  Also generate secondary (shadow, …) rays in packets  General idea:  If one ray intersects, all are intersected

BVH traversal  Recursive algorithm:  Start with root node  For current node:  Does ray intersect node’s BV? If no, return  Is inner node?  Yes, recurse on children  Is leaf node?  Intersect ray with all object(s) in node, store intersection results

BVH packet traversal  Recursive algorithm:  Start with root node  For current node:  Does any ray intersect node’s BV? If no, return  Is inner node?  Yes, recurse on children  Is leaf node?  Intersect all rays with all object(s) in node, store intersection results

Ray packet advantages  Why does this make things faster?  Less memory bandwidth: nodes/objects only loaded once for rays in packet  Allows data parallel processing!  Current CPUs: e.g. Intel SSE  All GPUs  Disadvantage:  Rays can be intersected with objects/nodes they would never hit!

Data parallelism  Essentially vector operations (SIMD)  Operations work on all elements in parallel v1v2v3v4v5v6v7v8 v1v2v3v4v5v6v7v8w1w2w3w4w5w6w7w8 + = v1+w1v2+w2v3+w3v4+w4v5+w5v6+w6v7+w7v8+w8

Data parallelism  Vector operations usually as fast as a single scalar operation  Intel SSE: 4-wide vectors  GPUs: 8-32 wide  Cell: 4-wide  Vector processors: up to 64,000!

SIMD ray processing  Can use SIMD units to parallelize for rays  Each vector has one component from one ray  Thus, can process small group at same speed as one ray! ray1ray2ray3ray4ray5ray6ray7ray8tri i 

Optimized hierarchy construction  The way the hierarchy is constructed has high impact on traversal performance