Presentation is loading. Please wait.

Presentation is loading. Please wait.

Interactive Ray Tracing: From bad joke to old news David Luebke University of Virginia.

Similar presentations


Presentation on theme: "Interactive Ray Tracing: From bad joke to old news David Luebke University of Virginia."— Presentation transcript:

1 Interactive Ray Tracing: From bad joke to old news David Luebke University of Virginia

2 Interactive Ray Tracing l Long considered an oxymoron or a joke l Has quickly become a generally accepted part of the future of interactive graphics l The big questions: –Why do interactive ray tracing? –How to do interactive ray tracing?

3 Interactive Ray Tracing: Why do it? l Ray tracing has some definite advantages over traditional “forward” rendering: –Complex shading –Big data –Decoupled sampling l Also disadvantages: –Less well suited to hardware implementation –Slow

4 Interactive Ray Tracing: Advantages l Complex shading –Easier to get global illumination effects n Shadows, indirect illumination, color bleeding n Reflections, refractions, caustics –Easier to get lens and film effects n Motion blur, depth of field n flare, bloom –Simpler model for programmable shading –Flexible primitive definition

5 Interactive Ray Tracing: Advantages l Big data –Time complexity grows logarithmically with number of polygons n Why is this? n When is it not true? –Cliché, attributed (I believe) to Jim Kajiya: “For a complex enough scene, ray tracing will always be faster” n Early termination n Deferred shading n Overhead (triangles as a vehicle for interpolation)

6 Interactive Ray Tracing: Advantages l Decouples sampling …from the raster grid: n Stochastic antialiasing, adaptive sampling n Prioritized sampling: gaze-directed rendering, increased sampling near silhouettes, etc …from the frame n Stochastic motion blur n Wacky new algorithms: frameless rendering, interruptible rendering

7 Interactive Ray Tracing: Disadvantages l Time complexity grows linearly with the number of pixels –And there’s a lot of pixels on today’s displays n We rarely want to render a million polygons at interactive rates n We often want to render a million pixels at interactive rates –However, displays are growing more slowly than models

8 Interactive Ray Tracing: Disadvantages l Recursive ray tracing is an elegant and simple algorithm l It’s also poorly suited to efficient hardware implementation –Recursion == bad –Poor memory coherence (especially for naive depth-first algorithm) –We’ll return to these issues

9 Interactive Ray Tracing: Disadvantages l As a result there’s no real ray tracing hardware –Some entrepreneurial stabs –Some special markets n Volume-rendering hardware n Accelerated offline rendering hardware –But nothing to compare with maturity and size of polygon rendering hardware market

10 Interactive Ray Tracing: How l The good news: –Ray tracing is embarrassingly parallel... if you can afford the memory l The bad news: –The memory access patterns of ray tracing are not very friendly

11 Recursive Ray Tracing: Memory Access l Consider recursively traversing rays through a complex scene

12 Recursive Ray Tracing: Memory Access l Consider recursively traversing rays through a complex scene –Overlay an acceleration structure (say, a grid) –What cells need to be in memory over time? –How much coherence is there between adjacent pixels? l Lessons: –Interactive ray tracing requires careful attention to memory coherence –Naïve parallelization may not help

13 Brute Force: Parker et al. (1999) l First true interactive ray tracing system: Parker et al, U. of Utah, 1999 –Brute force… n Straightforward implementation n Explicitly traces rays through every pixel n Simple acceleration structure (uniform grid) n Careful attention to optimizing system resources …on a $2.5 million supercomputer n 64 node SGI Origin “Reality Monster” n CC-NUMA shared-memory multicomputer n Fast interconnect n Fine-grained message passing

14 Parker et al. l Parker et al demonstrated several advantages of ray tracing: –Big data –Sophisticated shading –Direct rendering of multiple primitives –Frameless rendering l Other contributions –A clever soft shadows hack –A clever ambient lighting hack l Show the movie

15 Parker et al. Lessons Learned l A big enough hammer CAN do the job l Careful optimization is important… …but computation is often cheaper than communication …so optimize memory as well as CPU

16 Related Work: Utah l Since then, the Utah group has done research on: –Ray tracing dynamic scenes: incrementally updating acceleration data structures –Ray tracing volumes: lots of acceleration techniques for volumes, e.g. MRI data –A cute trick for improving the appearance of antialiased ray-traced images during motion l Some images and movies at: http://www.cs.utah.edu/~sparker/images.html

17 Distributed Computing: Wald & Slusallek l Ingo Wald, Philip Slusallek: the next big contributors; lots of publications l Basic idea: ray trace on standard PC hardware, scale to clusters –On dual-PIII 800 MHz, report 1.6-3.6 fps on models from 40K-8M tris –A cluster of 7 PCs achieves 5-10 fps on the 13 million triangle UNC Powerplant

18 Related Work: Wald & Slusallek l Coherence: Restructure ray tracing computation to increase coherence –“Partial breadth-first evaluation” –Ray trace small bundles of rays n Intersect all rays in bundle with every triangle, even if some have already terminated n Good cache coherence, can use SIMD instructions

19 Wald & Slusallek l Scalability: use cluster of PCs with client-server architecture –K-D tree acceleration structure –Server hands out bundles to be rendered –Clients cache geometry (not entire scene) –System tries to allocate ray bundles to clients that already have needed geometry in cache

20 Wald & Slusallek l Show some movies l They have taken their work into the OpenRT effort –Goal: industry-standard ray tracing system with OpenGL-like semantics


Download ppt "Interactive Ray Tracing: From bad joke to old news David Luebke University of Virginia."

Similar presentations


Ads by Google