Ray Tracing Dinesh Manocha COMP 575/770.

Slides:



Advertisements
Similar presentations
Exploration of advanced lighting and shading techniques
Advertisements

Sven Woop Computer Graphics Lab Saarland University
Christian Lauterbach COMP 770, 2/16/2009. Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
Light Issues in Computer Graphics Presented by Saleema Amershi.
Christian Lauterbach COMP 770, 2/11/2009
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
Computer Graphics Hardware Acceleration for Embedded Level Systems Brian Murray
Computer Graphics (Fall 2005) COMS 4160, Lecture 21: Ray Tracing
CSCE 641: Computer Graphics Ray Tracing Jinxiang Chai.
1/12/09 1 Introduction Computer Graphics COMP 770 (236) Spring 2009 Instructor: Dinesh Manocha.
3D Graphics Processor Architecture Victor Moya. PhD Project Research on architecture improvements for future Graphic Processor Units (GPUs). Research.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
CSCE 641: Computer Graphics Ray Tracing Jinxiang Chai.
Real-Time Ray Tracing 3D Modeling of the Future Marissa Hollingsworth Spring 2009.
Presentation of LR2V Kadi Bouatouch IRISA
CSC418 Computer Graphics n Raytracing n Shadows n Global Illumination.
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
Interactive Ray Tracing: From bad joke to old news David Luebke University of Virginia.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Reflections Specular reflection is the perfect reflection of light from a surface. The law a reflection states that the direction of the incoming ray and.
-Global Illumination Techniques
Ray Tracing Sang Il Park SEjong University With lots of slides stolen from Jehee Lee, Doug James, Steve Seitz, Shree Nayar, Alexei Efros, Fredo Durand.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
Ray Tracing Jian Huang, CS 594, Fall, 2002 This set of slides are used at Ohio State by Prof. Roger Crawfis.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
Week 10 - Wednesday.  What did we talk about last time?  Shadow volumes and shadow mapping  Ambient occlusion.
Interactive Rendering With Coherent Ray Tracing Eurogaphics 2001 Wald, Slusallek, Benthin, Wagner Comp 238, UNC-CH, September 10, 2001 Joshua Stough.
Introduction to Realtime Ray Tracing Course 41 Philipp Slusallek Peter Shirley Bill Mark Gordon Stoll Ingo Wald.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
CSCE 441: Computer Graphics Ray Tracing
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
RENDERING : Global Illumination
Global Illumination (3) Path Tracing. Overview Light Transport Notation Path Tracing Photon Mapping.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
CAD Illustration For the exam you must know the role of common techniques for the representations of light, reflection, shadow, tone layout, material and.
Chapter 10: Computer Graphics
Real-Time ray casting for virtual reality
Rendering Pipeline Fall, 2015.
CSE 167 [Win 17], Lecture 15: Ray Tracing Ravi Ramamoorthi
Real-Time Soft Shadows with Adaptive Light Source Sampling
Photorealistic Rendering vs. Interactive 3D Graphics
ICG Syllabus 1. Introduction 2. Viewing in 3D and Graphics Programming
Hybrid Ray Tracing and Path Tracing of Bezier Surfaces using a mixed hierarchy Rohit Nigam, P. J. Narayanan CVIT, IIIT Hyderabad, Hyderabad, India.
Chapter 10 Computer Graphics
Ray Tracing Dr. Scott Schaefer.
Real-Time Ray Tracing Stefan Popov.
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
Mike Merchant Nicholas Hilbert
Hybrid Ray Tracing of Massive Models
Models and Architectures
© University of Wisconsin, CS559 Fall 2004
Models and Architectures
(c) 2002 University of Wisconsin
Lighting.
Visibility Computations
Chapter XVI Texturing toward Global Illumination
UMBC Graphics for Games
Image.
CS5500 Computer Graphics May 29, 2006
CSCE 441: Computer Graphics Ray Tracing
14th Lecture – Final Lecture
Distributed Ray Tracing
Ray Tracing Sung-Eui Yoon (윤성의) CS580: Course URL:
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
CSC418 Computer Graphics Raytracing Shadows Global Illumination.
Presentation transcript:

Ray Tracing Dinesh Manocha COMP 575/770

Overview Review Ray Tracing flavors Ray Tracing vs. rasterization Recursive ray tracing Distributed ray tracing Ray Tracing vs. rasterization

Overview Review Ray Tracing flavors Ray Tracing vs. rasterization Recursive ray tracing Distributed ray tracing Ray Tracing vs. rasterization

What is Ray Tracing? Ray-Generation Ray-Traversal Intersection Shading Framebuffer

What is Ray Tracing? Ray-Generation Ray-Traversal Intersection Shading Framebuffer

What is Ray Tracing? Ray-Generation Ray-Traversal Intersection Shading Framebuffer

What is Ray Tracing? Traversal Ray-Generation Ray-Traversal Intersection Shading Framebuffer

What is Ray Tracing? Ray-Generation Ray-Traversal Intersection Shading Framebuffer

What is Ray Tracing? Ray-Generation Ray-Traversal Intersection Shading Framebuffer

What is Ray Tracing? Ray-Generation Ray-Traversal Intersection Shading Framebuffer

Secondary Rays: Shadow Rays Light Shadow ray Viewer If first hit of shadow ray closer than distance to light  in shadow

Secondary Rays: Reflection Rays Light Reflection ray Viewer

Computing Reflection Rays Reflection is pretty simple Incident angle = Exit angle Incident ray: x + t*d Reflection ray: a + t*(d – 2*n*dot(n,d)) (careful, assumes n and d normalized!) n a

Secondary Rays: Refraction Rays Light Refraction ray Viewer

Computing Refraction Rays Refraction occurs at material boundaries E.g. air-glass Depends on refractive index n of materials Snell’s law: n 1 * sin(θ1) = n2 * sin(θ2) Special case: total internal reflection denser to less dense material θ > critical angle n1 θ1 n2 θ2

Overview Review Ray Tracing flavors Ray Tracing vs. rasterization Recursive ray tracing Distributed ray tracing Ray Tracing vs. rasterization

Where’s the recursion? Light Viewer Reflection ray Reflection ray Refraction ray

Computing ray colors How to get the final pixel color? End result: Every material has local color c Define reflexivity, refraction factors ρ (i.e. between 1.0 (mirror) and 0.0 (no reflection) Each hit returns its color down the chain End result: Color = (1 –ρ) c1 + ρ1 ( (1- ρ2)c2 + ρ2 (c3 …. ))) Local color also influenced by shadow rays!

Recursive Ray Tracing: Example (from [Whitted80])

Recursive Ray Tracing: Example

Overview Ray Tracing vs. rasterization Ray Tracing methods Recursive ray tracing Distributed ray tracing Ray/Object intersection algorithms

Distributed ray tracing Ray Tracing: too idealistic! No point light sources in nature No perfect reflections etc. Distributed ray tracing idea Substitute exact single rays with several probabilistically generated rays

Distributed Ray Tracing Allows many physically correct effects: Soft area shadows Glossy, imperfect reflections and refractions Depth of Field Motion blur (from [Boulos07])

Distributed Ray Tracing Allows many physically correct effects: Soft area shadows Glossy, imperfect reflections and refractions Depth of Field Motion blur (from [Boulos07])

Distributed Ray Tracing Allows many physically correct effects: Soft area shadows Glossy, imperfect reflections and refractions Depth of Field Motion blur (from [Boulos07])

Distributed Ray Tracing Allows many physically correct effects: Soft area shadows Glossy, imperfect reflections and refractions Depth of Field Motion blur (from [Boulos07])

Area shadows with DRT Light Shadow ray Viewer

Area shadows with DRT n shadow rays for randomly selected points on light Area light Viewer Lighting now determined by #rays reach light / #rays shot

Other effects Reflections, Refraction similar Depth of field E.g. sample rays inside cone defined by direction Depth of field Sample different viewer positions on lens Motion blur Sample different time points All work together!

Stochastic sampling One new disadvantage: sampling needs to be high, or artifacts visible Manifests as high-frequency noise Good sample generation is art in itself Much, much slower than simple ray tracing (from [Boulos07])

Overview Review Ray Tracing flavors Ray Tracing vs. rasterization Recursive ray tracing Distributed ray tracing Ray Tracing vs. rasterization

Rasterization Viewer Screen

Ray Tracing Viewer Screen

Rasterization vs. Ray Tracing For each primitive: For each pixel: Is Pixel in Primitive? Yes: Test depth / write color Ray Tracing For each pixel: generate ray Does ray hit primitive?

Ray Tracing “Tracing a ray” = find first hit with scene object Naïve: Test against all scene objects Like testing all pixels in rasterization! In reality: Acceleration structure gives quick estimate of potentially visible objects for ray (topic of 2nd lection on RT)

Rasterization vs. Ray Tracing 3D object space index (e.g. kd-tree) Limits scene dynamics (may require index rebuilt) Increases scalability with scene size  O(log n) Efficiently supports small & arbitrary sets of rays Few rays reflecting off of surface  ray tracing problem 2D image space grid Rays limited to regular sampling & planar perspective See previous slide.

Rasterization vs. Ray Tracing Hardware Support Rasterization has mature & quickly evolving HW High-performance, highly parallel, stream computing engine Ray tracing mostly implemented in SW  Not well supported by current HW

Requirements for Realtime Ray Tracing High floating point performance Traversal & intersection computations Flexible control flow, multiple threads Recursion, efficient traversal of kd-tree, … Exploitation of coherence Caching, packets, efficient traversal, … High bandwidth Between traversal, intersection, and shading; to caches

Ray Tracing algorithms So what’s the big deal? Ray Tracing far more flexible paradigm Not limited to primary visibility! Highly realistic images by default Physical correctness and dependability Support for massive scenes Integration of many different primitive types Declarative scene description Global illumination

Reasons for Using Ray Tracing Highly Realistic Images Volkswagen Beetle with correct shadows and (multi-)reflections on curved surfaces

Reasons for Using Ray Tracing Physical Correctness Physical Correctness and Dependability Numerous approximations caused by rasterization Might be good enough for games (but maybe not?) Industry needs dependable visual results Benefits Users develop trust in the visual results Important decisions can be based on virtual models

Reasons for Using Ray Tracing Physical Correctness Fully ray traced car head lamp, faithful visualization requires up to 50 rays per pixel

Reasons for Using Ray Tracing Physical Correctness 250k / 3 fps 25M / 11 fps Light pattern from a car head lamp computed in realtime using photon mapping: Left: realtime update, middle: accumulated in 30s, right: photograph of real pattern

Reasons for Using Ray Tracing Physical Correctness 250k / 3 fps 25M / 11 fps Photograph Light pattern from a car head lamp computed in realtime using photon mapping: Left: realtime update, middle: accumulated in 30s, right: photograph of real pattern

Reasons for Using Ray Tracing Physical Correctness Rendered directly from trimmed NURBS surfaces, with smooth environment lighting

Reasons for Using Ray Tracing Physical Correctness Textured Phong for comparison Rendered with accurately measured BTF data that accounts for micro lighting effects BTF Data Courtesy R. Klein, Uni Bonn

Reasons for Using Ray Tracing Physical Correctness VR scene illuminated from realtime video feed, AR with realtime environment lighting

Reasons for Using Ray Tracing Massive Models Massive Scenes Scales logarithmically with scene size Supports billions of triangles Benefits Can render entire CAD models without simplification Greatly simplifies and speeds up many tasks

Reasons for Using Ray Tracing Massive Models

Reasons for Using RTRT: Flexible Primitive Types Triangles Volumes data sets Iso-surfaces & direct visualization Regular, rectilinear, curvilinear, unstructured, … Splines and subdivision surfaces Points

Reasons for Using Ray Tracing Flexible Primitive Types Triangles, Bezier splines, and subdivision surfaces fully integrated

Reasons for Using Ray Tracing Flexible Primitive Types Volume visualization using multiple iso-surfaces in combination with surface rendering

Reasons for Using Ray Tracing Flexible Primitive Types 24 MPoints, 2.1 fps with shadow @ 640x480 Realtime ray tracing of point clouds (1 Mpoints each) On one dual-Opteron 2.4 GHz: 4-9 fps

Reasons for Using Ray Tracing Declarative Graphics Declarative Graphics Interface Application specifies scene once, plus updates Rendering fully performed by renderer (e.g. in HW) Similar to scene graphs, PostScript, or latest GUIs Benefits Greatly simplifies application programming Allows for complete HW acceleration

Reasons for Using Ray Tracing Declarative Graphics

Reasons for Using Ray Tracing Declarative Graphics

Reasons for Using Ray Tracing Global Illumination Simulating global lighting through tracing rays Indirect diffuse and caustic illumination Fully recomputed at up to 20 fps Benefits Add the subtle but highly important clue for realism Allows flexible light planning and control

Reasons for Using Ray Tracing Global Illumination Conference room (380 000 tris, 104 lights) with full global illumination in realtime

Conclusion Ray Tracing advantages Disadvantages Reflections, refraction, shadows Rendering of arbitrary objects Does not even need explicit representation Used for global illumination, many others Disadvantages Usually much slower (no hardware acceleration, either)