Biased Monte Carlo Ray Tracing

Similar documents
Biased Monte Carlo Ray Tracing:

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

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

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

Global Illumination using Photon Maps

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

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

Photon Mapping. Michael Doggett Department of Computer Science Lund university

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

Recent Advances in Monte Carlo Offline Rendering

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

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

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

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

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

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

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

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

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

The Rendering Equation and Path Tracing

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

Choosing the Right Algorithm & Guiding

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

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

The Rendering Equation. Computer Graphics CMU /15-662

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

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

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

Lecture 7: Monte Carlo Rendering. MC Advantages

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

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

Photon Mapping. Kadi Bouatouch IRISA

Introduction to Photon Mapping RADIANCE Workshop 2010 Course Advanced Fenestration

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

Lecture 12: Photon Mapping. Biased Methods

Monte Carlo Path Tracing. The Rendering Equation

An introduction to Global Illumination. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Lecture 7 - Path Tracing

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

Assignment 3: Path tracing

Illumination Algorithms

Photon Differentials

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

Low Memory Spectral Photon Mapping

Path differentials and applications

rendering equation computer graphics rendering equation 2009 fabio pellacini 1

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

Spectral Color and Radiometry

Monte Carlo Ray-tracing and Rendering

Global Illumination with Glossy Surfaces

Global Illumination and Monte Carlo

Improved Illumination Estimation for Photon Maps in Architectural Scenes

6. Illumination, Lighting

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

Irradiance Gradients. Media & Occlusions

Reflection models and radiometry Advanced Graphics

Virtual Spherical Lights for Many-Light Rendering of Glossy Scenes

Importance Sampling of Area Lights in Participating Media

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

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

Interactive Rendering of Globally Illuminated Glossy Scenes

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

Global Illumination CS334. Daniel G. Aliaga Department of Computer Science Purdue University

To Do. Advanced Computer Graphics. Course Outline. Course Outline. Illumination Models. Diffuse Interreflection

BRDFs. Steve Rotenberg CSE168: Rendering Algorithms UCSD, Spring 2017

Efficient Simulation of Light Transport in Scenes with Participating Media using Photon Maps

Realistic Image Synthesis

Advanced Graphics. Global Illumination. Alex Benton, University of Cambridge Supported in part by Google UK, Ltd

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

Statistical Acceleration for Animated Global Illumination

Monte Carlo Path Tracing

Ongoing Developments in Photon Mapping

Rendering Light Reflection Models

Global Illumination The Game of Light Transport. Jian Huang

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

SOME THEORY BEHIND REAL-TIME RENDERING

A NEW APPROACH OF DENSITY ESTIMATION FOR GLOBAL ILLUMINATION

rendering equation computer graphics rendering equation 2009 fabio pellacini 1

Greg Ward / SIGGRAPH 2003

Chapter 11. Caustics and Global Illumination

Photon Mapping. Photon Mapping. Why Map Photons? Sources. What is a Photon? Refrac=on of a Caus=c. Jan Kautz

Anti-aliasing. Images and Aliasing

Radiometry, Radiosity and Photon Mapping

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

Photo Studio Optimizer

Introduction to Radiosity

Realistic Image Synthesis

Monte Carlo Integration COS 323

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

A Survey of Radiosity and Ray-tracing. Methods in Global Illumination

The Rendering Equation & Monte Carlo Ray Tracing

CS770/870 Spring 2017 Radiosity

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

Global Illumination. COMP 575/770 Spring 2013

Computer Graphics. Lecture 14 Bump-mapping, Global Illumination (1)

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

Bioluminescence Chris Fontas & Forrest Browning

Surface Integrators. Digital Image Synthesis Yung-Yu Chuang 12/13/2005

Radiometry and reflectance

Transcription:

Biased Monte Carlo Ray Tracing Filtering, Irradiance Caching, and Photon Mapping Henrik Wann Jensen Stanford University May 23, 2002

Unbiased and Consistent Unbiased estimator: E{X} =... Consistent estimator: lim E{X} N...

Unbiased and Consistent Unbiased estimator: 1 N N i=1 f(ξ i ) Consistent estimator: 1 N + 1 N f(ξ i ) i=1

Unbiased Methods Variance (noise) is the only error This error can be analyzed using the variance (i.e. 95% of samples are within 2% of the correct result)

Path Tracing (Unbiased) 10 paths/pixel

Path Tracing (Unbiased) 10 paths/pixel

Path Tracing (Unbiased) 100 paths/pixel

How Can We Remove This Noise

The World is Diffuse! Arnold Rendering

The World is Diffuse! Arnold Rendering

The World is Diffuse! Arnold Rendering

Noise Reduction/Removal More samples (slow convergence, σ 1/ N)

Noise Reduction/Removal More samples (slow convergence, σ 1/ N) Better sampling (stratified, importance, qmc etc.)

Noise Reduction/Removal More samples (slow convergence, σ 1/ N) Better sampling (stratified, importance, qmc etc.) Adaptive sampling

Noise Reduction/Removal More samples (slow convergence, σ 1/ N) Better sampling (stratified, importance, qmc etc.) Adaptive sampling Filtering

Noise Reduction/Removal More samples (slow convergence, σ 1/ N) Better sampling (stratified, importance, qmc etc.) Adaptive sampling Filtering Caching and interpolation

Stratified Sampling Latin Hypercube: 10 paths/pixel

Quasi Monte-Carlo Halton-Sequence: 10 paths/pixel

Fixed (Random) Sequence 10 paths/pixel

Filtering: Idea Noise is high frequency

Filtering: Idea Noise is high frequency Remove high frequency content

Unfiltered Image 10 paths/pixel

3x3 Lowpass Filter 10 paths/pixel

Unfiltered Image 10 paths/pixel

3x3 Median Filter 10 paths/pixel

Energy Preserving Filters

Energy Preserving Filters Distribute noisy energy over several pixels

Energy Preserving Filters Distribute noisy energy over several pixels Adaptive filter width [Rushmeier and Ward 94] Diffusion style filters [McCool99] Splatting style filters [Suykens and Willems 00]

Problems With Filtering Everything is filtered (blurred) Textures Highlights Caustics...

Caching Techniques

Caching Techniques Irradiance caching : Compute irradiance at selected points and interpolate. Photon mapping : Trace ``photons'' from the lights and store them in a photon map, that can be used during rendering.

Box: Direct Illlumination

Box: Global Illlumination

Box: Indirect Irradiance

Irradiance Caching: Idea ``A Ray Tracing Solution for Diffuse Interreflection''. Greg Ward, Francis Rubinstein and Robert Clear: Proc. SIGGRAPH'88. Idea: Irradiance changes slowly interpolate.

Irradiance Sampling E(x) = 2π L (x, ω ) cos θ dω

Irradiance Sampling E(x) = = L (x, ω ) cos θ dω 2π 2π π/2 0 0 L (x, θ, φ) cos θ sin θ dθ dφ

Irradiance Sampling E(x) = = 0 L (x, ω ) cos θ dω 2π 2π π/2 π T P 0 T t=1 L (x, θ, φ) cos θ sin θ dθ dφ P p=1 L (θ t, φ p ) θ t = sin 1 ( ) t ξ T and φ p = 2π p ψ P

Irradiance Change ɛ(x) E x (x x 0) + E θ (θ θ 0) } {{ } } {{ } position rotation

Irradiance Change ɛ(x) E x (x x 0) + E θ (θ θ 0) } {{ } } {{ } position rotation ( ) 4 x x 0 E 0 + 2 2N(x) π x N(x 0 ) avg } {{ } } {{ } position rotation

Irradiance Interpolation w(x) = 1 ɛ(x) 1 x x 0 1 N(x) N(x 0 ) x avg + E i (x) = i w i (x)e(x i ) w i (x) i

Irradiance Caching Algorithm Find all irradiance samples with w(x) > q if (samples found) interpolate else compute new irradiance sample

Box: Irradiance Caching 1000 sample rays, w>10

Box: Irradiance Cache Positions 1000 sample rays, w>10

Box: Irradiance Caching 1000 sample rays, w>20

Box: Irradiance Cache Positions 1000 sample rays, w>20

Box: Irradiance Caching 5000 sample rays, w>10

Box: Irradiance Cache Positions 5000 sample rays, w>10

Caustics Pathtracing 1000 paths/pixel

A simple test scene

Rendering

Photon Tracing

Photons

Radiance Estimate L(x, ω) = Ω f r (x, ω, ω)l (x, ω ) cos θ dω

Radiance Estimate L(x, ω) = = Ω Ω f r (x, ω, ω)l (x, ω ) cos θ dω f r (x, ω, ω) dφ2 (x, ω ) dω cos θ da cos θ dω

Radiance Estimate L(x, ω) = = = Ω Ω Ω f r (x, ω, ω)l (x, ω ) cos θ dω f r (x, ω, ω) dφ2 (x, ω ) dω cos θ da cos θ dω f r (x, ω, ω) dφ2 (x, ω ) da

Radiance Estimate L(x, ω) = = = f r (x, ω, ω)l (x, ω ) cos θ dω Ω f r (x, ω, ω) dφ2 (x, ω ) Ω dω cos θ da cos θ dω f r (x, ω, ω) dφ2 (x, ω ) Ω da n f r (x, ω p, ω) Φ p(x, ω p) πr 2 p=1

Radiance Estimate L

The photon map datastructure The photons are stored in a left balanced kd-tree struct photon = { float position[3]; rgbe power; char phi, theta; short flags; } // power packed as 4 bytes // incoming direction

Rendering: Caustics

Caustic from a Glass Sphere Photon Mapping: 10000 photons / 50 photons in radiance estimate

Caustic from a Glass Sphere Path Tracing: 1000 paths/pixel

Sphereflake Caustic

Reflection Inside A Metal Ring 50000 photons / 50 photons in radiance estimate

Caustics On Glossy Surfaces 340000 photons / 100 photons in radiance estimate

HDR environment illumination Using lightprobe from www.debevec.org

Cognac Glass

Cube Caustic

Global Illumination 100000 photons / 50 photons in radiance estimate

Global Illumination 500000 photons / 500 photons in radiance estimate

Fast estimate 200 photons / 50 photons in radiance estimate

Indirect illumination 10000 photons / 500 photons in radiance estimate

Global Illumination

Global Illumination global photon map caustics photon map

Photon tracing Photon emission Photon scattering Photon storing

Photon emission Given Φ Watt lightbulb. Emit N photons. Each photon has the power Φ N Watt. Photon power depends on the number of emitted photons. Not on the number of photons in the photon map.

What is a photon? Flux (power) - not radiance! Collection of physical photons A fraction of the light source power Several wavelengths combined into one entity

Diffuse point light Generate random direction Emit photon in that direction // Find random direction do { x = 2.0*random()-1.0; y = 2.0*random()-1.0; z = 2.0*random()-1.0; } while ( (x*x + y*y + z*z) > 1.0 );

Example: Diffuse square light - Generate random position p on square - Generate diffuse direction d - Emit photon from p in direction d // Generate diffuse direction u = random(); v = 2*π*random(); d = vector( cos(v) u, sin(v) u, 1 u );

Surface interactions The photon is Stored (at diffuse surfaces) and Absorbed (A) or Reflected (R) or Transmitted (T ) A + R + T = 1.0

Photon scattering The simple way: Given incoming photon with power Φ p Reflect photon with the power R Φ p Transmit photon with the power T Φ p

Photon scattering The simple way: Given incoming photon with power Φ p Reflect photon with the power R Φ p Transmit photon with the power T Φ p Risk: Too many low-powered photons - wasteful! When do we stop (systematic bias)? Photons with similar power is a good thing.

Russian Roulette Statistical technique Known from Monte Carlo particle physics Introduced to graphics by Arvo and Kirk in 1990

Russian Roulette Probability of termination: p

Russian Roulette Probability of termination: p E{X}

Russian Roulette Probability of termination: p E{X} = p 0

Russian Roulette Probability of termination: p E{X} = p 0 + (1 p)

Russian Roulette Probability of termination: p E{X} = p 0 + (1 p) E{X} 1 p

Russian Roulette Probability of termination: p E{X} = p 0 + (1 p) E{X} 1 p = E{X}

Russian Roulette Probability of termination: p E{X} = p 0 + (1 p) E{X} 1 p = E{X} Terminate un-important photons and still get the correct result.

Russian Roulette Example Surface reflectance: R = 0.5 Incoming photon: Φ p = 2 W r = random(); if ( r < 0.5 ) reflect photon with power 2 W else photon is absorbed

Russian Roulette Intuition Surface reflectance: R = 0.5 200 incoming photons with power: Φ p = 2 Watt Reflect 100 photons with power 2 Watt instead of 200 photons with power 1 Watt.

Russian Roulette Very important! Use to eliminate un-important photons Gives photons with similar power :)

Sampling a BRDF f r (x, ω i, ω o ) = w 1 f r,1 (x, ω i, ω o ) + w 2 f r,2 (x, ω i, ω o )

Sampling a BRDF f r (x, ω i, ω o ) = w 1 f r,d + w 2 f r,s r = random() (w 1 + w 2 ); if ( r < w 1 ) reflect diffuse photon else reflect specular

Rendering

Direct Illumination

Specular Reflection

Caustics

Indirect Illumination

Rendering Equation Solution L r (x, ω) = = f r (x, ω, ω)l i (x, ω ) cos θ i dω i Ω x Ω x f r (x, ω, ω)l i,l (x, ω ) cos θ i dω i + Ω x f r,s (x, ω, ω)(l i,c (x, ω ) + L i,d (x, ω )) cos θ i dω i + Ω x f r,d (x, ω, ω)l i,c (x, ω ) cos θ i dω i + Ω x f r,d (x, ω, ω)l i,d (x, ω ) cos θ i dω i.

Features Photon tracing is unbiased Radiance estimate is biased but consistent The reconstruction error is local Illumination representation is decoupled from the geometry

Box 200000 global photons, 50000 caustic photons

Box: Global Photons 200000 global photons

Fractal Box 200000 global photons, 50000 caustic photons

Cornell Box

Indirect Illumination

Little Matterhorn

Mies house (swimmingpool)

Mies house (3pm)

Mies house (6pm)

More Information Foreword by Pat Hanrahan The creation of realistic three-dimensional images is central to computer graphics. Photon mapping, an extension of ray tracing, makes it possible to efficiently simulate global illumination in complex scenes. Photo mapping can simulate caustics (focused light, such as shimmering waves at the bottom of a swimming pool), diffuse inter-reflections (e.g., the `bleeding' of colored light from a red wall onto a white floor, giving the floor a reddish tint), and participating media (e.g., clouds or smoke). This book is a practical guide to photon mapping; it provides both the theory and the practical insight necessary to implement photon mapping and simulate all types of direct and indirect illumination efficiently. A K PETERS LTD. Realistic Image Synthesis Using Photon Mapping Realistic Image Synthesis Using Photon Mapping Jensen Henrik Wann Jensen AK PETERS Henrik Wann Jensen Realistic Image Synthesis Using Photon Mapping Foreword by Pat Hanrahan http://graphics.stanford.edu/~henrik henrik@graphics.stanford.edu