Computer Graphics - Ray-Tracing II - Hendrik Lensch Computer - - PowerPoint PPT Presentation

computer graphics
SMART_READER_LITE
LIVE PREVIEW

Computer Graphics - Ray-Tracing II - Hendrik Lensch Computer - - PowerPoint PPT Presentation

Computer Graphics - Ray-Tracing II - Hendrik Lensch Computer Graphics WS07/08 Ray Tracing II Overview Last lecture Ray tracing I Basic ray tracing What is possible? Recursive ray tracing algorithm Intersection


slide-1
SLIDE 1

Computer Graphics WS07/08 – Ray Tracing II

Computer Graphics

  • Ray-Tracing II -

Hendrik Lensch

slide-2
SLIDE 2

Computer Graphics WS07/08 – Ray Tracing II

Overview

  • Last lecture

– Ray tracing I

  • Basic ray tracing
  • What is possible?
  • Recursive ray tracing algorithm
  • Intersection computations
  • Today

– Advanced acceleration structures

  • Theoretical Background
  • Hierarchical Grids, kd-Trees, Octrees
  • Bounding Volume Hierarchies

– Dynamic changes to scenes – Ray bundles

  • Next lecture

– Realtime ray tracing

slide-3
SLIDE 3

Computer Graphics WS07/08 – Ray Tracing II

Barycentric Coordinates

A B C

B B A P

3 2 1

λ λ λ + + =

P

slide-4
SLIDE 4

Computer Graphics WS07/08 – Ray Tracing II

Barycentric Coordinates

A B C

B B A P

3 2 1

λ λ λ + + =

P

= S S A

1

λ

slide-5
SLIDE 5

Computer Graphics WS07/08 – Ray Tracing II

Barycentric Coordinates

A B C

B B A P

3 2 1

λ λ λ + + =

P

= S SB

2

λ

slide-6
SLIDE 6

Computer Graphics WS07/08 – Ray Tracing II

Barycentric Coordinates

A B C

B B A P

3 2 1

λ λ λ + + =

P

= S SC

3

λ

slide-7
SLIDE 7

Computer Graphics WS07/08 – Ray Tracing II

Fast Triangle Intersection

  • see
slide-8
SLIDE 8

Computer Graphics WS07/08 – Ray Tracing II

Cost of Naïve Raytracing

  • Linear complexity
  • 1024 * 768 pixels * 6320 triangles !
slide-9
SLIDE 9

Computer Graphics WS07/08 – Ray Tracing II

Theoretical Background

  • Unstructured data results in (at least) linear complexity

– Every primitive could be the first one intersected – Must test each one separately – Coherence does not help

  • Reduced complexity only through pre-sorted data

– Spatial sorting of primitives (indexing like for data base)

  • Allows for efficient search strategies

– Hierarchy leads to O(log n) search complexity

  • But building the hierarchy is still O(n log n)

– Trade-off between run-time and building-time

  • In particular for dynamic scenes

– Worst case scene is still linear !!

  • It is a general problem in graphics

– Spatial indices for ray tracing – Spatial indices for occlusion- and frustum-culling – Sorting for transparency

Worst case RT scene: Ray barely misses every primitive

slide-10
SLIDE 10

Computer Graphics WS07/08 – Ray Tracing II

Ray Tracing Acceleration

  • Intersect ray with all objects

– Way too expensive

  • Faster intersection algorithms

– Still same complexity O(n)

  • Less intersection computations

– Space partitioning (often hierarchical)

  • Grid, hierarchies of grids
  • Octree
  • Binary space partition (BSP) or kd-tree
  • Bounding volume hierarchy (BVH)

– Directional partitioning (not very useful) – 5D partitioning (space and direction, once a big hype)

  • Close to pre-compute visibility for all points and all directions
  • Tracing of continuous bundles of rays

– Exploits coherence of neighboring rays, amortize cost among them

  • Cone tracing, beam tracing, ...
slide-11
SLIDE 11

Computer Graphics WS07/08 – Ray Tracing II

Aggregate Objects

  • Object that holds groups of objects
  • Stores bounding box and pointers to children
  • Useful for instancing and Bounding Volume Hierarchies
slide-12
SLIDE 12

Computer Graphics WS07/08 – Ray Tracing II

Bounding Volumes (BV)

  • Observation

– Bound geometry with BV – Only compute intersection if ray hits BV

  • Sphere

– Very fast intersection computation – Often inefficient because too large

  • Axis-aligned box

– Very simple intersection computation (min-max) – Sometimes too large

  • Non-axis-aligned box

– A.k.a. „oriented bounding box (OBB)“ – Often better fit – Fairly complex computation

  • Slabs

– Pairs of half spaces – Fixed number of orientations

  • Addition of coordinates w/ negation

– Fairly fast computation

slide-13
SLIDE 13

Computer Graphics WS07/08 – Ray Tracing II

Bounding Volume Hierarchies

slide-14
SLIDE 14

Computer Graphics WS07/08 – Ray Tracing II

Bounding Volume Hierarchies

  • Hierarchy of groups of objects
slide-15
SLIDE 15

Computer Graphics WS07/08 – Ray Tracing II

Bounding Volume Hierarchies

  • Tree structure
  • Internal nodes are aggregate objects
  • Leave nodes are geometric objects
  • Intersection testing involves tree traversal
slide-16
SLIDE 16

Computer Graphics WS07/08 – Ray Tracing II

Bounding Volume Hierarchies

  • Idea:

– Organize bounding volumes hierarchically into new BVs

  • Advantages:

– Very good adaptivity – Efficient traversal O(log N) – Often used in ray tracing systems

  • Problems

– How to arrange BVs?

slide-17
SLIDE 17

Computer Graphics WS07/08 – Ray Tracing II

Grid

  • Grid

– Partitioning with equal, fixed sized „voxels“

  • Building a grid structure

– Partition the bounding box (bb) – Resolution: often 3√n – Inserting objects

  • Trivial: insert into all voxels
  • verlapping objects bounding box
  • Easily optimized
  • Traversal

– Iterate through all voxels in order as pierced by the ray – Compute intersection with

  • bjects in each voxel

– Stop if intersection found in current voxel

slide-18
SLIDE 18

Computer Graphics WS07/08 – Ray Tracing II

Grid

  • Grid

– Partitioning with equal, fixed sized „voxels“

  • Building a grid structure

– Partition the bounding box (bb) – Resolution: often 3√n – Inserting objects

  • Trivial: insert into all voxels
  • verlapping objects bounding box
  • Easily optimized
  • Traversal

– Iterate through all voxels in order as pierced by the ray – Compute intersection with

  • bjects in each voxel

– Stop if intersection found in current voxel

slide-19
SLIDE 19

Computer Graphics WS07/08 – Ray Tracing II

Grid: Issues

  • Grid traversal

– Requires enumeration of voxel along ray

3D-DDA, modified Bresenham (later)

– Simple and hardware-friendly

  • Grid resolution

– Strongly scene dependent – Cannot adapt to local density of objects

  • Problem: „Teapot in a stadium“

– Possible solution: grids within grids hierarchical grids

  • Objects spanning multiple voxels

– Store only references to objects – Use mailboxing to avoid multiple intersection computations

  • Store object in small per-ray cache (e.g. with hashing)
  • Do not intersect again if found in cache

– Original mailbox stores ray-id with each triangle

  • Simple, but likely to destroy CPU caches
slide-20
SLIDE 20

Computer Graphics WS07/08 – Ray Tracing II

Hierarchical Grids

  • Simple building algorithm

– Coarse grid for entire scene – Recursively create grids in high-density voxels – Problem: What is the right resolution for each level?

  • Advanced algorithm

– Place cluster of objects in separate grids – Insert these grids into parent grid – Problem: What are good clusters?

slide-21
SLIDE 21

Computer Graphics WS07/08 – Ray Tracing II

Quadtree – 2D example

slide-22
SLIDE 22

Computer Graphics WS07/08 – Ray Tracing II

Quadtree – 2D example

slide-23
SLIDE 23

Computer Graphics WS07/08 – Ray Tracing II

Quadtree – 2D example

slide-24
SLIDE 24

Computer Graphics WS07/08 – Ray Tracing II

Quadtree – 2D example

  • Hierarchical subdivision
  • subdivide unless

cell empty (or less then N primitives)

slide-25
SLIDE 25

Computer Graphics WS07/08 – Ray Tracing II

Octree

  • Hierarchical space partitioning

– Start with bounding box of entire scene – Recursively subdivide voxels into 8 equal sub-voxels – Subdivision criteria:

  • Number of remaining primitives and maximum depth

– Result in adaptive subdivision

  • Allows for large traversal

steps in empty regions

  • Problems

– Pretty complex traversal algorithms – Slow to refine complex regions

  • Traversal algorithms

– HERO, SMART, ... – Or use kd-tree algorithm …

slide-26
SLIDE 26

Computer Graphics WS07/08 – Ray Tracing II

BSP- and Kd-Trees

  • Recursive space partitioning with half-spaces
  • Binary Space Partition (BSP):

– Recursively split space into halves – Splitting with half-spaces in arbitrary position

  • Often defined by existing polygons

– Often used for visibility in games ( Doom)

  • Traverse binary tree from front to back
  • Kd-Tree

– Special case of BSP

  • Splitting with axis-aligned half-spaces

– Defined recursively through nodes with

  • Axis-flag
  • Split location (1D)
  • Child pointer(s)

– See separate slides for details

1 1.1 1.1.1 1.2 1.1.2 1.1.2.1 1.1.1.1

slide-27
SLIDE 27

Computer Graphics WS07/08 – Ray Tracing II

kD-Trees

[following slides from Gordon Stoll – SIGGRAPH Course 2005]

slide-28
SLIDE 28

Computer Graphics WS07/08 – Ray Tracing II

kD-Trees

slide-29
SLIDE 29

Computer Graphics WS07/08 – Ray Tracing II

kD-Trees

slide-30
SLIDE 30

Computer Graphics WS07/08 – Ray Tracing II

kD-Trees

slide-31
SLIDE 31

Computer Graphics WS07/08 – Ray Tracing II

KD-Tree (explicit example)

1 2 7 3 5 6 4 8

slide-32
SLIDE 32

Computer Graphics WS07/08 – Ray Tracing II

KD-Tree (explicit example)

1 2 7 3 5 6 4 8 A A

slide-33
SLIDE 33

Computer Graphics WS07/08 – Ray Tracing II

KD-Tree (explicit example)

1 2 7 3 5 6 4 8 A A B B

slide-34
SLIDE 34

Computer Graphics WS07/08 – Ray Tracing II

KD-Tree (explicit example)

1 2 7 3 5 6 4 8 A A B 3,4 B

slide-35
SLIDE 35

Computer Graphics WS07/08 – Ray Tracing II

KD-Tree (explicit example)

1 2 7 3 5 6 4 8 A A B 3,4 5,6 B

slide-36
SLIDE 36

Computer Graphics WS07/08 – Ray Tracing II

KD-Tree (explicit example)

1 2 7 3 5 6 4 8 A A B 3,4 5,6 B C C

slide-37
SLIDE 37

Computer Graphics WS07/08 – Ray Tracing II

KD-Tree (explicit example)

1 2 7 3 5 6 4 8 A A B 3,4 5,6 B C C 8,7

slide-38
SLIDE 38

Computer Graphics WS07/08 – Ray Tracing II

KD-Tree (explicit example)

1 2 7 3 5 6 4 8 A A B 3,4 5,6 B C C 8,7 D D 2,3 1

slide-39
SLIDE 39

Computer Graphics WS07/08 – Ray Tracing II

BSP-Tree Traversal

  • “Front-to-back” traversal
  • Traverse child nodes in order along rays
  • Stop traversing as soon as surface intersection is found
  • Maintain stack of subtrees to traverse

– More efficient than recursive function calls

slide-40
SLIDE 40

Computer Graphics WS07/08 – Ray Tracing II

BSP-Tree Traversal

1 2 7 3 5 6 4 8 A B C D A B 3,4 5,6 C 8,7 D 2,3 1 Process Stack A

slide-41
SLIDE 41

Computer Graphics WS07/08 – Ray Tracing II

BSP-Tree Traversal

1 2 7 3 5 6 4 8 A B C D A B 3,4 5,6 C 8,7 D 2,3 1 Process Stack C B

slide-42
SLIDE 42

Computer Graphics WS07/08 – Ray Tracing II

BSP-Tree Traversal

1 2 7 3 5 6 4 8 A B C D A B 3,4 5,6 C 8,7 D 2,3 1 Process Stack D B

slide-43
SLIDE 43

Computer Graphics WS07/08 – Ray Tracing II

BSP-Tree Traversal

1 2 7 3 5 6 4 8 A B C D A B 3,4 5,6 C 8,7 D 2,3 1 Process Stack 1 B 2,3

slide-44
SLIDE 44

Computer Graphics WS07/08 – Ray Tracing II

BSP-Tree Traversal

1 2 7 3 5 6 4 8 A B C D A B 3,4 5,6 C 8,7 D 2,3 1 Process Stack 2,3 B

slide-45
SLIDE 45

Computer Graphics WS07/08 – Ray Tracing II

BSP-Tree Traversal

1 2 7 3 5 6 4 8 A B C D A B 3,4 5,6 C 8,7 D 2,3 1 Process Stack 3,4 5,6

slide-46
SLIDE 46

Computer Graphics WS07/08 – Ray Tracing II

BSP-Tree Traversal

1 2 7 3 5 6 4 8 A B C D A B 3,4 5,6 C 8,7 D 2,3 1 Process Stack 5,6

slide-47
SLIDE 47

Computer Graphics WS07/08 – Ray Tracing II

Advantages of kD-Trees

  • Adaptive

– Can handle the “Teapot in a Stadium”

  • Compact

– Relatively little memory overhead

  • Cheap Traversal

– One FP subtract, one FP multiply

slide-48
SLIDE 48

Computer Graphics WS07/08 – Ray Tracing II

Take advantage of advantages

  • Adaptive

– You have to build a good tree

  • Compact

– At least use the compact node representation (8-byte) – You can’t be fetching whole cache lines every time

  • Cheap traversal

– No sloppy inner loops! (one subtract, one multiply!)

slide-49
SLIDE 49

Computer Graphics WS07/08 – Ray Tracing II

Fast Ray Tracing w/ kD-Trees

  • Adaptive
  • Compact
  • Cheap traversal
slide-50
SLIDE 50

Computer Graphics WS07/08 – Ray Tracing II

Building kD-trees

  • Given:

– axis-aligned bounding box (“cell”) – list of geometric primitives (triangles?) touching cell

  • Core operation:

– pick an axis-aligned plane to split the cell into two parts – sift geometry into two batches (some redundancy) – recurse

slide-51
SLIDE 51

Computer Graphics WS07/08 – Ray Tracing II

Building kD-trees

  • Given:

– axis-aligned bounding box (“cell”) – list of geometric primitives (triangles?) touching cell

  • Core operation:

– pick an axis-aligned plane to split the cell into two parts – sift geometry into two batches (some redundancy) – recurse – termination criteria!

slide-52
SLIDE 52

Computer Graphics WS07/08 – Ray Tracing II

“Intuitive” kD-Tree Building

  • Split Axis

– Round-robin; largest extent

  • Split Location

– Middle of extent; median of geometry (balanced tree)

  • Termination

– Target # of primitives, limited tree depth

slide-53
SLIDE 53

Computer Graphics WS07/08 – Ray Tracing II

“Hack” kD-Tree Building

  • Split Axis

– Round-robin; largest extent

  • Split Location

– Middle of extent; median of geometry (balanced tree)

  • Termination

– Target # of primitives, limited tree depth

  • All of these techniques are not very clever
slide-54
SLIDE 54

Computer Graphics WS07/08 – Ray Tracing II

Building good kD-trees

  • What split do we really want?

– Clever Idea: The one that makes ray tracing cheap – Write down an expression of cost and minimize it – Cost Optimization

  • What is the cost of tracing a ray through a cell?

Cost(cell) = C_trav + Prob(hit L) * Cost(L) + Prob(hit R) * Cost(R)

slide-55
SLIDE 55

Computer Graphics WS07/08 – Ray Tracing II

Splitting with Cost in Mind

slide-56
SLIDE 56

Computer Graphics WS07/08 – Ray Tracing II

Split in the middle

  • Makes the L & R probabilities equal
  • Pays no attention to the L & R costs
slide-57
SLIDE 57

Computer Graphics WS07/08 – Ray Tracing II

Split at the Median

  • Makes the L & R costs equal
  • Pays no attention to the L & R probabilities
slide-58
SLIDE 58

Computer Graphics WS07/08 – Ray Tracing II

Cost-Optimized Split

  • Automatically and rapidly isolates complexity
  • Produces large chunks of empty space
slide-59
SLIDE 59

Computer Graphics WS07/08 – Ray Tracing II

Building good kD-trees

  • Need the probabilities

– Turns out to be proportional to surface area

  • Need the child cell costs

– Simple triangle count works great (very rough approx.)

Cost(cell) = C_trav + Prob(hit L) * Cost(L) + Prob(hit R) * Cost(R) = C_trav + SA(L) * TriCount(L) + SA(R) * TriCount(R)

slide-60
SLIDE 60

Computer Graphics WS07/08 – Ray Tracing II

Termination Criteria

  • When should we stop splitting?

– Another Clever idea: When splitting isn’t helping any more. – Use the cost estimates in your termination criteria

  • Threshold of cost improvement

– Stretch over multiple levels

  • Threshold of cell size

– Absolute probability so small there’s no point

slide-61
SLIDE 61

Computer Graphics WS07/08 – Ray Tracing II

Building good kD-trees

  • Basic build algorithm

– Pick an axis, or optimize across all three – Build a set of “candidates” (split locations)

  • BBox edges or exact triangle intersections

– Sort them or bin them – Walk through candidates or bins to find minimum cost split

  • Characteristics you’re looking for

– long and thin – depth 50-100, – ~2 triangle leaves, – big empty cells

slide-62
SLIDE 62

Computer Graphics WS07/08 – Ray Tracing II

Building kD-trees quickly

  • Very important to build good trees first

– otherwise you have no basis for comparison

  • Don’t give up cost optimization!

– Use the math, Luke…

  • Luckily, lots of flexibility…

– axis picking (“hack” pick vs. full optimization) – candidate picking (bboxes, exact; binning, sorting) – termination criteria (“knob” controlling tradeoff)

slide-63
SLIDE 63

Computer Graphics WS07/08 – Ray Tracing II

Building kD-trees quickly

  • Remember, profile first! Where’s the time going?

– split personality

  • memory traffic all at the top (NO cache misses at bottom)

– sifting through bajillion triangles to pick one split (!) – hierarchical building?

  • computation mostly at the bottom

– lots of leaves, need more exact candidate info – lazy building?

  • change criteria during the build?
slide-64
SLIDE 64

Computer Graphics WS07/08 – Ray Tracing II

Fast Ray Tracing w/ kD-Trees

  • adaptive

– build a cost-optimized kD-tree w/ the surface area heuristic

  • compact
  • cheap traversal
slide-65
SLIDE 65

Computer Graphics WS07/08 – Ray Tracing II

What’s in a node?

  • A kD-tree internal node needs:

– Am I a leaf? – Split axis – Split location – Pointers to children

slide-66
SLIDE 66

Computer Graphics WS07/08 – Ray Tracing II

Compact (8-byte) nodes

  • kD-Tree node can be packed into 8 bytes

– Leaf flag + Split axis

  • 2 bits

– Split location

  • 32 bit float

– Always two children, put them side-by-side

  • One 32-bit pointer
slide-67
SLIDE 67

Computer Graphics WS07/08 – Ray Tracing II

Compact (8-byte) nodes

  • kD-Tree node can be packed into 8 bytes

– Leaf flag + Split axis (3+1)

  • 2 bits

– Split location

  • 32 bit float

– Always two children, put them side-by-side

  • One 32-bit pointer
  • So close! Sweep those 2 bits under the rug…
slide-68
SLIDE 68

Computer Graphics WS07/08 – Ray Tracing II

No Bounding Box!

  • kD-Tree node corresponds to an AABB
  • Doesn’t mean it has to *contain* one

– 24 bytes – 4X explosion (!)

slide-69
SLIDE 69

Computer Graphics WS07/08 – Ray Tracing II

Memory Layout

  • Cache lines are much bigger than 8 bytes!

– advantage of compactness lost with poor layout

  • Pretty easy to do something reasonable

– Building depth first, watching memory allocator

slide-70
SLIDE 70

Computer Graphics WS07/08 – Ray Tracing II

Other Data

  • Memory should be separated by rate of access

– Frames – << Pixels – << Samples [ Ray Trees ] – << Rays [ Shading (not quite) ] – << Triangle intersections – << Tree traversal steps

  • Example: pre-processed triangle, shading info…
slide-71
SLIDE 71

Computer Graphics WS07/08 – Ray Tracing II

Fast Ray Tracing w/ kD-Trees

  • adaptive

– build a cost-optimized kD-tree w/ the surface area heuristic

  • compact

– use an 8-byte node – lay out your memory in a cache-friendly way

  • cheap traversal
slide-72
SLIDE 72

Computer Graphics WS07/08 – Ray Tracing II

kD-Tree Traversal Step

split t_split t_min t_max

slide-73
SLIDE 73

Computer Graphics WS07/08 – Ray Tracing II

kD-Tree Traversal Step

split t_split t_min t_max

slide-74
SLIDE 74

Computer Graphics WS07/08 – Ray Tracing II

kD-Tree Traversal Step

split t_split t_min t_max

slide-75
SLIDE 75

Computer Graphics WS07/08 – Ray Tracing II

kD-Tree Traversal Step

Given: ray P & iV=(1/V), t_min, t_max, split_location, split_axis t_split = ( split_location - ray->P[split_axis] ) * ray->iV[split_axis] if t_split > t_min need to test against near child If t_split < t_max need to test against far child

slide-76
SLIDE 76

Computer Graphics WS07/08 – Ray Tracing II

Optimize Your Inner Loop

  • kD-Tree traversal is the most critical kernel

– It happens about a zillion times – It’s tiny – Sloppy coding will show up

  • Optimize, Optimize, Optimize

– Remove recursion and minimize stack operations – Other standard tuning & tweaking

slide-77
SLIDE 77

Computer Graphics WS07/08 – Ray Tracing II

kD-Tree Traversal

while ( not a leaf ) t_at_split = ( split_location - ray->P[split_axis] ) * ray_iV[split_axis] if t_split <= t_min continue with far child // hit either far child or none if t_split >= t_max continue with near child // hit near child only // hit both children push (far child, t_split, t_max) onto stack continue with (near child, t_min, t_split)

slide-78
SLIDE 78

Computer Graphics WS07/08 – Ray Tracing II

Can it go faster?

  • How do you make fast code go faster?
  • Parallelize it!
slide-79
SLIDE 79

Computer Graphics WS07/08 – Ray Tracing II

Directional Partitioning

  • Applications

– Useful only for rays that start from a single point

  • Camera
  • Point light sources

– Preprocessing of visibility – Requires scan conversion of geometry

  • For each object locate where it is visible
  • Expensive and linear in # of objects
  • Generally not used for primary rays
  • Variation: Light buffer

– Lazy and conservative evaluation – Store occluder that was found in directional structure – Test entry first for next shadow test

slide-80
SLIDE 80

Computer Graphics WS07/08 – Ray Tracing II

Ray Classification

  • Partitioning of space and direction [Arvo & Kirk´

´ ´ ´87]

– Roughly pre-computes visibility for the entire scene

  • What is visible from each point in each direction?

– Very costly preprocessing, cheap traversal

  • Improper trade-off between preprocessing and run-time

– Memory hungry, even with lazy evaluation – Seldom used in practice

slide-81
SLIDE 81

Computer Graphics WS07/08 – Ray Tracing II

Distribution Ray Tracing

  • Formerly called Distributed Ray Tracing [Cook`84]
  • Stochastic Sampling of

– Pixel: Antialiasing – Lens: Depth-of-field – BRDF: Glossy reflections – Lights: Smooth shadows from area light sources – Time: Motion blur

slide-82
SLIDE 82

Computer Graphics WS07/08 – Ray Tracing II

Beam und Cone Tracing

  • General idea:

– Trace continuous bundles of rays

  • Cone Tracing:

– Approximate collection of ray with cone(s) – Subdivide into smaller cones if necessary

  • Beam Tracing:

– Exactly represent a ray bundle with pyramid – Create new beams at intersections (polygons)

  • Problems:

– Clipping of beams? – Good approximations? – How to compute intersections?

  • Not really practical !!
slide-83
SLIDE 83

Computer Graphics WS07/08 – Ray Tracing II

Beam Tracing

slide-84
SLIDE 84

Computer Graphics WS07/08 – Ray Tracing II

Packet Tracing

  • Approach

– Combine many similar rays (e.g. primary or shadow rays) – Trace them together in SIMD fashion

  • All rays perform the same traversal operations
  • All rays intersect the same geometry

– Exposes coherence between rays

  • All rays touch similar spatial indices
  • Loaded data can be reused (in registers & cache)
  • More computation per recursion step better optimization

– Overhead

  • Rays will perform unnecessary operations
  • Overhead low for coherent and small set of rays (e.g. up to 4x4 rays)