Sampling and Reconstruction of Visual Appearance

Slides:



Advertisements
Similar presentations
Computer graphics & visualization Global Illumination Effects.
Advertisements

Advanced Computer Graphics
Photorealistic Rendering. Ray tracing v. photorealistic rendering What illumination effects are not captured by ray tracing? What illumination effects.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 21: Radiometry Many slides courtesy Pat Hanrahan.
Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.
Advanced Computer Graphics (Spring 2013) CS 283, Lecture 8: Illumination and Reflection Many slides courtesy.
Rendering with Environment Maps Jaroslav Křivánek, KSVI, MFF UK
A Signal-Processing Framework for Forward and Inverse Rendering COMS , Lecture 8.
Monte Carlo Integration Robert Lin April 20, 2004.
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 (Spring 2005) COMS 4162, Lecture 15: Ray Tracing/Global Illumination Ravi Ramamoorthi Slides.
Advanced Computer Graphics (Fall 2009) CS 294, Rendering Lecture 5: Monte Carlo Path Tracing Ravi Ramamoorthi
Computer Graphics (Spring 2008) COMS 4160, Lecture 20: Illumination and Shading 2
Advanced Computer Graphics (Fall 2009) CS , Lecture 1: Introduction and History Ravi Ramamoorthi Some.
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 10: Global Illumination Ravi Ramamoorthi Some images courtesy.
Computer Graphics (Fall 2008) COMS 4160, Lecture 19: Illumination and Shading 2
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 (Fall 2004) COMS 4160, Lecture 16: Illumination and Shading 2 Lecture includes number of slides from.
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 21: Radiosity
Computer Graphics (Spring 2008) COMS 4160, Lecture 22: Global Illumination
Global Illumination Jian Huang, CS 594, Fall 2002 This set of slides reference text book and the course note of Dutre et. al on SIGGRAPH 2001.
01/24/05© 2005 University of Wisconsin Last Time Raytracing and PBRT Structure Radiometric quantities.
-Global Illumination Techniques
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Distribution Ray Tracing.
Monte Carlo I Previous lecture Analytical illumination formula This lecture Numerical evaluation of illumination Review random variables and probability.
02/10/03© 2003 University of Wisconsin Last Time Participating Media Assignment 2 –A solution program now exists, so you can preview what your solution.
Computer Graphics Global Illumination: Photon Mapping, Participating Media Lecture 12 Taku Komura.
111/17/ :21 Graphics II Global Rendering and Radiosity Session 9.
Interreflections : The Inverse Problem Lecture #12 Thanks to Shree Nayar, Seitz et al, Levoy et al, David Kriegman.
Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 2 Graphics Hardware Pipeline, Reflection and Rendering Equations, Taxonomy of Methods
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.
Real-Time High Quality Rendering
Monte-Carlo Ray Tracing and
Computer Graphics (Spring 2003) COMS 4160, Lecture 18: Shading 2 Ravi Ramamoorthi Guest Lecturer: Aner Benartzi.
Shape from Shading Course web page: vision.cis.udel.edu/cv February 26, 2003  Lecture 6.
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.
Computer Graphics III – Monte Carlo integration Direct illumination
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.
Global Illumination (3) Path Tracing. Overview Light Transport Notation Path Tracing Photon Mapping.
Computer graphics III – Rendering equation and its solution
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
Advanced Computer Graphics
© University of Wisconsin, CS559 Fall 2004
The Rendering Equation
(c) 2002 University of Wisconsin
Distribution Ray Tracing
Path Tracing (some material from University of Wisconsin)
Monte Carol Integration
CSCE 441 Computer Graphics: Radiosity
(c) 2002 University of Wisconsin
Monte Carlo I Previous lecture Analytical illumination formula
Monte Carlo Path Tracing
Monte Carlo Rendering Central theme is sampling:
Foundations of Computer Graphics (Spring 2012)
OPTICS III, IV: Global Illumination
Monte Carlo Path Tracing and Caching Illumination
Monte Carlo Integration
Photon Density Estimation using Multiple Importance Sampling
Presentation transcript:

Sampling and Reconstruction of Visual Appearance CSE 274 [Winter 2018], Lecture 3 Ravi Ramamoorthi http://www.cs.ucsd.edu/~ravir

Motivation: Monte Carlo Rendering Key application area for sampling/reconstruction Modern methods for denoising now popular 1-3 order of magnitude speedups in mature area Denoising now standard in production rendering This week: Basic background in rendering Reflection and Rendering Equations Monte Carlo Integration Path Tracing (Basic Monte Carlo rendering method) A review for those who have taken CSE 168

Illumination Models Local Illumination Light directly from light sources to surface No shadows (cast shadows are a global effect) Global Illumination: multiple bounces (indirect light) Hard and soft shadows Reflections/refractions (already seen in ray tracing) Diffuse and glossy interreflections (radiosity, caustics) Some images courtesy Henrik Wann Jensen

Caustics Caustics: Focusing through specular surface Major research effort in 80s, 90s till today

Overview of lecture Theory for all global illumination methods (ray tracing, path tracing, radiosity) We derive Rendering Equation [Kajiya 86] Major theoretical development in field Unifying framework for all global illumination Introduced Path Tracing: core rendering method Discuss existing approaches as special cases Fairly theoretical lecture (but important). Not well covered in textbooks (though see Eric Veach’s thesis). See reading if you are interested.

Outline Reflectance Equation Global Illumination Rendering Equation As a general Integral Equation and Operator Approximations (Ray Tracing, Radiosity) Surface Parameterization (Standard Form)

Reflection Equation Reflected Light (Output Image) Emission Incident Light (from light source) BRDF Cosine of Incident angle

Reflection Equation Sum over all light sources Reflected Light (Output Image) Emission Incident Light (from light source) BRDF Cosine of Incident angle

Reflection Equation Replace sum with integral Reflected Light (Output Image) Emission Incident Light (from light source) BRDF Cosine of Incident angle

Environment Maps Light as a function of direction, from entire environment Captured by photographing a chrome steel or mirror sphere Accurate only for one point, but distant lighting same at other scene locations (typically use only one env. map) Blinn and Newell 1976, Miller and Hoffman, 1984 Later, Greene 86, Cabral et al. 87

The Challenge Computing reflectance equation requires knowing the incoming radiance from surfaces But determining incoming radiance requires knowing the reflected radiance from surfaces

Rendering Equation Surfaces (interreflection) Reflected Light (Output Image) Emission Reflected Light BRDF Cosine of Incident angle UNKNOWN KNOWN UNKNOWN KNOWN KNOWN

Outline Reflectance Equation (review) Global Illumination Rendering Equation As a general Integral Equation and Operator Approximations (Ray Tracing, Radiosity) Surface Parameterization (Standard Form)

Rendering Equation (Kajiya 86)

Rendering Equation as Integral Equation Kernel of equation Reflected Light (Output Image) Emission Reflected Light BRDF Cosine of Incident angle UNKNOWN KNOWN UNKNOWN KNOWN KNOWN Is a Fredholm Integral Equation of second kind [extensively studied numerically] with canonical form

Linear Operator Theory Linear operators act on functions like matrices act on vectors or discrete representations Basic linearity relations hold Examples include integration and differentiation M is a linear operator. f and h are functions of u a and b are scalars f and g are functions

Linear Operator Equation Kernel of equation Light Transport Operator Can be discretized to a simple matrix equation [or system of simultaneous linear equations] (L, E are vectors, K is the light transport matrix)

Solving the Rendering Equation Too hard for analytic solution, numerical methods Approximations, that compute different terms, accuracies of the rendering equation Two basic approaches are ray tracing, radiosity. More formally, Monte Carlo and Finite Element. Today Monte Carlo path tracing is core rendering method Monte Carlo techniques sample light paths, form statistical estimate (example, path tracing) Finite Element methods discretize to matrix equation

Solving the Rendering Equation General linear operator solution. Within raytracing: General class numerical Monte Carlo methods Approximate set of all paths of light in scene Binomial Theorem Term n corresponds to n bounces of light

Ray Tracing Emission directly From light sources Direct Illumination on surfaces Global Illumination (One bounce indirect) [Mirrors, Refraction] (Two bounce indirect) [Caustics etc]

Ray Tracing OpenGL Shading Emission directly From light sources Direct Illumination on surfaces Global Illumination (One bounce indirect) [Mirrors, Refraction] OpenGL Shading (Two bounce indirect) [Caustics etc]

Outline Reflectance Equation (review) Global Illumination Rendering Equation As a general Integral Equation and Operator Approximations (Ray Tracing, Radiosity) Surface Parameterization (Standard Form)

Rendering Equation Surfaces (interreflection) Reflected Light (Output Image) Emission Reflected Light BRDF Cosine of Incident angle UNKNOWN KNOWN UNKNOWN KNOWN KNOWN

Change of Variables Integral over angles sometimes insufficient. Write integral in terms of surface radiance only (change of variables)

Change of Variables Integral over angles sometimes insufficient. Write integral in terms of surface radiance only (change of variables)

Rendering Equation: Standard Form Integral over angles sometimes insufficient. Write integral in terms of surface radiance only (change of variables) Domain integral awkward. Introduce binary visibility fn V Same as equation 2.52 Cohen Wallace. It swaps primed And unprimed, omits angular args of BRDF, - sign. Same as equation above 19.3 in Shirley, except he has no emission, slightly diff. notation

Summary Theory for all global illumination methods (ray tracing, path tracing, radiosity) We derive Rendering Equation [Kajiya 86] Major theoretical development in field Unifying framework for all global illumination Discuss existing approaches as special cases

Motivation: Monte Carlo Integration Rendering = integration Reflectance equation: Integrate over incident illumination Rendering equation: Integral equation Many sophisticated shading effects involve integrals Antialiasing Soft shadows Indirect illumination Caustics Most Sampling/Reconstruction treats actual rendering as a black box. But still helpful to know some basics

Example: Soft Shadows

Monte Carlo Algorithms based on statistical sampling and random numbers Coined in the beginning of 1940s. Originally used for neutron transport, nuclear simulations Von Neumann, Ulam, Metropolis, … Canonical example: 1D integral done numerically Choose a set of random points to evaluate function, and then average (expectation or statistical average)

Monte Carlo Algorithms Advantages Robust for complex integrals in computer graphics (irregular domains, shadow discontinuities and so on) Efficient for high dimensional integrals (common in graphics: time, light source directions, and so on) Quite simple to implement Work for general scenes, surfaces Easy to reason about (but care taken re statistical bias) Disadvantages Noisy Slow (many samples needed for convergence) Not used if alternative analytic approaches exist (but those are rare)

Slide courtesy of Peter Shirley Integration in 1D f(x) x=1 Slide courtesy of Peter Shirley

Slide courtesy of Peter Shirley We can approximate Standard integration methods like trapezoidal rule and Simpsons rule Advantages: Converges fast for smooth integrands Deterministic Disadvantages: Exponential complexity in many dimensions Not rapid convergence for discontinuities g(x) f(x) x=1 Slide courtesy of Peter Shirley

Slide courtesy of Peter Shirley Or we can average f(x) E(f(x)) x=1 Slide courtesy of Peter Shirley

Estimating the average Monte Carlo methods (random choose samples) Advantages: Robust for discontinuities Converges reasonably for large dimensions Can handle complex geometry, integrals Relatively simple to implement, reason about f(x) E(f(x)) x1 xN Slide courtesy of Peter Shirley

Slide courtesy of Peter Shirley Other Domains f(x) < f >ab x=a x=b Slide courtesy of Peter Shirley

Multidimensional Domains Same ideas apply for integration over … Pixel areas Surfaces Projected areas Directions Camera apertures Time Paths Surface Eye Pixel x

Random Variables Describes possible outcomes of an experiment In discrete case, e.g. value of a dice roll [x = 1-6] Probability p associated with each x (1/6 for dice) Continuous case is obvious extension

Expected Value Expectation For Dice example:

Sampling Techniques Problem: how do we generate random points/directions during path tracing? Non-rectilinear domains Importance (BRDF) Stratified Eye x Surface

Generating Random Points Uniform distribution: Use random number generator 1 Probability W

Generating Random Points Specific probability distribution: Function inversion Rejection Metropolis 1 Probability W

Common Operations Want to sample probability distributions Draw samples distributed according to probability Useful for integration, picking important regions, etc. Common distributions Disk or circle Uniform Upper hemisphere for visibility Area luminaire Complex lighting like an environment map Complex reflectance like a BRDF

Generating Random Points Cumulative Probability 1 W

Rejection Sampling Probability 1 W x

More formally

Importance Sampling Put more samples where f(x) is bigger E(f(x)) x1 xN

Importance Sampling This is still unbiased E(f(x)) for all N x1 xN

Importance Sampling Zero variance if p(x) ~ f(x) E(f(x)) Less variance with better importance sampling x1 xN

Stratified Sampling Estimate subdomains separately Arvo Ek(f(x)) x1 xN

Stratified Sampling Less overall variance if less variance in subdomains Ek(f(x)) x1 xN

More Information Veach PhD thesis chapter (linked to from website) Course Notes (links from website) Mathematical Models for Computer Graphics, Stanford, Fall 1997 State of the Art in Monte Carlo Methods for Realistic Image Synthesis, Course 29, SIGGRAPH 2001