Path Tracing (some material from University of Wisconsin)

Slides:



Advertisements
Similar presentations
Photorealistic Rendering. Ray tracing v. photorealistic rendering What illumination effects are not captured by ray tracing? What illumination effects.
Advertisements

Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
Advanced Computer Graphics (Spring 2005) COMS 4162, Lectures 18, 19: Monte Carlo Integration Ravi Ramamoorthi Acknowledgements.
CSCE 641: Photon Mapping Jinxiang Chai. Outline Rendering equation Photon mapping.
Photon Tracing with Arbitrary Materials Patrick Yau.
Advanced Computer Graphics (Fall 2009) CS 294, Rendering Lecture 5: Monte Carlo Path Tracing Ravi Ramamoorthi
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 10: Global Illumination Ravi Ramamoorthi Some images courtesy.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
Monte Carlo Integration COS 323 Acknowledgment: Tom Funkhouser.
Advanced Computer Graphics (Spring 2006) COMS 4162, Lecture 20: Monte Carlo Path Tracing Ravi Ramamoorthi Acknowledgements.
Computer Graphics (Spring 2008) COMS 4160, Lecture 22: Global Illumination
02/11/05© 2005 University of Wisconsin Last Time Direct Lighting Light Transport Equation (LTE) Intro.
Today More raytracing stuff –Soft shadows and anti-aliasing More rendering methods –The text book is good on this –I’ll be using images from the CDROM.
12/05/02(c) 2002 University of Wisconsin Last Time Subdivision techniques for modeling Very brief intro to global illumination.
-Global Illumination Techniques
Computer Graphics Global Illumination: Photon Mapping, Participating Media Lecture 12 Taku Komura.
04/30/02(c) 2002 University of Wisconsin Last Time Subdivision techniques for modeling We are now all done with modeling, the standard hardware pipeline.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.
Monte-Carlo Ray Tracing and
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Hybrid Algorithms K. H. Ko School of Mechatronics Gwangju Institute.
Pure Path Tracing: the Good and the Bad Path tracing concentrates on important paths only –Those that hit the eye –Those from bright emitters/reflectors.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
02/12/03© 2003 University of Wisconsin Last Time Intro to Monte-Carlo methods Probability.
In the name of God Computer Graphics. Last Time Some techniques for modeling Today Global illumination and raytracing.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Stochastic Path Tracing Algorithms K. H. Ko School of Mechatronics Gwangju.
Slide 1Lastra, 2/14/2016 Monte-Carlo Methods. Slide 2Lastra, 2/14/2016 Topics Kajiya’s paper –Showed that existing rendering methods are approximations.
Global Illumination (3) Photon Mapping (1). Overview Light Transport Notation Path Tracing Photon Mapping –Photon Tracing –The Photon Map.
01/26/05© 2005 University of Wisconsin Last Time Raytracing and PBRT Structure Radiometric quantities.
Global Illumination (3) Path Tracing. Overview Light Transport Notation Path Tracing Photon Mapping.
02/9/05© 2005 University of Wisconsin Last Time Lights Next assignment – Implement Kubelka-Munk as a BSDF.
11/29/01CS 559, Fall 2001 Today Photorealistic rendering Algorithms for producing high-quality images Ways of deciding which algorithm for use.
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
Advanced Computer Graphics
Advanced Computer Graphics
Shading Revisited Some applications are intended to produce pictures that look photorealistic, or close to it The image should look like a photograph A.
Sampling and Reconstruction of Visual Appearance
Distributed Ray Tracing
RAY TRACING.
© 2003 University of Wisconsin
© University of Wisconsin, CS559 Fall 2004
The Rendering Equation
© 2005 University of Wisconsin
(c) 2002 University of Wisconsin
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Lighting.
CS 655 – Computer Graphics Global Illumination.
© 2003 University of Wisconsin
Distributed Ray Tracing
(c) 2002 University of Wisconsin
Efficient Importance Sampling Techniques for the Photon Map
An Algorithm of Eye-Based Ray Tracing on MATLAB
Monte Carlo I Previous lecture Analytical illumination formula
Monte Carlo Path Tracing
Monte Carlo Rendering Central theme is sampling:
CS5500 Computer Graphics May 29, 2006
Foundations of Computer Graphics (Spring 2012)
Advanced Computer Graphics
Distributed Ray Tracing
GR2 Advanced Computer Graphics AGR
Metropolis Light Transit
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Distributed Ray Tracing
CSC418 Computer Graphics Raytracing Shadows Global Illumination.
Distributed Ray Tracing
Monte Carlo Path Tracing and Caching Illumination
Monte Carlo Integration
Photon Density Estimation using Multiple Importance Sampling
Presentation transcript:

Path Tracing (some material from University of Wisconsin) CS 655 – Computer Graphics Path Tracing (some material from University of Wisconsin)

Path Tracing An extension to ray tracing Simulates global illumination Can handle all possible light bounces L(S|D)*E (this is a reg exp, not a product) Introduced by Kajiya as a solution to the rendering equation Stochastically samples all light paths Handles area light sources, diffuse reflections Approximates the integral of illumination

Path Tracing Algorithms Determine the intensity of each pixel by tracing light transport paths Paths that start at light sources and carry energy A path of length k is a sequence of vertices <x0, … , xk-1> where every xi and xi+1 is mutually visible and x0 is on a light

“Important” Paths We are most interested in the “important” paths Paths that go from a light source to the eye Paths that carry the most energy The rendering equation can be written as a sum of integrals, each one integrating over a different path length

The Rendering Equation - reordered Light to x directly from x’ Light from light source to x’, then to x Light to x via x’ scattered twice Light to x via x’ scattered three times etc.

Sampling Important Paths We want to evaluate the integral using importance sampling i.e., attempt to sample the most important paths How do we find those paths? Several approaches have been tried

Naïve Path Tracing (version 1) Start at a light Build a path by randomly choosing a direction at each bounce, send the ray in that direction, and add the point hit to the path vertex list Join the last point to the eye Problems? What path is achieved by this approach?

Naïve Path Tracing (version 2) Start at eye Build a path by randomly choosing a direction at each bounce, follow the path in that direction, add the point hit to the path vertex list Optionally join the last point to a light Problems? What paths are generated?

Path Tracing (Kajiya) Start at eye At each bounce, send a ray out in the direction determined according to some distribution At each point on the path, cast a shadow ray and add direct lighting contribution at that point Send multiple paths per pixel, average the contributions to get the final intensity

Path Tracing (Kajiya) – Sampling Strategies The way in which the direction of each bounce is determined makes a big difference in image quality. Stratified Sampling Break the possible directions into sub-regions and cast one sample per sub-region. Importance Sampling Sample according to the BRDF

Importance sampling

Path Tracing (Kajiya) - Summary Pros: Focuses on objects that are visible – doesn’t waste time on objects that can’t be seen Spends equal time on all path lengths ray tracing spends more time on longer paths Cons: Little information gain for each ray cast Not easy to get good (important) samples Spends equal time on slow-varying diffuse components and fast varying specular components

Path Tracing Algorithm Send a ray through a pixel Trace the ray to its first intersected object From the intersected object, send out One ray to each light source One additional ray a diffusely reflected ray, a specularly reflected ray, or a transmissive ray Trace the ray and recursively follow it, as above Produces a ray “path” – not a ray tree

Light ray Light Eye Image plane

Illuminance ray Light Diffuse? Specular? Transmission? Eye Image plane

Path Tracing This provides a Monte Carlo approach to global illumination Stochastic samples are taken that should represent the actual surface properties The lighting distribution is sampled by tracing rays stochastically along all possible light paths Averaging a large number of sample rays gives an estimate of the integral of all light paths through the pixel

Selecting the ray to trace How do we select which ray to trace? Each material has a kd, ks, and kt Let ktot = kd+ ks + kt Select a random number R in the range (0, ktot ) if (R < kd) then send diffuse ray else if (R < kd + ks) then send specular ray else send transmission ray

Tracing a Diffuse Reflection Ideal diffuse reflection: Light is scattered equally in all directions

Tracing a Diffuse Reflection Tracing a ray from the eye, the light I see could have come from any direction (direct from the light, or indirect from another object) Randomly pick a direction and trace it

Computing the Diffuse reflection We can compute a random direction as follows: Given two random numbers x1in [0,1] and x2 in [0,1], the randomly reflected direction wd is given by wd = (q, f) = (cos-1(sqrt(x1)), 2px2 )

Tracing a Specular Reflection Ideal specular reflection: Light is scattered according to the reflection direction

Tracing a Specular Reflection As with diffuse lighting, tracing a ray from the eye, the light I see could have come from any direction (direct from the light, or indirect from another object) Light is scattered according to the reflection direction

Problems Need to trace a lot of rays to get an accurate image Typically trace 100 – 1000 rays per pixel

Problems Need to trace a lot of rays to get an accurate image Typically trace 100 – 1000 rays per pixel

10,000 rays per pixel (Henrik Wann Jensen)

Bi-directional Path Tracing What if we were to combine rays from both directions? Send a ray from the eye and trace it into the scene Send a ray from the light and trace it into the scene Combine them by sending a ray from the end of one path to the end of the other path

Bi-directional Path Tracing Pros: Each ray cast contributes to many paths Building from both ends can catch difficult cases All specular paths Caustics The idea extends to participating media Cons: Still spends a lot of time in slow varying diffuse areas May not sample some of the more difficult paths

Example: Mirror Eye ray tracing: ES*DL Light ray tracing: LS*DE Problematic: ES*DS*L Even Worse: LS*DS*DS*E