Lecture 4 - Real-time Ray Tracing

Similar documents
INFOMAGR Advanced Graphics. Jacco Bikker - February April Welcome!

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

Lecture 2 - Acceleration Structures

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

Acceleration Data Structures

INFOMAGR Advanced Graphics. Jacco Bikker - February April Welcome!

Lecture 11 - GPU Ray Tracing (1)

EDAN30 Photorealistic Computer Graphics. Seminar 2, Bounding Volume Hierarchy. Magnus Andersson, PhD student

Ray Tracing. Computer Graphics CMU /15-662, Fall 2016

INFOGR Computer Graphics

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

Spatial Data Structures

EFFICIENT BVH CONSTRUCTION AGGLOMERATIVE CLUSTERING VIA APPROXIMATE. Yan Gu, Yong He, Kayvon Fatahalian, Guy Blelloch Carnegie Mellon University

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

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

Intersection Acceleration

Ray Tracing Acceleration. CS 4620 Lecture 20

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

Fast Agglomerative Clustering for Rendering

improving raytracing speed

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

Improving Memory Space Efficiency of Kd-tree for Real-time Ray Tracing Byeongjun Choi, Byungjoon Chang, Insung Ihm

Spatial Data Structures

B-KD Trees for Hardware Accelerated Ray Tracing of Dynamic Scenes

Row Tracing with Hierarchical Occlusion Maps

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

Real Time Ray Tracing

Spatial Data Structures

6.837 Introduction to Computer Graphics Final Exam Tuesday, December 20, :05-12pm Two hand-written sheet of notes (4 pages) allowed 1 SSD [ /17]

Accelerated Raytracing

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

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

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

Dynamic Bounding Volume Hierarchies. Erin Catto, Blizzard Entertainment

Practical 2: Ray Tracing

Spatial Data Structures

Ray Tracing Acceleration. CS 4620 Lecture 22

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

Ray Tracing Performance

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

Ray Tracing Acceleration Data Structures

Advanced Ray Tracing

INFOGR Computer Graphics. Jacco Bikker - April-July Lecture 3: Ray Tracing (Introduction) Welcome!

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

CS 465 Program 5: Ray II

Motivation. Sampling and Reconstruction of Visual Appearance. Effects needed for Realism. Ray Tracing. Outline

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

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

Acceleration Data Structures for Ray Tracing

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

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

Computer Graphics. - Rasterization - Philipp Slusallek

Ray Tracing with Multi-Core/Shared Memory Systems. Abe Stephens

Lecture 11: Ray tracing (cont.)

Ray Tracing. Outline. Ray Tracing: History

Kinetic BV Hierarchies and Collision Detection

Computer Graphics. - Spatial Index Structures - Philipp Slusallek

Fast BVH Construction on GPUs

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

Collision Detection. Pu Jiantao.

Efficient Clustered BVH Update Algorithm for Highly-Dynamic Models. Kirill Garanzha

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Spring 2012)

CS 4620 Program 4: Ray II

Bounding Volume Hierarchies

Bounding Volume Hierarchies. CS 6965 Fall 2011

Accelerating Ray-Tracing

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

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

Exploiting Local Orientation Similarity for Efficient Ray Traversal of Hair and Fur

Lecture 7 - Path Tracing

Accelerating Ray Tracing

Today. Acceleration Data Structures for Ray Tracing. Cool results from Assignment 2. Last Week: Questions? Schedule

Spatial Data Structures

Enhancing Traditional Rasterization Graphics with Ray Tracing. October 2015

Adaptive Assignment for Real-Time Raytracing

An Evaluation of Multi-Hit Ray Traversal in a BVH Using Existing First-Hit/Any-Hit Kernels: Algorithm Listings and Performance Visualizations

Computer Graphics. - Ray Tracing I - Marcus Magnor Philipp Slusallek. Computer Graphics WS05/06 Ray Tracing I

Graphics 2009/2010, period 1. Lecture 8: ray tracing

Recall: Inside Triangle Test

Massive Model Visualization using Real-time Ray Tracing

Ray Intersection Acceleration

LightSlice: Matrix Slice Sampling for the Many-Lights Problem

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

Lecture 12 - GPU Ray Tracing (2)

Dual-Split Trees Supplemental Materials

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

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

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

Movie: For The Birds. Announcements. Ray Tracing 1. Programming 2 Recap. Programming 3 Info Test data for part 1 (Lines) is available

Lecture 11. More Ray Casting/Tracing

SAH guided spatial split partitioning for fast BVH construction. Per Ganestam and Michael Doggett Lund University

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

Part IV. Review of hardware-trends for real-time ray tracing

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

Holger Dammertz August 10, The Edge Volume Heuristic Robust Triangle Subdivision for Improved BVH Performance Holger Dammertz, Alexander Keller

Intro to Ray-Tracing & Ray-Surface Acceleration

INFOMAGR Advanced Graphics. Jacco Bikker - February April Welcome!

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

Collision Detection with Bounding Volume Hierarchies

Recursive Ray Tracing. Ron Goldman Department of Computer Science Rice University

Transcription:

INFOMAGR Advanced Graphics Jacco Bikker - November 2017 - February 2018 Lecture 4 - Real-time Ray Tracing Welcome! I x, x = g(x, x ) ε x, x + න S ρ x, x, x I x, x dx

Today s Agenda: Introduction Ray Distributions The Top-level BVH Real-time Ray Tracing Assignment 2

Advanced Graphics Real-time Ray Tracing 3 Introduction Cost Breakdown for Ray Tracing: Pixels Primitives Light sources Path segments Using the BVH: Pixels N primitives log N deep tree Light sources Path segments Mind scalability as well as constant cost. Example: scene consisting of 1k spheres and 4 light sources, diffuse materials, rendered to 1M pixels: 1M 5 1k = 5 10 9 ray/prim intersections. (multiply by desired framerate for realtime) Example: scene consisting of 1k spheres and 4 light sources, diffuse materials, rendered to 1M pixels: 1M 5 10 = 5 10 7 ray/(prim or node) intersections. (multiply by desired framerate for realtime)

Advanced Graphics Real-time Ray Tracing 4 Introduction

Advanced Graphics Real-time Ray Tracing 5 Introduction Reality Check Performance is now OK, but we re not quite ready to render a game world.

Advanced Graphics Real-time Ray Tracing 6 Introduction

Today s Agenda: Introduction Ray Distributions The Top-level BVH Real-time Ray Tracing Assignment 2

Advanced Graphics Real-time Ray Tracing 8 Ray Distributions Cost of ray tracing: Dominated by memory access cost. Ray data Node data Triangle data Material data (incl. textures)

Advanced Graphics Real-time Ray Tracing 9 Ray Distributions Primary rays: For a tile of pixels, these are organized in a narrow frustum. All rays share a common origin.

Advanced Graphics Real-time Ray Tracing 10 Ray Distributions Shadow rays: For point lights, shadow rays also tend to travel close together. When traced from the light source, they too have a common origin.

Advanced Graphics Real-time Ray Tracing 11 Ray Distributions Secondary rays: Reflected and refracted rays tend to diverge significantly.

Advanced Graphics Real-time Ray Tracing 12 Ray Distributions Coherence Primary rays and shadow rays for point lights are coherent : they tend to intersect the same primitives; they tend to traverse the same BVH nodes. Our problem: Ray tracing cost is dominated by memory latency. Solution: Amortize cost of fetching data over multiple rays.

Advanced Graphics Real-time Ray Tracing 13 Ray Distributions Coherent Ray Tracing* SIMD: four rays for the price of one. BVHNode::Traverse( Ray r ) { if (!r.intersects( bounds )) return; if (isleaf()) { IntersectPrimitives(); } else { pool[left].traverse( r ); pool[left + 1].Traverse( r ); } } *: Interactive Rendering with Coherent Ray Tracing, Wald et al., 2001

Advanced Graphics Real-time Ray Tracing 14 Ray Distributions Coherent Ray Tracing* SIMD: four rays for the price of one. BVHNode::Traverse( Ray4 r4 ) { if (!r4.intersects( bounds )) return; if (isleaf()) { IntersectPrimitives(); } else { pool[left].traverse( r4 ); pool[left + 1].Traverse( r4 ); } } *: Interactive Rendering with Coherent Ray Tracing, Wald et al., 2001

Advanced Graphics Real-time Ray Tracing 15 Ray Distributions Coherent Ray Tracing Ray packet traversal: intersect four rays with a single BVH node; if any ray in the packet intersects the node, we traverse it; if the node is a leaf node, we intersect the four rays with each primitive in the leaf. Masking: We maintain an active mask for disabling rays that do not intersect a node.

Advanced Graphics Real-time Ray Tracing 16 Ray Distributions Coherent Ray Tracing* SIMD: four rays for the price of one. BVHNode::Traverse( Ray4 r4, bool4 mask4 ) { bool4 hit4 = r4.intersects( bounds ) & mask4; if (none( hit4 )) return; if (isleaf()) { IntersectPrimitives(); } else { pool[left].traverse( r4, hit4 ); pool[left + 1].Traverse( r4, hit4 ); } }

Advanced Graphics Real-time Ray Tracing 17 Ray Distributions Coherent Ray Tracing Results: for coherent packets, memory traffic is reduced; overall performance is improved by ~2.3x. Overhead: if only a single ray requires traversal or intersection, all four rays perform this operation.

Advanced Graphics Real-time Ray Tracing 18 Ray Distributions Large Packets* Cost of memory access can be amortized over more rays by using larger packets. Note that a naïve approach will lead to significant overhead. We therefore add a frustum test to rapidly reject BVH nodes: If the packet frustum does not intersect the node AABB, we discard the node. The cost of this operation is independent of the number of rays in the packet. Likewise, a node is traversed as soon as we find that a ray intersects it. This is also independent of packet size. *: Large Ray Packets for Real-time Whitted Ray Tracing, Overbeck et al., 2008

Advanced Graphics Real-time Ray Tracing 19 Ray Distributions Large Packets Algorithm: 1. Early hit test: test first active ray against AABB 2. Early miss test: test AABB against frustum 3. Brute force test: test all rays until a hit is found. This step yields a new first active ray index. BVHNode::Traverse( RayPacket rp, int first ) { if (!Intersects( rp[first )) // 1 { if (!Intersects( rp.frustum )) return; // 2 FindFirstActive( rp, ++first ); // 3 } if (first < rp.raycount) { if (isleaf()) { IntersectPrimitives( rp ); } else { left.traverse( rp, first ); right.traverse( rp, first ); } } }

Advanced Graphics Real-time Ray Tracing 20 Ray Distributions Large Packets Details: Constructing the frustum Ray order & overhead First / last Optimizations: recursion, SIMD BVHNode::Traverse( RayPacket rp, int first ) { if (!Intersects( rp[first )) // 1 { if (!Intersects( rp.frustum )) return; // 2 FindFirstActive( rp, ++first ); // 3 } if (first < rp.raycount) { if (isleaf()) { IntersectPrimitives( rp ); } else { left.traverse( rp, first ); right.traverse( rp, first ); } } }

Advanced Graphics Real-time Ray Tracing 21 Ray Distributions Frustum Construction Method 1, for primary rays: p 1 Planes are easily defined using the corner rays: p 0 N 1 = (p 0 E) (p 1 p 0 ), d 1 = N 1 E N 2 = (p 1 E) (p 2 p 1 ), d 2 = N 2 E N 3 = (p 2 E) (p 3 p 2 ), d 3 = N 3 E N 4 = (p 3 E) (p 0 p 3 ), d 4 = N 4 E E Note: for secondary rays, we will not have a common origin, nor corner rays. p 3 p 2

Advanced Graphics Real-time Ray Tracing 22 Ray Distributions Frustum Construction Method 2, for shadow rays: k 1 1. Determine dominant axis and direction: D s = σ N i=0 D i, chose axis k as the largest component of D s, u and v are the other axes. 2. Construct a plane P orthogonal to k 3. Calculate intersection coordinates u, v of the rays with P 4. Determine u min, u max and v min, v max 5. Corner rays are now: u min, v min u max, v min u max, v max (u min, v max ) u Note: this still requires a common origin.

Advanced Graphics Real-time Ray Tracing 23 Ray Distributions Frustum Construction k Method 3, for generic rays: 1. Construct two planes: P far, orthogonal to k, at location k far which is obtained from the scene AABB; P near, orthogonal to k, at location k near, which is obtained from the AABB over the ray origins. 2. Calculate intersection coordinates u far, v far and u near, v near of the rays with P far and P near. 3. Determine u min, u max, v min, u max and u min, u max, v min, u max 4. Corner rays are now defined as u min, v min u min, v min, u max, v min u max, v min, u far max, v max u max, v max, far far, v max (u min, v max ). u min near. k far k near

Advanced Graphics Real-time Ray Tracing 24 Ray Distributions Ray Order The order of the rays in a packet is important. We keep track of the first active ray: in this case the green dot. 0 7 8 We thus enter the node with 61 rays, while only 12 rays actually intersect the node. Keeping track of the last ray helps somewhat. 63

Advanced Graphics Real-time Ray Tracing 25 Ray Distributions Ray Order Overhead can be reduced by numbering rays in each quadrant sequentially. 0 32 15 16 31 63

Advanced Graphics Real-time Ray Tracing 26 Ray Distributions Ray Order Overhead can be reduced by numbering rays in each quadrant sequentially. For the general case, Morton order is optimal.

Advanced Graphics Real-time Ray Tracing 27 Ray Distributions Divergent Rays: Partition Traversal rays ray indices 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 i e i a int PartitionRays for ( int i = 0; i < i a ; i++ ) if (ray[idx[i]].intersectsaabb()) swap( idx[i e ++], idx[i] ); return i e ; 2 1 0 3 4 5 6 7 8 9 10 11 12 13 14 15 i e

Advanced Graphics Real-time Ray Tracing 28 Ray Distributions Divergent Rays: Partition Traversal rays ray indices 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 i e i a int PartitionRays for ( int i = 0; i < i a ; i++ ) if (ray[idx[i]].intersectsaabb()) swap( idx[i e ++], idx[i] ); return i e ; 2 5 0 3 4 1 6 7 8 9 10 11 12 13 14 15 i e

Advanced Graphics Real-time Ray Tracing 29 Ray Distributions Divergent Rays: Partition Traversal rays ray indices 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 i e i a int PartitionRays for ( int i = 0; i < i a ; i++ ) if (ray[idx[i]].intersectsaabb()) swap( idx[i e ++], idx[i] ); return i e ; 2 5 6 3 4 1 0 7 8 9 10 11 12 13 14 15 i e

Advanced Graphics Real-time Ray Tracing 30 Ray Distributions Divergent Rays: Partition Traversal rays ray indices 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 i e i a int PartitionRays for ( int i = 0; i < i a ; i++ ) if (ray[idx[i]].intersectsaabb()) swap( idx[i e ++], idx[i] ); return i e ; 2 5 6 9 4 1 0 7 8 3 10 11 12 13 14 15 i e

Advanced Graphics Real-time Ray Tracing 31 Ray Distributions Divergent Rays: Partition Traversal rays ray indices 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 i e i a int PartitionRays for ( int i = 0; i < i a ; i++ ) if (ray[idx[i]].intersectsaabb()) swap( idx[i e ++], idx[i] ); return i e ; 2 5 6 9 11 1 0 7 8 3 10 4 12 13 14 15 i e

Advanced Graphics Real-time Ray Tracing 32 Ray Distributions Divergent Rays: Partition Traversal Partition traversal gathers active rays in a continuous list. This comes at the price of some overhead: one layer of indirection (ray indices rays); swapping of indices. In practice, this method is suitable for ray distributions where large gaps in the ray set are to be expected.

Advanced Graphics Real-time Ray Tracing 33 Ray Distributions Optimization: Recursion The recursion can be replaced by a local stack: struct Stack { BVHNode* node; int first; }; Stack stack[stacksize]; stack[0].node = GetBVHRoot(); stack[0].first = 0; int stackptr = 1; while( stackptr > 0) { BVHNode* node = stack[--stackptr].node; first = stack[stackptr].first;... } BVHNode::Traverse( RayPacket rp, int first ) { if (!Intersects( rp[first )) // 1 { if (!Intersects( rp.frustum )) return; // 2 FindFirstActive( rp, ++first ); // 3 } if (first < rp.raycount) { if (isleaf()) { IntersectPrimitives( rp ); } else { left.traverse( rp, first ); right.traverse( rp, first ); } } }

Advanced Graphics Real-time Ray Tracing 34 Ray Distributions Optimization: SIMD We can still use SIMD to test four rays at once. The smallest primitive thus becomes the QuadRay ; a packet of N rays consists of N/4 QuadRays; first points to the first QuadRay that has at least one active ray; FindFirst processes the remaining rays four at a time. Note: for AVX, replace four by eight.

Advanced Graphics Real-time Ray Tracing 35 Ray Distributions Results Compared to 2x2 SIMD packet traversal, ranged traversal improves primary and shadow rays by ~3.5x. Note that ray divergence has a large impact on performance. 1 16.85 (100%) 25.11 (100%) 18.44 (100%) 2 11.61 (69%) 18.83 (75%) 12.93 (70%) 3 6.98 (41%) 12.56 (50%) 7.48 (41%) 4 3.85 (23%) 7.71 (31%) 3.87 (21%)

Today s Agenda: Introduction Ray Distributions The Top-level BVH Real-time Ray Tracing Assignment 2

Advanced Graphics Real-time Ray Tracing 37 Top-level BVH Ray Tracing Animated Scenes Covered so far: Static geometry: high-quality construction with spatial splits Deformations: BVH refitting (water, waving trees, ) Structural changes: binned BVH construction Not covered: Rigid motion

Advanced Graphics Real-time Ray Tracing 38 Top-level BVH

Advanced Graphics Real-time Ray Tracing 39 Top-level BVH

Advanced Graphics Real-time Ray Tracing 40 Top-level BVH

Advanced Graphics Real-time Ray Tracing 41 Top-level BVH Combining BVHs

Advanced Graphics Real-time Ray Tracing 42 Top-level BVH Combining BVHs Two BVHs can be combined into a single BVH, by simply adding a new root node pointing to the two BVHs. This works regardless of the method used to build each BVH This can be applied repeatedly to combine many BVHs

Advanced Graphics Real-time Ray Tracing 43 Scene Graph

Advanced Graphics Real-time Ray Tracing 44 Top-level BVH Scene Graph world car plane car plane buggy wheel wheel wheel wheel wheel wheel wheel wheel wheel wheel wheel wheel turret dude turret dude dude

Advanced Graphics Real-time Ray Tracing 45 Top-level BVH Scene Graph If our application uses a scene graph, we can construct a BVH for each scene graph node. The BVH for each node is built using an appropriate construction algorithm: High-quality SBVH for static scenery (offline) Fast binned SAH BVHs for dynamic scenery The extra nodes used to combine these BVHs into a single BVH are known as the Top-level BVH.

Advanced Graphics Real-time Ray Tracing 46 Top-level BVH Rigid Motion Applying rigid motion to a BVH: 1. Refit the top-level BVH 2. Refit the affected BVH

Advanced Graphics Real-time Ray Tracing 47 Top-level BVH Rigid Motion Applying rigid motion to a BVH: 1. Refit the top-level BVH 2. Refit the affected BVH or: 2. Transform the ray, not the node Rigid motion is achieved by transforming the rays by the inverse transform upon entering the sub-bvh. (this obviously does not only apply to translation)

Advanced Graphics Real-time Ray Tracing 48 Top-level BVH The Top-level BVH - Construction Input: list of axis aligned bounding boxes for transformed scene graph nodes Algorithm: 1. Find the two elements in the list for which the AABB has the smallest surface area 2. Create a parent node for these elements 3. Replace the two elements in the list by the parent node 4. Repeat until one element remains in the list. Note: algorithmic complexity is O(N 3 ).

Advanced Graphics Real-time Ray Tracing 49 Top-level BVH The Top-level BVH Faster Construction* Algorithm: Node A = list.getfirst(); Node B = list.findbestmatch( A ); while (list.size() > 1) { A Node C = list.findbestmatch( B ); if (A == C) { list.remove( A ); list.remove( B ); A = new Node( A, B ); list.add( A ); B = list.findbestmatch( A ); } else A = B, B = C; } *: Fast Agglomerative Clustering for Rendering, Walter et al., 2008 A BA BC B

Advanced Graphics Real-time Ray Tracing 50 Top-level BVH The Top-level BVH Traversal The leafs of the top-level BVH contain the sub-bvhs. When a ray intersects such a leaf, it is transformed by the inverted transform matrix of the sub-bvh. After this, it traverses the sub-bvh. Once the sub-bvh has been traversed, we transform the ray again, this time by the transform matrix of the sub-bvh. For efficiency, we store the inverted matrix with the sub-bvh root.

Advanced Graphics Real-time Ray Tracing 51 Top-level BVH

Advanced Graphics Real-time Ray Tracing 52 Top-level BVH The Top-level BVH Summary The top-level BVH enables complex animated scenes: for static objects, it contains high-quality sub-bvhs; for objects undergoing rigid motion, it also contains high-quality sub-bvhs, with a transform matrix and its inverse; for deforming objects, it contains sub-bvhs that can be refitted; for arbitrary animations, it contains lower quality sub-bvhs. Combined, this allows for efficient maintenance of a global BVH.

Today s Agenda: Introduction Ray Distributions The Top-level BVH Real-time Ray Tracing Assignment 2

Advanced Graphics Real-time Ray Tracing 54 Real-time The Quest for Real-time Ray Tracing Tracing primary, shadow and reflection rays using packets: cores mrays/s mrays/s mrays/s 1 35 37 38 2 70 74 75 6 211 221 225 (Intel Xeon, 3.4Ghz) 1024x768 @ 30Hz: 9.3 rays per pixel.

Today s Agenda: Introduction Ray Distributions The Top-level BVH Real-time Ray Tracing Assignment 2

Advanced Graphics Real-time Ray Tracing 56 Assignment 2 BVH Construction Assignment 2: add an acceleration structure to your framework. Recommended: BVH Also good: kd-tree Other options exist, talk to me if you want to explore. Good BVHs: Surface Area Heuristic Spatial Splits Traversal: Single ray Packets

Advanced Graphics Real-time Ray Tracing 57 Assignment 2 BVH Construction Programming Language C/C++ and C# work But JAVA is also allowed Deadline: Thursday December 28, 23:59 Use the Submit system. Deliverables: Project Small report

Advanced Graphics Real-time Ray Tracing 58 Assignment 2 BVH Construction How to get a passing grade: Implement a BVH, using the SAH Implement single ray traversal Achieve decent performance How to score an 8: Implement spatial splits Build a BVH for dynamic scenes with a top-level BVH Implement packet traversal for primary and secondary rays How to score a 10: Pick more than one advanced topic.

Today s Agenda: Introduction Ray Distributions The Top-level BVH Real-time Ray Tracing Assignment 2

INFOMAGR Advanced Graphics Jacco Bikker - November 2017 - February 2018 END of Real-time Ray Tracing next lecture: SIMD recap