Physically Realistic Ray Tracing

Similar documents
Distribution Ray Tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Reading. 8. Distribution Ray Tracing. Required: Watt, sections 10.6,14.8. Further reading:

Reading. Distribution Ray Tracing. BRDF, revisited. Pixel anti-aliasing. ω in. Required: Shirley, section Further reading:

Distribution Ray Tracing

Anti-aliasing and Monte Carlo Path Tracing. Brian Curless CSE 557 Autumn 2017

Anti-aliasing and Monte Carlo Path Tracing

Anti-aliasing and Monte Carlo Path Tracing. Brian Curless CSE 457 Autumn 2017

Distribution Ray-Tracing. Programação 3D Simulação e Jogos

Distributed Ray Tracing

The Rendering Equation and Path Tracing

Advanced Graphics. Path Tracing and Photon Mapping Part 2. Path Tracing and Photon Mapping

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Ground Truth. Welcome!

EECS 487: Interactive Computer Graphics

Global Illumination The Game of Light Transport. Jian Huang

Specular reflection. Lighting II. Snell s Law. Refraction at boundary of media

Sung-Eui Yoon ( 윤성의 )

Announcements. Written Assignment 2 out (due March 8) Computer Graphics

Distributed Ray Tracing

Final Project: Real-Time Global Illumination with Radiance Regression Functions

Monte-Carlo Ray Tracing. Antialiasing & integration. Global illumination. Why integration? Domains of integration. What else can we integrate?

Raytracing & Epsilon. Today. Last Time? Forward Ray Tracing. Does Ray Tracing Simulate Physics? Local Illumination

Path Tracing part 2. Steve Rotenberg CSE168: Rendering Algorithms UCSD, Spring 2017

Visual cues to 3D geometry. Light Reflection and Advanced Shading. Shading. Recognizing materials. size (perspective) occlusion shading

To Do. Real-Time High Quality Rendering. Motivation for Lecture. Monte Carlo Path Tracing. Monte Carlo Path Tracing. Monte Carlo Path Tracing

Ray Tracing. Brian Curless CSEP 557 Fall 2016

CS 563 Advanced Topics in Computer Graphics Camera Models. by Kevin Kardian

MIT Monte-Carlo Ray Tracing. MIT EECS 6.837, Cutler and Durand 1

Reading. Ray Tracing. Eye vs. light ray tracing. Geometric optics. Required:

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

Computer Graphics Project

INFOMAGR Advanced Graphics. Jacco Bikker - February April Welcome!

Reading. Ray Tracing. Eye vs. light ray tracing. Geometric optics. Required: Watt, sections , (handout) Further reading:

I have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster. Computer Graphics

Recent Advances in Monte Carlo Offline Rendering

13 Distribution Ray Tracing

distribution ray tracing

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

A Brief Overview of. Global Illumination. Thomas Larsson, Afshin Ameri Mälardalen University

Ray Tracing. CS334 Fall Daniel G. Aliaga Department of Computer Science Purdue University

Ray Tracing. Johns Hopkins Department of Computer Science Course : Rendering Techniques, Professor: Jonathan Cohen

GAMES Webinar: Rendering Tutorial 2. Monte Carlo Methods. Shuang Zhao

Global Illumination and Monte Carlo

Schedule. MIT Monte-Carlo Ray Tracing. Radiosity. Review of last week? Limitations of radiosity. Radiosity

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

distribution ray-tracing

Sampling, Aliasing, & Mipmaps

Motivation. Advanced Computer Graphics (Fall 2009) CS 283, Lecture 11: Monte Carlo Integration Ravi Ramamoorthi

CptS 548 (Advanced Computer Graphics) Unit 3: Distribution Ray Tracing

Sampling, Aliasing, & Mipmaps

Local vs. Global Illumination & Radiosity

MULTI-DIMENSIONAL MONTE CARLO INTEGRATION

The Rendering Equation. Computer Graphics CMU /15-662

Cameras. Camera. Digital Image Synthesis Yung-Yu Chuang 10/26/2006

Global Illumination. COMP 575/770 Spring 2013

Ray Tracing Part 2. CSC418/2504 Introduction to Computer Graphics. TA: Muhammed Anwar

Discussion. Smoothness of Indirect Lighting. History and Outline. Irradiance Calculation. Irradiance Caching. Advanced Computer Graphics (Spring 2013)

SAMPLING AND NOISE. Increasing the number of samples per pixel gives an anti-aliased image which better represents the actual scene.

Lecture 7 - Path Tracing

The Rendering Equation. Computer Graphics CMU /15-662, Fall 2016

Motivation: Monte Carlo Path Tracing. Sampling and Reconstruction of Visual Appearance. Monte Carlo Path Tracing. Monte Carlo Path Tracing

Ray tracing. EECS 487 March 19,

Computer Graphics. Lecture 13. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura

Motivation: Monte Carlo Rendering. Sampling and Reconstruction of Visual Appearance. Caustics. Illumination Models. Overview of lecture.

CS354 Computer Graphics Ray Tracing. Qixing Huang Januray 24th 2017

Ray Tracing. CSCI 420 Computer Graphics Lecture 15. Ray Casting Shadow Rays Reflection and Transmission [Ch ]

Shading. Brian Curless CSE 557 Autumn 2017

Choosing the Right Algorithm & Guiding

Motivation. Monte Carlo Path Tracing. Monte Carlo Path Tracing. Monte Carlo Path Tracing. Monte Carlo Path Tracing

Photo-realistic Renderings for Machines Seong-heum Kim

Reading. 18. Projections and Z-buffers. Required: Watt, Section , 6.3, 6.6 (esp. intro and subsections 1, 4, and 8 10), Further reading:

COMP371 COMPUTER GRAPHICS

Virtual Spherical Lights for Many-Light Rendering of Glossy Scenes

Monte Carlo Integration

Geometric optics. The University of Texas at Austin CS384G Computer Graphics Don Fussell

11/2/2010. In the last lecture. Monte-Carlo Ray Tracing : Path Tracing. Today. Shadow ray towards the light at each vertex. Path Tracing : algorithm

2/1/10. Outline. The Radiance Equation. Light: Flux Equilibrium. Light: Radiant Power. Light: Equation. Radiance. Jan Kautz

Stochastic Path Tracing and Image-based lighting

Biased Monte Carlo Ray Tracing:

rendering equation camera all

Computer Graphics. Lecture 10. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura 12/03/15

CPSC GLOBAL ILLUMINATION

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

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

Realistic Camera Model

Advanced Ray Tracing

Korrigeringar: An introduction to Global Illumination. Global Illumination. Examples of light transport notation light

Monte Carlo Path Tracing. The Rendering Equation

Today. Anti-aliasing Surface Parametrization Soft Shadows Global Illumination. Exercise 2. Path Tracing Radiosity

Simple Nested Dielectrics in Ray Traced Images

Metropolis Light Transport

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

Global Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Photon Mapping. Michael Doggett Department of Computer Science Lund university

In the real world, light sources emit light particles, which travel in space, reflect at objects or scatter in volumetric media (potentially multiple

Depth of Field for Photorealistic Ray Traced Images JESSICA HO AND DUNCAN MACMICHAEL MARCH 7, 2016 CSS552: TOPICS IN RENDERING

Illumination Algorithms

Sampling: Antialiasing - Intro

SDK White Paper. Soft Shadows

CS-184: Computer Graphics. Administrative

Lighting and Shading

Transcription:

Physically Realistic Ray Tracing

Reading Required: Watt, sections 10.6,14.8. Further reading: A. Glassner. An Introduction to Ray Tracing. Academic Press, 1989. [In the lab.] Robert L. Cook, Thomas Porter, Loren Carpenter. Distributed Ray Tracing. Computer Graphics (Proceedings of SIGGRAPH 84). 18 (3). pp. 137-145. 1984. James T. Kajiya. The Rendering Equation. Computer Graphics (Proceedings of SIGGRAPH 86). 20 (4). pp. 143-150. 1986. Henrik Wann Jensen, Basic Monte Carlo Integration, Appendix A from book Realistic Image Synthesis Using Photon Mapping. 2

Pixel anti-aliasing No anti-aliasing Pixel anti-aliasing 3

Surface reflection equation In reality, surfaces do not reflect in a mirror-like fashion. To compute the reflection from a real surface, we would actually need to solve the surface reflection equation: I(ω out ) = H I(ω in ) f r (ω in,ω out )dω in How might we represent light from a single direction? We can plot the reflected light as a function of viewing angle for multiple light source contributions: 4

Simulating gloss and translucency The mirror-like form of reflection, when used to approximate glossy surfaces, introduces a kind of aliasing, because we are undersampling reflection (and refraction). For example: Distributing rays over reflection directions gives: 5

Reflection anti-aliasing Reflection anti-aliasing 6

Full anti-aliasing Full anti-aliasing lots of nested integrals! Computing these integrals is prohibitively expensive. We ll look at ways to approximate integrals 7

Approximating integrals Let s say we want to compute the integral of a function: F = f (x)dx If f(x) is not known analytically, but can be evaluated, then we can approximate the integral by: F 1 n n i=1 f (iδx) Evaluating an integral in this manner is called quadrature. 8

Integrals as expected values An alternative to distributing the sample positions regularly is to distribute them stochastically. Let s say the position in x is a random variable X, which is distributed according to p(x), a probability density function (strictly positive that integrates to unity). Now let s consider a function of that random variable, f(x)/ p(x). What is the expected value of this new random variable? First, recall the expected value of a function g(x): E[g(X)] = g(x) p(x)dx Then, the expected value of f(x)/p(x) is: E[ f (X) p(x) ] = f (x) p(x) p(x)dx = f (x)dx 9

Monte Carlo integration Thus, given a set of samples positions, X i, we can estimate the integral as: F 1 n f (X i ) n p(x i ) This procedure is known as Monte Carlo integration. The trick is getting as accurate as possible with as few samples as possible. More concretely, we would like the variance of the estimate of the integral to be low: The name of the game is variance reduction i=1 " V f (X) % "( $ ' = E $ * # p(x) & # $ ) f (X) p(x) + -, 2 % ' &' E " f (X) % $ ' # p(x) & 2 10

Uniform sampling One approach is uniform sampling (i.e., choosing X from a uniform distribution): 11

Importance sampling A better approach, if f(x) is positive, would be to choose p(x) ~ f(x). In fact, this choice would be optimal. Why don t we just do that? Alternatively, we can use heuristics to guess where f(x) will be large. This approach is called importance sampling. 12

Summing over ray paths We can think of this problem in terms of enumerated rays: The intensity at a pixel is the sum over the primary rays: I pixel = 1 n I(r i ) n i=1 For a given primary ray, its intensity depends on secondary rays: I(r i ) = 1 n Substituting back in: I pixel = 1 n j i I(r ij ) f r (r ij r i ) j I(r ij ) f r (r ij r i ) 13

Summing over ray paths We can incorporate tertiary rays next: I pixel = 1 n Each triple i,j,k corresponds to a ray path: i j k I(r ijk ) f r (r ijk r ij ) f r (r ij r i ) r ijk r ij r i So, we can see that ray tracing is a way to approximate a complex, nested light transport integral with a summation over ray paths (of arbitrary length!). Problem: too expensive to sum over all paths. Solution: choose a small number of good paths. 14

Whitted integration An anti-aliased Whitted ray tracer chooses very specific paths, i.e., paths starting on a regular sub-pixel grid with only perfect reflections (and refractions) that terminate at the light source. One problem with this approach is that it doesn t account for non-mirror reflection at surfaces. 15

Monte Carlo path tracing Instead, we could choose paths starting from random subpixel locations with completely random decisions about reflection (and refraction). This approach is called Monte Carlo path tracing [Kajiya86]. The advantage of this approach is that the answer is known to be unbiased and will converge to the right answer. 16

Importance sampling The disadvantage of the completely random generation of rays is the fact that it samples unimportant paths and neglects important ones. This means that you need a lot of rays to converge to a good answer. The solution is to re-inject Whitted-like ideas: spawn rays to the light, and spawn rays that favor the specular direction. 17

Stratified sampling Another method that gives faster convergence is stratified sampling. E.g., for sub-pixel samples: We call this a jittered sampling pattern. One interesting side effect of these stochastic sampling patterns is that they actually injects noise into the solution (slightly grainier images). This noise tends to be less objectionable than aliasing artifacts. 18

Distribution ray tracing These ideas can be combined to give a particular method called distribution ray tracing [Cook84]: uses non-uniform (jittered) samples. replaces aliasing artifacts with noise. provides additional effects by distributing rays to sample: Reflections and refractions Light source area Camera lens area Time [Originally called distributed ray tracing, but we will call it distribution ray tracing so as not to confuse with parallel computing.] 19

DRT pseudocode TraceImage() looks basically the same, except now each pixel records the average color of jittered sub-pixel rays. function traceimage (scene): for each pixel (i, j) in image do I(i, j) 0 for each sub-pixel id in (i,j) do s pixeltoworld(jitter(i, j, id)) p COP d (s - p).normalize() I(i, j) I(i, j) + traceray(scene, p, d, id) end for I(i, j)! I(i, j)/numsubpixels end for end function A typical choice is numsubpixels = 4*4. 20

DRT pseudocode (cont d) Now consider traceray(), modified to handle (only) opaque glossy surfaces: function traceray(scene, p, d, id): (q, N, material) intersect (scene, p, d) I shade( ) R jitteredreflectdirection(n, -d, id) I I + material.k r * traceray(scene, q, R, id) return I end function 21

Soft shadows Distributing rays over light source area gives: 22

The pinhole camera The first camera - camera obscura - known to Aristotle. In 3D, we can visualize the blur induced by the pinhole (a.k.a., aperture): Q: How would we reduce blur? 23

Shrinking the pinhole Q: How can we simulate a pinhole camera more accurately? Q: What happens as we continue to shrink the aperture? 24

Shrinking the pinhole, cont d 25

Lenses Pinhole cameras in the real world require small apertures to keep the image in focus. Lenses focus a bundle of rays to one point => can have larger aperture. f d i d o For a thin lens, we can approximately calculate where an object point will be in focus using the the Gaussian lens formula: where f is the focal length of the lens. 1 1 1 + = d d f o i 26

Depth of field Lenses do have some limitations. The most noticeable is the fact that points that are not in the object plane will appear out of focus. The depth of field is a measure of how far from the object plane points can be before appearing too blurry. 27

Simulating depth of field Distributing rays over a finite aperture gives: 28

Chaining the ray id s In general, you can trace rays through a scene and keep track of their id s to handle all of these effects: 29

DRT to simulate motion blur Distributing rays over time gives: 30