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

Similar documents
Metropolis Light Transport

Bidirectional Path Tracing

Rendering Equation & Monte Carlo Path Tracing I

rendering equation camera all

Choosing the Right Algorithm & Guiding

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

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

The Rendering Equation and Path Tracing

Virtual Spherical Lights for Many-Light Rendering of Glossy Scenes

Variance Reduction. Computer Graphics CMU /15-662, Fall 2016

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

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

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

INFOMAGR Advanced Graphics. Jacco Bikker - February April Welcome!

Monte Carlo Ray Tracing. Computer Graphics CMU /15-662

Metropolis Light Transport

In this part, I will mostly talk about the vertex merging technique (a.k.a. kernel estimation).

2017 Summer Course on Optical Oceanography and Ocean Color Remote Sensing. Monte Carlo Simulation

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

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

Global Illumination. COMP 575/770 Spring 2013

Lecture 7: Monte Carlo Rendering. MC Advantages

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

Photon Maps. The photon map stores the lighting information on points or photons in 3D space ( on /near 2D surfaces)

Realistic Image Synthesis

Interactive Methods in Scientific Visualization

Monte Carlo Integration

Monte Carlo Path Tracing. The Rendering Equation

Importance Sampling of Area Lights in Participating Media

Milton. Travis Fischer 09 Advised by Professors John Hughes and Andy van Dam

Global Illumination The Game of Light Transport. Jian Huang

Radiometry & BRDFs CS295, Spring 2017 Shuang Zhao

Lecture 12: Photon Mapping. Biased Methods

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

Global Illumination. Why Global Illumination. Pros/Cons and Applications. What s Global Illumination

Global Illumination. CSCI 420 Computer Graphics Lecture 18. BRDFs Raytracing and Radiosity Subsurface Scattering Photon Mapping [Ch

Anti-aliasing and Monte Carlo Path Tracing

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

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

The Rendering Equation. Computer Graphics CMU /15-662

Physically Realistic Ray Tracing

Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

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

Single Scattering in Refractive Media with Triangle Mesh Boundaries

Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

MULTI-DIMENSIONAL MONTE CARLO INTEGRATION

Monte Carlo Integration COS 323

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

Chapter 1. Introduction

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

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

Assignment 3: Path tracing

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

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

Monte Carlo Integration

THE goal of rendering algorithms is to synthesize images of virtual scenes. Global illumination

Mixing Monte Carlo and Progressive Rendering for Improved Global Illumination

COMPUTER GRAPHICS COURSE. LuxRender. Light Transport Foundations

Level-set MCMC Curve Sampling and Geometric Conditional Simulation

Monte Carlo Path Tracing

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

Convexization in Markov Chain Monte Carlo

Scalable many-light methods

13 Distribution Ray Tracing

Bidirectional Lightcuts

Part I The Basic Algorithm. Principles of Photon Mapping. A two-pass global illumination method Pass I Computing the photon map

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

Position-Free Monte Carlo Simulation for Arbitrary Layered BSDFs

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

Implementation of Bidirectional Ray Tracing Algorithm

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

Probability and Statistics for Final Year Engineering Students

Numerical Integration

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

Towards Interactive Global Illumination Effects via Sequential Monte Carlo Adaptation. Carson Brownlee Peter S. Shirley Steven G.

Lecture 7 - Path Tracing

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Shading Models. Welcome!

The Rendering Equation Philip Dutré. Course 4. State of the Art in Monte Carlo Global Illumination Sunday, Full Day, 8:30 am - 5:30 pm

SOME THEORY BEHIND REAL-TIME RENDERING

Monte Carlo Integration COS 323

782 Schedule & Notes

Rendering Part I (Basics & Ray tracing) Lecture 25 December 1, 2015

Quantitative Biology II!

Rendering: Reality. Eye acts as pinhole camera. Photons from light hit objects

Photon Mapping. Michael Doggett Department of Computer Science Lund university

Biased Monte Carlo Ray Tracing:

Photorealism: Ray Tracing

Representativity for Robust and Adaptive Multiple Importance Sampling

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

Philipp Slusallek Karol Myszkowski. Realistic Image Synthesis SS18 Instant Global Illumination

Realistic Camera Model

Radiometry and reflectance

Lighting. Figure 10.1

Global Illumination and Monte Carlo

rendering equation computer graphics rendering equation 2009 fabio pellacini 1

10703 Deep Reinforcement Learning and Control

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

Introduction to Computer Vision. Introduction CMPSCI 591A/691A CMPSCI 570/670. Image Formation

Illumination Algorithms

Stochastic Progressive Photon Mapping

Transcription:

GAMES Webinar: Rendering Tutorial 2 Monte Carlo Methods Shuang Zhao Assistant Professor Computer Science Department University of California, Irvine GAMES Webinar Shuang Zhao 1

Outline 1. Monte Carlo integration A powerful numerical tool for estimating complex integrals 2. Rendering equation The physical framework governing light transport 3. Path tracing Basically, 1 + 2 4. Path integral formulation 5. Advanced methods GAMES Webinar Shuang Zhao 2

Monte Carlo Integration GAMES Webinar: Rendering Tutorial 2 GAMES Webinar Shuang Zhao 3

Why Monte Carlo? The gold standard approach to solve the RTE Advantages: Provides estimates with quantifiable uncertainty Adaptable to systems with complex geometries GAMES Webinar Shuang Zhao 4

Monte Carlo Integration A powerful framework for computing integrals Numerical Nondeterministic (i.e., using randomness) Scalable to high-dimensional problems GAMES Webinar Shuang Zhao 5

Random Variables (Discrete) random variable X Possible outcomes: x 1, x 2,, x n with probability masses p 1, p 2,, p n such that E.g., fair coin Outcomes: x 1 = head, x 2 = tail Probabilities: p 1 = p 2 = ½ GAMES Webinar Shuang Zhao 6

Random Variables (Continuous) random variable X Possible outcomes: with probability density function (PDF) p(x) satisfying Cumulative density function (CDF) P(x) given by GAMES Webinar Shuang Zhao 7

Strong Law of Large Numbers Let x 1, x 2,, x n be n independent observations (aka. samples) of X Sample mean Actual mean GAMES Webinar Shuang Zhao 8

Example: Evaluating π Unit circle S Let X be a point uniformly distributed in the square Let, then Circle area = π Square area = 4 GAMES Webinar Shuang Zhao 9

Example: Evaluating π Unit circle S Simple solution for computing π: Generate n samples x 1,, x n independently Circle area = π Square area = 4 Compute Live demo GAMES Webinar Shuang Zhao 10

Example: Evaluating π GAMES Webinar Shuang Zhao 11

Integral f(x): one-dimensional scalar function GAMES Webinar Shuang Zhao 12

Deterministic Integration Quadrature rule: Scales poorly with high dimensionality: Needs n m bins for a m-dimensional problem We have a high-dimensional problem! GAMES Webinar Shuang Zhao 13

Monte Carlo Integration: Overview Goal: Estimating Idea: Constructing random variable Such that is called an unbiased estimator of But how? GAMES Webinar Shuang Zhao 14

Monte Carlo Integration Let p() be any probability density function over [a, b] and X be a random variable with density p Let, then: To estimate : strong law of large numbers GAMES Webinar Shuang Zhao 15

Monte Carlo Integration Goal: to estimate Pick a probability density function Generate n independent samples: Evaluate for j = 1, 2,, n Return sample mean: GAMES Webinar Shuang Zhao 16

How to pick density function p()? In theory (Almost) anything In practice: Uniform distributions (almost) always work As long as the domain is bounded Choice of p() greatly affects the effectiveness (i.e., convergence rate) of the resulting estimator GAMES Webinar Shuang Zhao 17

Monte Carlo Integration Hello, World! Estimating Algorithm: Draw i.i.d x 1, x 2,, x n uniformly from [0, 1) Return Live demo GAMES Webinar Shuang Zhao 18

Monte Carlo Integration Hello, World! Estimating GAMES Webinar Shuang Zhao 19

Multiple Importance Sampling To estimate Assume there are n probability densities p 1, p 2,, p n to sample x. Then, is an unbiased estimator of for all x with whenever as long as: GAMES Webinar Shuang Zhao 20

Weighting Functions The balance heuristic Then, How good is the new estimator? As long as there exists a good estimator for, will also be good GAMES Webinar Shuang Zhao 21

Example: MIS Consider the problem of evaluating: denotes the indicator function with two probability densities f: normal distribution with mean 0 and variance σ 2 g: uniform distribution between a and b GAMES Webinar Shuang Zhao 22

Example: MIS σ = 1; a = 1.9, b = 2.0 GAMES Webinar Shuang Zhao 23

Example: MIS σ = 0.05; a = -3.0, b = 3.0 GAMES Webinar Shuang Zhao 24

The Rendering Equation GAMES Webinar: Rendering Tutorial 2 GAMES Webinar Shuang Zhao 25

Radiance Radiant energy at x in direction ω: A 5D function per projected surface area per solid angle : Power GAMES Webinar Shuang Zhao 26

Light Transport Goal Describe steady-state radiance distribution in virtual scenes Assumptions Geometric optics Achieves steady state instantaneously GAMES Webinar Shuang Zhao 27

Radiance at Equilibrium Radiance values at all points in the scene and in all directions expresses the equilibrium 5D Light-field We only consider radiance on surfaces (4D) Assuming no volumetric scattering or absorption GAMES Webinar Shuang Zhao 28

Rendering Equation (RE) RE describes the distribution of radiance at equilibrium RE involves: Scene geometry Light source info. Surface reflectance info. Radiance values at all surface points in all directions (Known) (Unknown) GAMES Webinar Shuang Zhao 29

Rendering Equation (RE) = + = + GAMES Webinar Shuang Zhao 30

Rendering Equation Incoming radiance GAMES Webinar Shuang Zhao 31

Rendering Equation (Invariant of radiance along lines) GAMES Webinar Shuang Zhao 32

Monte Carlo Path Tracing GAMES Webinar: Rendering Tutorial 2 GAMES Webinar Shuang Zhao 33

Path Tracing (Version 0) Estimating L r using MC integration: Draw ω i uniformly at random p(ω i ) = 1/(2π) GAMES Webinar Shuang Zhao 34

Path Tracing (Version 0) Light source Light path GAMES Webinar Shuang Zhao 35

Challenge Small light source leads to high noise Because the probability for a light path to hit the light source is small 64 samples per pixel GAMES Webinar Shuang Zhao 36

Idea: Separating Direct & Indirect Indirect Direct GAMES Webinar Shuang Zhao 37

Direct Illumination Direct GAMES Webinar Shuang Zhao 38

Indirect Illumination Indirect GAMES Webinar Shuang Zhao 39

Summary: Direct + Indirect L = L e + L r Non-recursive This idea is usually called next-event estimation Recursion GAMES Webinar Shuang Zhao 40

Estimating Direct Illumination Idea: sampling the light source Solid angle integral area integral Change of measure GAMES Webinar Shuang Zhao 41

Path Tracing (with NEE) Light source Shadow ray Shadow ray Light path GAMES Webinar Shuang Zhao 42

Path Integral Formulation GAMES Webinar: Rendering Tutorial 2 GAMES Webinar Shuang Zhao 43

Path Integral Formulation (Preview) Goal: rewriting the measurement equation as an integral of the form where form denotes individual light paths for the GAMES Webinar Shuang Zhao 44

Benefits Express the measurement I as an integral instead of an integral equation Provide a unified framework for deriving advanced estimators of I GAMES Webinar Shuang Zhao 45

Recap: Change of Measure From solid angle to area: We now apply this idea to the RE as well as the measurement equation GAMES Webinar Shuang Zhao 46

Path Integral Formulation of the RE By repeatedly expanding L, we get: where for any : GAMES Webinar Shuang Zhao 47

Applying the Path Integral Formulation The path integral can be estimated via Monte Carlo integration framework: What density p to use? How to draw a sample path from p? GAMES Webinar Shuang Zhao 48

Recap: Local Path Sampling Path tracing Without next-event estimation One transport path at a time With next-event estimation Multiple transport paths at a time GAMES Webinar Shuang Zhao 49

Advanced Methods GAMES Webinar: Rendering Tutorial 2 GAMES Webinar Shuang Zhao 50

Advanced Methods Bidirectional path tracing (BDPT) Metropolis light transport (MLT) GAMES Webinar Shuang Zhao 51

Bidirectional Path Tracing Build light transport paths by connecting two sub-paths starting from the light source and the sensor, respectively [Veach 1997] Use multiple importance sampling (MIS) to properly weight each path GAMES Webinar Shuang Zhao 52

Building Transport Paths For any, create light sub-path and sensor sub-path (using local path sampling) The full path two pieces: is obtained by concatenating these GAMES Webinar Shuang Zhao 53

Building Transport Paths Remark: there is more than one sampling technique for each path length (k + 1) techniques for paths with k vertices [Veach 1997] GAMES Webinar Shuang Zhao 54

Building Transport Paths For each s and t, the construction of a probability density Similar to the unidirectional case, equals the product of densities of sampling both sub-paths gives GAMES Webinar Shuang Zhao 55

Building Transport Paths Using multiple importance sampling, we can combine all these path sampling schemes, resulting in: where w s,t is the weighting function Balance heuristic GAMES Webinar Shuang Zhao 56

Example: Modified Cornell Box Area light facing up The scene is lit largely indirectly Cornell Box Mirrored ball Camera facing a mirrored ball The scene is observed indirectly Difficult to render with unidirectional path tracing GAMES Webinar Shuang Zhao 57

Example: Modified Cornell Box (Rendered in equal-time) Path tracing Bidirectional path tracing GAMES Webinar Shuang Zhao 58

Metropolis light transport (MLT) A Markov Chain Monte Carlo (MCMC) framework implementing the Metropolis- Hasting method first proposed by Veach and Guibas in 1997 Capable of efficiently constructing difficult transport paths Lots of ongoing research along this direction GAMES Webinar Shuang Zhao 59

Metropolis-Hasting Method A Markov-Chain Monte Carlo technique Given a non-negative function f, generate a chain of (correlated) samples X 1, X 2, X 3, that follow a probability density proportional to f Main advantage: f does not have to be a PDF (i.e., unnormalized) GAMES Webinar Shuang Zhao 60

Metropolis-Hasting Method Input Non-negative function f Probability density g(y x) suggesting a candidate for the next sample value x, given the previous sample value y The algorithm: given current sample X i 1. Sample X from g(x i X ) 2. Let 3. Set X i+1 to X with prob. a; otherwise, set X i+1 to X i Start with arbitrary initial state X 0 GAMES Webinar Shuang Zhao 61

Path Mutations The key step of the MLT Given a transport path, we need to define a transition probability to allow sampling mutated paths based on Given this transition density, the acceptance probability is then given by GAMES Webinar Shuang Zhao 62

Desirable Mutation Properties High acceptance probability should be large with high probability Large changes to the path Ergodicity (never stuck in some-region of the path space) should be non-zero for all with Low cost GAMES Webinar Shuang Zhao 63

Path Mutation Strategies [Veach & Guibas 1997] Bidirectional mutation Path perturbations Lens sub-path mutation [Jakob & Marschner 2012] Manifold exploration [Li et al. 2015] Hamiltonian Monte Carlo GAMES Webinar Shuang Zhao 64

Bidirectional Path Mutations Basic idea Given a path the vertices l and m satisfies, pick l, m and replace with Image plane Image plane GAMES Webinar Shuang Zhao 65

Path Perturbation Slightly modify the direction x m x m-1 (at random) Trace a ray from x m with this new direction to form the new sub-path Center of projection Image plane Specular interface Diffuse surface GAMES Webinar Shuang Zhao 66

Results BDPT [Veach 1997] MLT (equal-time) GAMES Webinar Shuang Zhao 67

Results BDPT [Veach 1997] MLT (equal-time) GAMES Webinar Shuang Zhao 68

Summary Physics-based rendering is a rich field Things we have covered Light transport model Rendering equation (reflection and refraction) Monte Carlo solutions Path tracing Bidirectional path tracing Metropolis light transport GAMES Webinar Shuang Zhao 69

Topics we have not covered Radiative transfer (sub-surface scattering) Unbiased methods Primary sample space & multiplexed MLT Gradient-domain PT/MLT Biased methods Photon mapping Lightcuts Monte Carlo denoising Diffusion approximations GAMES Webinar Shuang Zhao 70