Rendering Equation & Monte Carlo Path Tracing I

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

Radiometry & BRDFs CS295, Spring 2017 Shuang Zhao

Bidirectional Path Tracing

Metropolis Light Transport

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

The Rendering Equation and Path Tracing

Lecture 7: Monte Carlo Rendering. MC Advantages

Lecture 12: Photon Mapping. Biased Methods

Global Illumination The Game of Light Transport. Jian Huang

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

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

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

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

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

Rendering Algorithms: Real-time indirect illumination. Spring 2010 Matthias Zwicker

Lecture 7 - Path Tracing

INFOMAGR Advanced Graphics. Jacco Bikker - February April Welcome!

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

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

Stochastic Path Tracing and Image-based lighting

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

The Rendering Equation. Computer Graphics CMU /15-662

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

Monte Carlo Path Tracing. The Rendering Equation

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

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

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

CS-184: Computer Graphics. Today. Lecture 22: Radiometry! James O Brien University of California, Berkeley! V2014-S

Monte Carlo Integration of The Rendering Equation. Computer Graphics CMU /15-662, Spring 2017

Assignment 3: Path tracing

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

Monte Carlo Integration

INTERACTIVE GLOBAL ILLUMINATION WITH VIRTUAL LIGHT SOURCES

CS 563 Advanced Topics in Computer Graphics Irradiance Caching and Particle Tracing. by Stephen Kazmierczak

782 Schedule & Notes

Numerical Integration

Importance Sampling of Area Lights in Participating Media

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

Monte Carlo Integration

Choosing the Right Algorithm & Guiding

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

13 Distribution Ray Tracing

Overview. Radiometry and Photometry. Foundations of Computer Graphics (Spring 2012)

Paths, diffuse interreflections, caching and radiometry. D.A. Forsyth

CS770/870 Spring 2017 Radiosity

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

Radiance. Radiance properties. Radiance properties. Computer Graphics (Fall 2008)

Virtual Spherical Lights for Many-Light Rendering of Glossy Scenes

Biased Monte Carlo Ray Tracing

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

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

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

MONTE-CARLO PATH TRACING

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

rendering equation computer graphics rendering equation 2009 fabio pellacini 1

MULTI-DIMENSIONAL MONTE CARLO INTEGRATION

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

Radiometry and reflectance

Illumination Algorithms

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

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

COMPUTER GRAPHICS COURSE. LuxRender. Light Transport Foundations

Realistic Camera Model

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

Biased Monte Carlo Ray Tracing:

Photometric Stereo.

Realistic Image Synthesis

A Survey of Modelling and Rendering of the Earth s Atmosphere

Measuring Light: Radiometry and Cameras

GEOG 4110/5100 Advanced Remote Sensing Lecture 2

Lighting - the Radiance Equation

SOME THEORY BEHIND REAL-TIME RENDERING

Photon Mapping. Michael Doggett Department of Computer Science Lund university

Global Illumination and the Rendering Equation

Multiple scattering. Steve Marschner Cornell CS 6630 Fall 2009

Introduction to Radiosity

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

Parallel Monte Carlo Sampling Scheme for Sphere and Hemisphere

Interactive Methods in Scientific Visualization

Radiometry. Computer Graphics CMU /15-662, Fall 2015

Photon Mapping. Due: 3/24/05, 11:59 PM

CS184 LECTURE RADIOMETRY. Kevin Wu November 10, Material HEAVILY adapted from James O'Brien, Brandon Wang, Fu-Chung Huang, and Aayush Dawra

CS770/870 Spring 2017 Radiosity

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

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

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

Introduction to Photon Mapping RADIANCE Workshop 2010 Course Advanced Fenestration

Computer graphics III Path tracing. Jaroslav Křivánek, MFF UK

Rendering. Mike Bailey. Rendering.pptx. The Rendering Equation

The Light Field. Last lecture: Radiometry and photometry

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

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

Today. Participating media. Participating media. Rendering Algorithms: Participating Media and. Subsurface scattering

Spectral Color and Radiometry

Rendering. Generate an image from geometric primitives II. Rendering III. Modeling IV. Animation. (Michael Bostock, CS426, Fall99)

rendering equation computer graphics rendering equation 2009 fabio pellacini 1

Recent Advances in Monte Carlo Offline Rendering

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

The Rendering Equation & Monte Carlo Ray Tracing

Transcription:

Rendering Equation & Monte Carlo Path Tracing I CS295, Spring 2017 Shuang Zhao Computer Science Department University of California, Irvine CS295, Spring 2017 Shuang Zhao 1

Announcements Homework 1 due tonight! Programming Assignment 1 is out and will be due in 1.5 weeks on May 2 CS295, Spring 2017 Shuang Zhao 2

Previous Lectures The behavior of light Radiometry Monte Caro integration General framework Sampling from PDFs CS295, Spring 2017 Shuang Zhao 3

Today s Lecture Rendering equation Describe the distribution of light at equilibrium Monte Carlo Path Tracing I An unbiased numerical solution to the rendering equation CS295, Spring 2017 Shuang Zhao 4

The Rendering Equation CS295: Realistic Image Synthesis Rendering Equation & Monte Carlo Path Tracing I CS295, Spring 2017 Shuang Zhao 5

Recap: Radiometry Measurement of light energy Radiometric quantities Energy Power (radiant flux) Irradiance & radiosity Radiance CS295, Spring 2017 Shuang Zhao 6

Light Transport Goal Describe steady-state radiance distribution in virtual scenes Assumptions Geometric optics Achieves steady state instantaneously CS295, Spring 2017 Shuang Zhao 7

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 CS295, Spring 2017 Shuang Zhao 8

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) CS295, Spring 2017 Shuang Zhao 9

Rendering Equation (RE) = + = + CS295, Spring 2017 Shuang Zhao 10

Rendering Equation Incoming radiance CS295, Spring 2017 Shuang Zhao 11

Rendering Equation (Invariant of radiance along lines) CS295, Spring 2017 Shuang Zhao 12

Monte Carlo Path Tracing I CS295: Realistic Image Synthesis Rendering Equation & Monte Carlo Path Tracing I CS295, Spring 2017 Shuang Zhao 13

Path Tracing (Version 0) Estimating L r using MC integration: Draw ω i uniformly at random p(ω i ) = 1/(2π) CS295, Spring 2017 Shuang Zhao 14

Path Tracing (Version 0) radiance(x, ω): return emittedradiance(x, ω) + reflectedradiance(x, ω) reflectedradiance(x, ω): ω i = uniformrandom(n x ) y = RayTrace(x, ω i ) return 2.0 * π * radiance(y, -ω i ) * brdf(x, ω i, ω) * dot(n x, ω i ) CS295, Spring 2017 Shuang Zhao 15

uniformrandom uniformrandom(n): z = rand() r = sqrt(1.0 - z * z) φ = 2.0 * π * rand() x = r * cos(φ) y = r * sin(φ) [u, v, w] = createlocalcoord(n) return x * u + y * v + z * w [x, y, z] distributes uniformly on the hemisphere around [0, 0, 1] createlocalcoord(n) returns a local (orthogonal) coordinate system around n CS295, Spring 2017 Shuang Zhao 16

Path Tracing (Version 0.1) Estimating L r using MC integration: Randomly sample ω i using a probability density proportional to i.e., CS295, Spring 2017 Shuang Zhao 17

Path Tracing (Version 0.1) Estimating L r using MC integration: CS295, Spring 2017 Shuang Zhao 18

Path Tracing (Version 0.1) radiance(x, ω): return emittedradiance(x, ω) + reflectedradiance(x, ω) reflectedradiance(x, ω): ω i = uniformrandompsa(n x ) y = RayTrace(x, ω i ) return π * radiance(y, -ω i ) * brdf(x, ω i, ω) CS295, Spring 2017 Shuang Zhao 19

uniformrandompsa uniformrandompsa(n): z = sqrt(rand()) r = sqrt(1.0 - z * z) φ = 2.0 * π * rand() x = r * cos(φ) y = r * sin(φ) [u, v, w] = createlocalcoord(n) return x * u + y * v + z * w [x, y] distributes uniformly on a unit disc centered at [0, 0] createlocalcoord(n) returns a local (orthogonal) coordinate system around n CS295, Spring 2017 Shuang Zhao 20

Path Tracing (Version 0.1) radiance(x, ω): return emittedradiance(x, ω) + reflectedradiance(x, ω) reflectedradiance(x, ω): ω i = uniformrandompsa(n x ) y = RayTrace(x, ω i ) return π * radiance(y, -ω i ) * brdf(x, ω i, ω) CS295, Spring 2017 Shuang Zhao 21

Path Tracing (Version 0.1) radiance(x, ω): rad = emittedradiance(x, ω) ω i = uniformrandompsa(n x ) y = RayTrace(x, ω i ) rad += π * radiance(y, -ω i ) * brdf(x, ω i, ω) return rad CS295, Spring 2017 Shuang Zhao 22

Path Tracing (Version 0.1) Light source CS295, Spring 2017 Shuang Zhao 23

Path Tracing (Version 0.1) Light source CS295, Spring 2017 Shuang Zhao 24

Path Tracing (Version 0.5) Monte Carlo Path Tracing I CS295, Spring 2017 Shuang Zhao 25

Path Tracing (Version 0.1) radiance(x, ω): rad = emittedradiance(x, ω) ω i = uniformrandompsa(n x ) y = RayTrace(x, ω i ) rad += π * radiance(y, -ω i ) * brdf(x, ω i, ω) return rad Problem: infinite recursion! CS295, Spring 2017 Shuang Zhao 26

Avoid Infinite Recursion Idea 1: bounding the depth radiance(x, ω, depth): if depth > maxdepth: return 0.0 rad = emittedradiance(x, ω) ω i = uniformrandompsa(n x ) y = RayTrace(x, ω i ) rad += π * radiance(y, -ω i, depth + 1) * brdf(x, ω i, ω) return rad Problem: biased CS295, Spring 2017 Shuang Zhao 27

Avoid Infinite Recursion Idea 2: Russian roulette Pick survival probability, a constant within (0, 1) radiance(x, ω): rad = emittedradiance(x, ω) if rand() < survivalprobability: ω i = uniformrandompsa(n x ) y = RayTrace(x, ω i ) rad += π * radiance(y, -ω i ) * brdf(x, ω i, ω) / survivalprobability return rad Why does this work? CS295, Spring 2017 Shuang Zhao 28

Russian Roulette For any random variable X, let for some 0 < p < 1, then Pros: estimators of Y will always terminate Cons: increased variance (noise) CS295, Spring 2017 Shuang Zhao 29

Path Tracing (Version 0.5) radiance(x, ω, depth): rad = emittedradiance(x, ω) if depth <= rrdepth: p = 1.0 else: p = survivalprobability if rand() < p: ω i = uniformrandompsa(n x ) y = RayTrace(x, ω i ) rad += π * radiance(y, -ω i, depth + 1) * brdf(x, ω i, ω) / p return rad CS295, Spring 2017 Shuang Zhao 30

Path Tracing (Version 1.0) Monte Carlo Path Tracing I CS295, Spring 2017 Shuang Zhao 31

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 CS295, Spring 2017 Shuang Zhao 32

Idea: Separating Direct & Indirect Indirect Direct CS295, Spring 2017 Shuang Zhao 33

Idea: Separating Direct & Indirect radiance(x, ω, depth): return emittedradiance(x, ω) + reflectedradiance(x, ω, depth) reflectedradiance(x, ω, depth): return directradiance(x, ω) + indirectradiance(x, ω, depth) CS295, Spring 2017 Shuang Zhao 34

Direct Radiance Direct CS295, Spring 2017 Shuang Zhao 35

Indirect Radiance Indirect CS295, Spring 2017 Shuang Zhao 36

Summary: Direct + Indirect L = L e + L r This idea is usually called next-event estimation (more on this later) CS295, Spring 2017 Shuang Zhao 37

Estimating Indirect Radiance Almost identical to our reflected radiance estimator version 0.5 indirectradiance(x, ω, depth): if depth <= rrdepth: p = 1.0 else: p = survivalprobability if rand() < p: ω i = uniformrandompsa(n x ) y = RayTrace(x, ω i ) return π * reflectedradiance(y, -ω i, depth + 1) * brdf(x, ω i, ω) / p else: return 0.0 CS295, Spring 2017 Shuang Zhao 38

Estimating Direct Radiance Idea: sampling the light source Solid angle integral area integral Change of measure CS295, Spring 2017 Shuang Zhao 39

Area Integral A e : surfaces of all light sources V(x, y): visibility term describing if x and y are mutually visible (visible) (occluded) CS295, Spring 2017 Shuang Zhao 40

Area Estimator Sample y uniformly from A e p(y) = 1/S e S e denotes the surface area of A e E.g., for one spherical light source with radius r, S e = 4πr 2 CS295, Spring 2017 Shuang Zhao 41

Estimating Direct Radiance directradiance(x, ω): [y, pdf] = luminairesample() ω i = normalize(y - x) r 2 = dot(y - x, y - x) return emittedradiance(y, -ω i ) * brdf(x, ω i, ω) * visibility(x, y) * dot(n x, ω i ) * dot(n y, -ω i ) / (r 2 * pdf) CS295, Spring 2017 Shuang Zhao 42

Path Tracing (Version 1.0) reflectedradiance(x, ω, depth): return directradiance(x, ω) + indirectradiance(x, ω, depth) directradiance(x, ω): [y, pdf] = luminairesample() ω i = normalize(y - x) r 2 = dot(y - x, y - x) return emittedradiance(y, -ω i ) * brdf(x, ω i, ω) * visibility(x, y) * dot(n x, ω i ) * dot(n y, -ω i ) / (r 2 * pdf) indirectradiance(x, ω, depth): if depth <= rrdepth: p = 1.0 else: p = survivalprobability if rand() < p: ω i = uniformrandompsa(n x ) y = RayTrace(x, ω i ) return π * reflectedradiance(y, -ω i, depth + 1) * brdf(x, ω i, ω) / p else: return 0.0 CS295, Spring 2017 Shuang Zhao 43

Path Tracing (Version 1.0) reflectedradiance(x, ω, depth): [y 1, pdf] = luminairesample() ω 1 = normalize(y 1 - x) r 2 = dot(y 1 - x, y 1 - x) reflrad = emittedradiance(y 1, -ω 1 ) * brdf(x, ω 1, ω) * visibility(x, y 1 ) * dot(n x, ω 1 ) * dot(n y, -ω 1 ) / (r 2 * pdf) if depth <= rrdepth: p = 1.0 else: p = survivalprobability if rand() < p: ω 2 = uniformrandompsa(n x ) y 2 = RayTrace(x, ω 2 ) reflrad += π * reflectedradiance(y 2, -ω 2, depth + 1) * brdf(x, ω 2, ω) / p return reflrad CS295, Spring 2017 Shuang Zhao 44

Equal-Sample Comparison (Both at 64 sample paths per pixel) Path tracing version 0.5 Path tracing version 1.0 CS295, Spring 2017 Shuang Zhao 45

Next Lecture Monte Carlo Path Tracing II CS295, Spring 2017 Shuang Zhao 46