1 Speeding Up Ray Tracing Images from Virtual Light Field Project www.cs.ucl.ac.uk/vlf ©Slides Anthony Steed 1999 & Mel Slater 2004.

Slides:



Advertisements
Similar presentations
GR2 Advanced Computer Graphics AGR
Advertisements

Christian Lauterbach COMP 770, 2/16/2009. Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques.
Intersection Testing Chapter 13 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
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.
Collision Detection and Resolution Zhi Yuan Course: Introduction to Game Development 11/28/
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.
Hidden Surface Removal Why make the effort?  Realistic models.  Wasted time drawing. OpenGL and HSR  OpenGL does handle HSR using the depth buffer.
Visibility Culling. Back face culling View-frustrum culling Detail culling Occlusion culling.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Ray Tracing Variants Distributed ray tracing Generalized rays Cone Tracing Beam Tracing Pencil.
Introduction to 3D Graphics Lecture 5: From Realism to Real-Time Anthony Steed University College London.
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
Tomas Mőller © 2000 Speeding up your game The scene graph Culling techniques Level-of-detail rendering (LODs) Collision detection Resources and pointers.
18.1 Si31_2001 SI31 Advanced Computer Graphics AGR Lecture 18 Image-based Rendering Light Maps What We Did Not Cover Learning More...
Computer Graphics (Fall 2005) COMS 4160, Lecture 21: Ray Tracing
Introduction General Data Structures - Arrays, Linked Lists - Stacks & Queues - Hash Tables & Binary Search Trees - Graphs Spatial Data Structures -Why.
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.
Spatial Data Structure: Quadtree, Octree,and BSP tree Mengxia Zhu Fall 2007.
Collision Detection David Johnson Cs6360 – Virtual Reality.
10/11/2001CS 638, Fall 2001 Today Kd-trees BSP Trees.
Hidden Surface Removal
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
Computer Graphics 2 Lecture x: Acceleration Techniques for Ray-Tracing Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
Data Structures for Computer Graphics Point Based Representations and Data Structures Lectured by Vlastimil Havran.
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.
Kansas State University Department of Computing and Information Sciences CIS 736: Computer Graphics Wednesday, February 23, 2000 William H. Hsu Department.
The Visibility Problem In many environments, most of the primitives (triangles) are not visible most of the time –Architectural walkthroughs, Urban environments.
David Luebke10/9/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
2D/3D Shape Manipulation, 3D Printing Shape Representations Slides from Olga Sorkine February 20, 2013 CS 6501.
On a Few Ray Tracing like Algorithms and Structures. -Ravi Prakash Kammaje -Swansea University.
Visible-Surface Detection Jehee Lee Seoul National University.
1 Shadows (2) ©Anthony Steed Overview n Shadows – Umbra Recap n Penumbra Analytical v. Sampling n Analytical Aspect graphs Discontinuity meshing.
Institute of C omputer G raphics, TU Braunschweig Hybrid Scene Structuring with Application to Ray Tracing 24/02/1999 Gordon Müller, Dieter Fellner 1 Hybrid.
12/4/2001CS 638, Fall 2001 Today Managing large numbers of objects Some special cases.
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.
Recursion and Data Structures in Computer Graphics Ray Tracing 1.
Controlling a Virtual Camera Ross Ptacek University of Alabama Birmingham.
University of Montreal & iMAGIS A Light Hierarchy for Fast Rendering of Scenes with Many Lights E. Paquette, P. Poulin, and G. Drettakis.
第五课 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.
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.
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.
CS552: Computer Graphics Lecture 28: Solid Modeling.
CSE 554 Lecture 5: Contouring (faster)
Bounding Volume Hierarchies and Spatial Partitioning
Bounding Volume Hierarchies and Spatial Partitioning
Deformable Collision Detection
Modeliranje kompleksnih modelov
Real-Time Ray Tracing Stefan Popov.
Ray Tracing Acceleration Techniques
3D Object Representations
Anti-aliased and accelerated ray tracing
CMSC 635 Ray Tracing.
Deformable Collision Detection
Anti-aliased and accelerated ray tracing
Modeliranje kompleksnih modelov
Presentation transcript:

1 Speeding Up Ray Tracing Images from Virtual Light Field Project ©Slides Anthony Steed 1999 & Mel Slater 2004

2 Optimisations n Limit the number of rays n Make the ray test faster for shadow rays –the main drain on resources in there are several lights for primary rays for all rays over 90% of the cost of raytracing is in ray-object intersection tests

3 Primary Rays n Use a z-buffer! n Instead of writing colour write and object identifier Easy to support in OpenGL - turn off lighting, do flat shading and encode object id within 24bit colour n Difficult technique to use elsewhere because rays are no longer spatially coherent and evenly spaced

4 General Rays n Techniques to use bounding volumes hierarchical bounding volumes space subdivision –regular –adaptive ray coherence

5 Bounding Volume n Find a tight bounding volume and use it for a first reject test n If hit volume then test full object Axis aligned Bounding Box Bounding Sphere

6 Fast BV Tests n Box-Ray test a box is three sets of parallel planes, each set orthogonal to the other two –Calculate t near for each of the three plane pairs –find max of the 3 t near –Calculate t far for each of the three plane pairs –find min of the 3 t far If max t near is greater that min t far, then the box is not intersected

7 Fast BV Tests (EG) t near x t far y t far x t near x t near y t far x

8 Choosing a Volume n Choice depends on the cost of the test and the fit of the shape The “void” area can be very large n More efficient fitting shapes are possible (this is still a research area e.g. k-dops)

9 Hierarchical Bounding Volumes r1 r2

10 Choosing a HBV n Scene graph might not map to a decent space partitioning group BVs based on proximity rather than scene graph position n You would sort the HBV using a BSP tree anyway...

11 Regular Spatial Subdivision n Regular 3D grid of “voxels”

12 Details on the RSS n Testing Each voxel keeps a list of objects that intersect this voxel Need for a ‘mailbox’ system where voxel also keeps track of what has already intersected it to avoid duplications. n Size of voxels Obvious trade off on granularity of voxels

13 Adaptive Spatial Subdivision n The octree idea (illustrated with a quadtree!)

14 Building the Octree n Recursively split the cells into eight, until each cell meets some criteria e.g. previous diagram was “only one object intersects each cell” n Advantage is clear - cells are not wasted on void areas

15 Tracing an Octree n Find octree cell containing start point n If no intersection, find intersection (I) of ray with cube that surround the octree n Find (I) in the octree it is moved a little along the ray n Repeat

16 kD-tree / BSP Tree n Similar to octree, but orthogonal splitting planes are chosen to provide a good search tree Split based on balancing object numbers and minimising volume disparity

17 Ray Coherence Methods n Light Buffer n Ray Classification Scheme

18 Light Buffer n Haines and Greenberg, 1986 n Problem with shadow rays is that for every intersection we trace and additional n rays for each light r l0l0 l1l1

19 Light Buffer n Enclose light in a box. n Cells of box faces store objects

20 Construction - 2D Analogue A B C1 - C2 - A, B, C C3 - A C4 - C1 C2 C3 C4 C

21 Ray Classification n Arvo and Kirk, 1987 n Group together similar rays (rather than similar objects) n Similar rays should intersect the same groups of objects n Very elegant method

22 Ray Classification - Rays are Points n Every ray is represented as a point in 5D space (R 5 ) (x,y,z,u,v) where (u,v) is the directional component, and (x,y,z) is the origin (x,y,z) (u,v) -Y +X This ray is (x,y,z) inside box in direction (u,v) on +X plane There are 6 planes -X,+X,-Y,+Y,-Z,+Z

23 Ray Classification – 5 Tasks n E is the subset of R 5 containing every possible ray in the scene n E 1, E 2, …, E n is a partition of E formed as a 32-tree –The 5D hypercube can be split along each of its axis to form 32 children, and so on… n For each E i there will be a C i - a set of objects intersected by at least one of the ray s in E i n For any ray find the E i to which it belongs n Then intersect it with the objects in C i n (see details in the book – the important aspect to undrestand is the idea of ray classification – similar rays will intersect similar groups of objects!).

24 Virtual Light Field Approach n Very recent development n For a fixed ‘uniformly distributed’ set of rays, find for each ray all of its intersections with objects in the environment n Each ray maintains a list of objects it intersects (and where along the ray) n Given any arbitrary ray that emerges in ray tracing, find the closest ray in the ray set, and use the rays that this intersects as a candidate set of objects. n Several complications – but the idea is clear.

25 Summary n Ray intersection is computationally expensive and we need to reduce it n Methods used fall into 3 classes Bound the objects Partition the object space Partition the ray space n Ray tracing can be tremendously speeded up by appropriate use of modern hardware (see papers of Ward et al, and also UCL’s Virtual Light Field project ).