Christian Lauterbach COMP 770, 2/11/2009

Slides:



Advertisements
Similar presentations
CSG and Raytracing CPSC 407.
Advertisements

13.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 13 An Introduction to Ray Tracing.
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.
Computer graphics & visualization Global Illumination Effects.
Two Methods for Fast Ray-Cast Ambient Occlusion Samuli Laine and Tero Karras NVIDIA Research.
Advanced Ray Tracing CMSC 435/634. Basic Ray Tracing For each pixel – Compute ray direction – Find closest surface – For each light Compute direct illumination.
Light Issues in Computer Graphics Presented by Saleema Amershi.
CSCE 641: Photon Mapping Jinxiang Chai. Outline Rendering equation Photon mapping.
Computer Graphics (Fall 2005) COMS 4160, Lecture 21: Ray Tracing
RAY TRACING.
CSCE 641: Computer Graphics Ray Tracing Jinxiang Chai.
Ray Casting Ray-Surface Intersections Barycentric Coordinates Reflection and Transmission [Shirley, Ch.9] Ray Tracing Handouts Ray Casting Ray-Surface.
Parallelizing Raytracing Gillian Smith CMPE 220 February 19 th, 2008.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 14: Ray Tracing
Ray Tracing Jerry Sui Adam Conner. Part I – Introduction to Ray Tracing Final Product.
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
Ray Tracing 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009.
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
CSCE 641: Computer Graphics Ray Tracing Jinxiang Chai.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
CSC418 Computer Graphics n Raytracing n Shadows n Global Illumination.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
What is Computer Graphics and Image Processing? lAll visual computer output depends on computer graphics and image processing. l3D computer graphics is.
Computer graphics & visualization Ray-Tracing – A Quick review.
COMP 175: Computer Graphics March 24, 2015
12/05/02(c) 2002 University of Wisconsin Last Time Subdivision techniques for modeling Very brief intro to global illumination.
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
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Distribution Ray Tracing.
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.
1 Dr. Scott Schaefer Ray Tracing. 2/42 Ray Tracing Provides rendering method with  Refraction/Transparent surfaces  Reflective surfaces  Shadows.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
Gene Au-yeung, Daniel Quach, Jeffrey Su, Albert Wang, Jessica Wang, David Woo.
Ray Tracer Spring 2008 Help Session. Outline Project Web Resources What do you have to do for this project? Ray Class Isect Class Requirements Tricks.
CSE 681 DISTRIBUTED RAY TRACING some implementation notes.
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
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Stochastic Path Tracing Algorithms K. H. Ko School of Mechatronics Gwangju.
The Critical Angle/Total Internal Reflection critical angle: the angle at which light is refracted at 90º. total internal reflection: the reflection of.
CS 445 / 645 Introduction to Computer Graphics Lecture 16 Lighting Lighting.
CS 551/651: Advanced Computer Graphics
MIT EECS 6.837, Durand and Cutler Acceleration Data Structures for Ray Tracing.
More on Ray Tracing Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Wednesday, April 14, 2004.
Global Illumination (3) Photon Mapping (1). Overview Light Transport Notation Path Tracing Photon Mapping –Photon Tracing –The Photon Map.
RENDERING : Global Illumination
CSE 681 Introduction to Ray Tracing. CSE 681 Ray Tracing Shoot a ray through each pixel; Find first object intersected by ray. Image plane Eye Compute.
Global Illumination (3) Path Tracing. Overview Light Transport Notation Path Tracing Photon Mapping.
Distributed Ray Tracing. Can you get this with ray tracing?
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
Distributed Ray Tracing. Can you get this with ray tracing?
Solid Modeling Dr. Scott Schaefer.
Ray Tracing I. Reading Hill, Chapter 14, Sections 14.1 to 14.5 Hill, Chapter 14, Sections and
CS552: Computer Graphics Lecture 33: Illumination and Shading.
CS552: Computer Graphics Lecture 36: Ray Tracing.
Basic Ray Tracing CMSC 435/634.
3D Rendering 2016, Fall.
CSE 167 [Win 17], Lecture 15: Ray Tracing Ravi Ramamoorthi
Photorealistic Rendering vs. Interactive 3D Graphics
Mike Merchant Nicholas Hilbert
© University of Wisconsin, CS559 Fall 2004
Ray Tracing Dinesh Manocha COMP 575/770.
CS5500 Computer Graphics May 29, 2006
Distributed Ray Tracing
GR2 Advanced Computer Graphics AGR
Presentation transcript:

Christian Lauterbach COMP 770, 2/11/2009 Ray Tracing Christian Lauterbach COMP 770, 2/11/2009

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

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)

Ray Tracing algorithms So what’s the big deal? Ray Tracing far more flexible paradigm Not limited to primary visibility! Recursive (Whitted) ray tracing: Reflections, Refractions, Shadows Distributed ray tracing ...and many more applications

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

Ray/Object intersection Can intersect ray with many objects Triangles, Planes Spheres, Cylinders, Cones Boxes (axis-aligned or otherwise) General polyhedra and many more Even procedural/implicit objects! Constructive solid geometry (CSG) Implicit surfaces / equations

Ray/Object intersection Origin x Direction d Ray formula: x + t*d t > 0 d x

Example: Ray/Sphere Intersection Sphere equation: (p – S)2 – r2 = 0 So let’s plug in ray equation! ((x + t*d)– S)2 – r2 = 0 Simplify a bit, let v = (x – S) (t*d + v)2 – r2 = 0 Expand: t2d2 + 2dvt + v2 - r2 = 0 r S

Example: Ray/Sphere Intersection From last slide: t2d2 + 2dvt + v2 - r2 = 0 Quadratic equation of t of form At2 + Bt + C = 0 Easy to solve t1,2 = -B ± sqrt[ ¼B2 – C ] Two real solutions: why? r S

Ray/sphere intersection This is only one possible algorithm Many more optimized versions exist E.g. early exits or less branches Sometimes best intersection algorithm is hardware specific, too One solution: auto-tuning

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

Recursive ray tracing: shadows Light Shadow ray Viewer If first hit of shadow ray closer than distance to light  in shadow

Recursive Ray Tracing: Reflection Light Reflection ray Viewer

Recursive Ray Tracing: Refraction Light Refraction ray Viewer

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

Recursive Ray Tracing: Example (from [Whitted80])

Recursive Ray Tracing: Example

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!

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

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 Ray Tracing vs. rasterization Ray/Object intersection algorithms Ray Tracing methods Recursive ray tracing Distributed ray tracing

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])

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])

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)