Monte Carlo Rendering

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

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

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

Monte Carlo 1: Integration

Complex Filtering and Integration via Sampling

Monte Carlo 1: Integration

Motivation. Motivation. Monte Carlo. Example: Soft Shadows. Outline. Monte Carlo Algorithms. Advanced Computer Graphics (Fall 2009)

Monte Carlo Integration

Some Tutorial about the Project. Computer Graphics

Plane Sampling for Light Paths from the Environment Map

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

Topic 13: Radiometry. The Basic Light Transport Path

Computer Graphics. Jeng-Sheng Yeh 葉正聖 Ming Chuan University (modified from Bing-Yu Chen s slides)

Surface Mapping One. CS7GV3 Real-time Rendering

Global Illumination. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/26/07 1

Real-time. Shading of Folded Surfaces

Global Illumination: Radiosity

Physics 132 4/24/17. April 24, 2017 Physics 132 Prof. E. F. Redish. Outline

Global Illumination and Radiosity

Surface Integrators. Digital Image Synthesis Yung-Yu Chuang 12/20/2007

Diffuse and specular interreflections with classical, deterministic ray tracing

Global Illumination and Radiosity

Color in OpenGL Polygonal Shading Light Source in OpenGL Material Properties Normal Vectors Phong model

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

Global Illumination and Radiosity

Lighting. Dr. Scott Schaefer

The Rendering Equation & Monte Carlo Ray Tracing

Computer graphics III Light reflection, BRDF. Jaroslav Křivánek, MFF UK

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

Interactive Rendering of Translucent Objects

Computer Sciences Department

Lecture 5: Probability Distributions. Random Variables

Assignment # 2. Farrukh Jabeen Algorithms 510 Assignment #2 Due Date: June 15, 2009.

Loop Transformations for Parallelism & Locality. Review. Scalar Expansion. Scalar Expansion: Motivation

CS 534: Computer Vision Model Fitting

LECTURE : MANIFOLD LEARNING

Subspace clustering. Clustering. Fundamental to all clustering techniques is the choice of distance measure between data points;

LECTURE NOTES Duality Theory, Sensitivity Analysis, and Parametric Programming

S1 Note. Basis functions.

An Accurate Evaluation of Integrals in Convex and Non convex Polygonal Domain by Twelve Node Quadrilateral Finite Element Method

Form-factors Josef Pelikán CGG MFF UK Praha.

Random Variables and Probability Distributions

Kent State University CS 4/ Design and Analysis of Algorithms. Dept. of Math & Computer Science LECT-16. Dynamic Programming

Biostatistics 615/815

Slide 1 SPH3UW: OPTICS I. Slide 2. Slide 3. Introduction to Mirrors. Light incident on an object

R s s f. m y s. SPH3UW Unit 7.3 Spherical Concave Mirrors Page 1 of 12. Notes

Loop Permutation. Loop Transformations for Parallelism & Locality. Legality of Loop Interchange. Loop Interchange (cont)

Course Introduction. Algorithm 8/31/2017. COSC 320 Advanced Data Structures and Algorithms. COSC 320 Advanced Data Structures and Algorithms

Smoothing Spline ANOVA for variable screening

Scan Conversion & Shading

Scan Conversion & Shading

Fast, Arbitrary BRDF Shading for Low-Frequency Lighting Using Spherical Harmonics

Fitting & Matching. Lecture 4 Prof. Bregler. Slides from: S. Lazebnik, S. Seitz, M. Pollefeys, A. Effros.

2.2 Photometric Image Formation

Technical report, November 2012 (Revision 2, July 2013) Implementing Vertex Connection and Merging

Simulation: Solving Dynamic Models ABE 5646 Week 11 Chapter 2, Spring 2010

Robust Soft Shadow Mapping with Backprojection and Depth Peeling

A Fast Visual Tracking Algorithm Based on Circle Pixels Matching

A MOVING MESH APPROACH FOR SIMULATION BUDGET ALLOCATION ON CONTINUOUS DOMAINS

PBRT core. Announcements. pbrt. pbrt plug-ins

Computation of Ex-Core Detector Weighting Functions for VVER-440 Using MCNP5

Radial Basis Functions

Simulation of a Ship with Partially Filled Tanks Rolling in Waves by Applying Moving Particle Semi-Implicit Method

AP PHYSICS B 2008 SCORING GUIDELINES

Global Illumination and Monte Carlo

Helsinki University Of Technology, Systems Analysis Laboratory Mat Independent research projects in applied mathematics (3 cr)

An Improved Image Segmentation Algorithm Based on the Otsu Method

Multicriteria Decision Making

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

Wishing you all a Total Quality New Year!

AMath 483/583 Lecture 21 May 13, Notes: Notes: Jacobi iteration. Notes: Jacobi with OpenMP coarse grain

Lighting and Shading

FEATURE EXTRACTION. Dr. K.Vijayarekha. Associate Dean School of Electrical and Electronics Engineering SASTRA University, Thanjavur

Robust Soft Shadow Mapping with Depth Peeling

Programming Assignment Six. Semester Calendar. 1D Excel Worksheet Arrays. Review VBA Arrays from Excel. Programming Assignment Six May 2, 2017

Introduction to Radiosity

Very simple computational domains can be discretized using boundary-fitted structured meshes (also called grids)

Outline. Type of Machine Learning. Examples of Application. Unsupervised Learning

Adjustment methods for differential measurement errors in multimode surveys

Smooth Probabilistic Ambient Occlusion for Volume Rendering

An efficient method to build panoramic image mosaics

An Iterative Solution Approach to Process Plant Layout using Mixed Integer Optimisation

X- Chart Using ANOM Approach

Unsupervised Learning

A Binarization Algorithm specialized on Document Images and Photos

Computer Animation and Visualisation. Lecture 4. Rigging / Skinning

Realistic Rendering. Traditional Computer Graphics. Traditional Computer Graphics. Production Pipeline. Appearance in the Real World

REFRACTION. a. To study the refraction of light from plane surfaces. b. To determine the index of refraction for Acrylic and Water.

Some Advanced SPC Tools 1. Cumulative Sum Control (Cusum) Chart For the data shown in Table 9-1, the x chart can be generated.

Refraction Ray Normal

Vanishing Hull. Jinhui Hu, Suya You, Ulrich Neumann University of Southern California {jinhuihu,suyay,

Support Vector Machines

An Improved Stereo Matching Algorithm Based on Guided Image Filter

Programming in Fortran 90 : 2017/2018

Support Vector Machines

Shape Representation Robust to the Sketching Order Using Distance Map and Direction Histogram

Barycentric Coordinates. From: Mean Value Coordinates for Closed Triangular Meshes by Ju et al.

Machine Learning: Algorithms and Applications

Meta-heuristics for Multidimensional Knapsack Problems

Fitting: Deformable contours April 26 th, 2018

Transcription:

Monte Carlo Renderng Last Tme? Modern Graphcs Hardware Cg Programmng Language Gouraud Shadng vs. Phong Normal Interpolaton Bump, Dsplacement, & Envronment Mappng Cg Examples G P R T F P D Today Does Ray Tracng Smulate Physcs? Monte-Carlo Integraton Samplng Advanced Monte-Carlo Renderng Does Ray Tracng Smulate Physcs? No. tradtonal ray tracng s also called backward ray tracng In realty, photons actually travel from the lght to the eye Forward Ray Tracng Start from the lght source But very, very low probablty to reach the eye What can we do about t? Always send a ray to the eye. stll not effcent Transparent Shadows? What to do f the shadow ray sent to the lght source ntersects a transparent object? Pretend t s opaque? Multply by transparency color? (gnores refracton & does not produce caustcs) Unfortunately, ray tracng s full of drty trcks 1

Is ths Tradtonal Ray Tracng? Refracton and the Lfeguard Problem Runnng s faster than swmmng Water Beach Lfeguard Images by Henrk Wann Jensen No, Refracton and complex reflecton for llumnaton are not handled properly n tradtonal (backward) ray tracng Person n trouble Swm Run What makes a Ranbow? Refracton s wavelength-dependent Refracton ncreases as the wavelength of lght decreases volet and blue experence more bendng than orange and red Usually gnored n graphcs Ranbow s caused by refracton + nternal reflecton + refracton The Renderng Equaton Clean mathematcal framework for lghttransport smulaton At each pont, outgong lght n one drecton s the ntegral of ncomng lght n all drectons multpled by reflectance property Pnk Floyd, The Dark Sde of the Moon From Color and Lght n Nature by Lynch and Lvngstone Today Does Ray Tracng Smulate Physcs? Monte-Carlo Integraton Probabltes and Varance Analyss of Monte-Carlo Integraton Samplng Advanced Monte-Carlo Renderng Monte-Carlo Computaton of π Take a random pont (x,y) n unt square Test f t s nsde the ¼ dsc Is x 2 + y 2 < 1? Probablty of beng nsde dsc? area of ¼ unt crcle / area of unt square = π /4 π 4 * number nsde dsc / total number The error depends on the number or trals 2

Convergence & Error Let s compute 0.5 by flppng a con: 1 flp: 0 or 1 average error = 0.5 2 flps: 0, 0.5, 0.5 or 1 average error = 0. 25 4 flps: 0 (*1),0.25 (*4), 0.5 (*6), 0.75(*4), 1(*1) average error = 0.1875 Unfortunately, doublng the number of samples does not double accuracy Another Example: We know t should be 1.0 In practce wth unform samples: error σ 2 - σ 2 N Revew of (Dscrete) Probablty Random varable can take dscrete values x Probablty p for each x 0 < p < 1, Σ p =1 Expected value Expected value of functon of random varable f(x ) s also a random varable Varance & Standard Devaton Varance σ 2 : devaton from expected value Expected value of square dfference Also Standard devaton σ: square root of varance (noton of error, RMS) Monte Carlo Integraton Turn ntegral nto fnte sum Use n random samples As n ncreases Expected value remans the same Varance decreases by n Standard devaton (error) decreases by Thus, converges wth 1 n 1 n Advantages of MC Integraton Few restrctons on the ntegrand Doesn t need to be contnuous, smooth,... Only need to be able to evaluate at a pont Extends to hgh-dmensonal problems Same convergence Conceptually straghtforward Effcent for solvng at just a few ponts 3

Dsadvantages of MC Integraton Nosy Slow convergence Good mplementaton s hard Debuggng code Debuggng math Choosng approprate technques Punctual technque, no noton of smoothness of functon (e.g., between neghborng pxels) Questons? 1 glossy sample per pxel 256 glossy samples per pxel Today Does Ray Tracng Smulate Physcs? Monte-Carlo Integraton Samplng Stratfed Samplng Importance Samplng Advanced Monte-Carlo Renderng Domans of Integraton Pxel, lens (Eucldean 2D doman) Tme (1D) Hemsphere Work needed to ensure unform probablty Example: Lght Source We can ntegrate over surface or over angle But we must be careful to get probabltes and ntegraton measure rght! Samplng the source unformly source Samplng the hemsphere unformly Stratfed Samplng Wth unform samplng, we can get unlucky E.g. all samples n a corner To prevent t, subdvde doman Ω nto non-overlappng regons Ω Each regon s called a stratum Take one random samples per Ω hemsphere 4

Example Borrowed from Henrk Wann Jensen Glossy Renderng Integrate over hemsphere BRDF tmes cosne tmes ncomng lght I ( Unstratfed Stratfed Slde from Jason Lawrence Samplng a BRDF Samplng a BRDF 5 Samples/Pxel 25 Samples/Pxel U( U( P( P( Slde from Jason Lawrence Slde from Jason Lawrence Samplng a BRDF Importance Samplng 75 Samples/Pxel U( P( Choose p wsely to reduce varance p that resembles f Does not change convergence rate (stll sqrt) But decreases the constant Slde from Jason Lawrence bad unform good 5

Results 1200 Samples/Pxel Today Does Ray Tracng Smulate Physcs? Monte-Carlo Integraton Samplng Advanced Monte-Carlo Renderng Tradtonal mportance functon Better mportance by Lawrence et al. Ray Castng Cast a ray from the eye through each pxel Ray Tracng Cast a ray from the eye through each pxel Trace secondary rays (lght, reflecton, refracton) Monte-Carlo Ray Tracng Importance of Samplng the Lght Cast a ray from the eye through each pxel Cast random rays to accumulate radance contrbuton Recurse to solve the Renderng Equaton Should also systematcally sample the prmary lght 1 path per pxel Wthout explct lght samplng Wth explct lght samplng 4 path per pxel 6

Monte Carlo Path Tracng Trace only one secondary ray per recurson But send many prmary rays per pxel (performs antalasng as well) Ray Tracng vs Path Tracng 2 bounces 5 glossy samples 5 shadow samples How many rays cast per pxel? 1man ray + 5 shadow rays + 5 glossy rays + 5x5 shadow rays + 5*5 glossy rays + 5x5x5 shadow rays = 186 rays How many 3 bounce paths can we trace per pxel for the same cost? 186 rays / 8 ray casts per path = ~23 paths Whch wll probably have less error? Results: 10 paths/pxel Results: 100 paths/pxel Readng for Today Veach & Gubas "Optmally Combnng Samplng Technques for Monte Carlo Renderng" SIGGRAPH 95 Samplng senstve to choce of samples less senstve to choce of samples unform samplng (or unform random) dense samplng where functon has greater magntude To optmally combne samples from dfferent dstrbutons, weght more hghly the samples from the locally densest dstrbuton Naïve samplng strategy Optmal samplng strategy all samples weghted equally weghts (wdth) for dense samples are reduced 7

Optmally combnng samplng technques for Monte Carlo renderng Veach & Gubas, SIGGRAPH 1995 Balance heurstc (8 samples / pxel) Readng for Frday 3/28: "Fast Blateral Flterng for the Dsplay of Hgh-Dynamc Range Images", Durand & Dorsey, SIGGRAPH 2002 Before After The Secret: Chosen unformly wthn the cone of drectons subtended by each lght source (4 samples / pxel) Chosen wth probablty proportonal to the BRDF (4 samples / pxel) Power heurstc (8 samples / pxel) Scene contrast s hgh Dsplay contrast s low Contrast reduced Detals preserved Blateral flter 8