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

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

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

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

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

Global Illumination and Monte Carlo

The Rendering Equation & Monte Carlo Ray Tracing

The Rendering Equation and Path Tracing

To Do. Real-Time High Quality Rendering. Motivation for Lecture. 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

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

Global Illumination. COMP 575/770 Spring 2013

Biased Monte Carlo Ray Tracing

Local vs. Global Illumination & Radiosity

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

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

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

Photorealism vs. Non-Photorealism in Computer Graphics

Recent Advances in Monte Carlo Offline Rendering

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

Biased Monte Carlo Ray Tracing:

CS 428: Fall Introduction to. Radiosity. Andrew Nealen, Rutgers, /7/2009 1

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

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

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

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

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

Lecture 18: Primer on Ray Tracing Techniques

Illumination Algorithms

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

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

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

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

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

Computer Graphics. Lecture 13. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura

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

Lecture 7 - Path Tracing

Global Illumination The Game of Light Transport. Jian Huang

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

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

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

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

The Rendering Equation. Computer Graphics CMU /15-662

Today. Anti-aliasing Surface Parametrization Soft Shadows Global Illumination. Exercise 2. Path Tracing Radiosity

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

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

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

Virtual Spherical Lights for Many-Light Rendering of Glossy Scenes

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

Lecture 12: Photon Mapping. Biased Methods

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

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

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

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

Announcements. Written Assignment 2 out (due March 8) Computer Graphics

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

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

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

Other Rendering Techniques CSE 872 Fall Intro You have seen Scanline converter (+z-buffer) Painter s algorithm Radiosity CSE 872 Fall

Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

Ray tracing. EECS 487 March 19,

COMP371 COMPUTER GRAPHICS

Stochastic Path Tracing and Image-based lighting

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

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

Choosing the Right Algorithm & Guiding

Global Illumination and the Rendering Equation

EECS 487: Interactive Computer Graphics

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

Monte Carlo Path Tracing. The Rendering Equation

The Traditional Graphics Pipeline

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

Global Illumination and Radiosity

Review. Stephen J. Guy

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

CS-184: Computer Graphics. Administrative

Scalable many-light methods

CS348B: Image Synthesis

Monte Carlo Integration COS 323

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

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

Lighting and Shading

SOME THEORY BEHIND REAL-TIME RENDERING

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

MITOCW MIT6_172_F10_lec18_300k-mp4

Photon Mapping. Kadi Bouatouch IRISA

Irradiance Caching in Pixar s RenderMan

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

Low Memory Spectral Photon Mapping

Physically Realistic Ray Tracing

COMPUTER GRAPHICS COURSE. LuxRender. Light Transport Foundations

Intro to Ray-Tracing & Ray-Surface Acceleration

Announcement. Lighting and Photometric Stereo. Computer Vision I. Surface Reflectance Models. Lambertian (Diffuse) Surface.

Computer Graphics Global Illumination

Shading and Illumination

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

Sung-Eui Yoon ( 윤성의 )

CSCI 4972/6963 Advanced Computer Graphics Quiz 2 Tuesday April 17, 2007 noon-1:30pm

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

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

Monte Carlo Ray-tracing and Rendering

Transcription:

Schedule Review Session: Tuesday November 18 th, 7:30 pm, Room 2-136 bring lots of questions! MIT 6.837 Monte-Carlo Ray Tracing Quiz 2: Thursday November 20 th, in class (one weeks from today) MIT EECS 6.837, Cutler and Durand 1 MIT EECS 6.837, Cutler and Durand 2 Review of last week? Radiosity Diffuse surfaces Subdivide scene Radiosity assumed constant over a patch Form-factor between patches Geometry and visibility Big Matrix system MIT EECS 6.837, Cutler and Durand 3 MIT EECS 6.837, Cutler and Durand 4 Radiosity Smoothing and other gimmicks Limitations of radiosity Diffuse only for basic method Costly extension to specular Requires meshing Cost of visibility computation If you send rays, why not use ray tracing? Memory consumption vs. time scalability MIT EECS 6.837, Cutler and Durand 5 MIT EECS 6.837, Cutler and Durand 6 1

Why still learn radiosity? Questions? Still used in architecture (Lightscape) Introduction to finite element method Project the problem onto a finite basis of functions In the case of radiosity: piecewise constant Express interaction between elements Get a big matrix system Same as deformable object simulation Pre-computed radiance transfer: same strategy Use finite basis function Precompute lighting as a function of primary sources Use in a simplified version in Max Payne 2 MIT EECS 6.837, Cutler and Durand 7 MIT EECS 6.837, Cutler and Durand 8 Today: Monte Carlo Ray Tracing Probabilistic Soft Shadows Principle of Monte-Carlo Ray Tracing Monte Carlo integration Review of Rendering equation Multiple shadow rays to sample area light source Monte-Carlo ray tracing generalizes this one shadow ray Advanced Monte Carlo Ray Tracing MIT EECS 6.837, Cutler and Durand 9 lots of shadow rays MIT EECS 6.837, Cutler and Durand 10 Ray Casting Cast a ray from the eye through each pixel Ray Tracing Cast a ray from the eye through each pixel Trace secondary rays (light, reflection, refraction) MIT EECS 6.837, Cutler and Durand 11 MIT EECS 6.837, Cutler and Durand 12 2

Monte-Carlo Ray Tracing Cast a ray from the eye through each pixel Cast random rays from the visible point Accumulate radiance contribution Monte-Carlo Ray Tracing Cast a ray from the eye through each pixel Cast random rays from the visible point Recurse MIT EECS 6.837, Cutler and Durand 13 MIT EECS 6.837, Cutler and Durand 14 Monte-Carlo Cast a ray from the eye through each pixel Cast random rays from the visible point Recurse Monte-Carlo Systematically sample primary light MIT EECS 6.837, Cutler and Durand 15 MIT EECS 6.837, Cutler and Durand 16 Results Monte-Carlo Take reflectance into account Multiply incoming radiance by BRDF value MIT EECS 6.837, Cutler and Durand 17 MIT EECS 6.837, Cutler and Durand 18 3

1 sample per pixel 256 samples per pixel MIT EECS 6.837, Cutler and Durand 19 MIT EECS 6.837, Cutler and Durand 20 Monte Carlo Path Tracing Trace only one secondary ray per recursion But send many primary rays per pixel (performs antialiasing as well) Monte Carlo Path tracing traceray Intersect all objects Shade visible object Shade visible object Trace random ray to sample incoming light Shade using brdf MIT EECS 6.837, Cutler and Durand 21 MIT EECS 6.837, Cutler and Durand 22 Vintage path tracing image Convergence speed by Jim Kajiya (1986) Also introduced the rendering equation MIT EECS 6.837, Cutler and Durand 23 MIT EECS 6.837, Cutler and Durand 24 4

Results 10 paths/pixel Results 10 paths/pixel MIT EECS 6.837, Cutler and Durand 25 MIT EECS 6.837, Cutler and Durand 26 Results 100 paths/pixel Why use random numbers? Fixed random sequence We see the structure in the error MIT EECS 6.837, Cutler and Durand 27 MIT EECS 6.837, Cutler and Durand 28 Recap Questions? Send random rays Sample the rendering equation No meshing required, no special storage No limitation On reflectance On geometry Extremely flexible Can be noisy (or slow) MIT EECS 6.837, Cutler and Durand 29 MIT EECS 6.837, Cutler and Durand 30 5

Today: Monte Carlo Ray Tracing Principle of Monte-Carlo Ray Tracing Monte Carlo integration Review of Rendering equation Monte-Carlo computation of π Take a square Take a random point (x,y) in the square Test if it is inside the ¼ disc (x 2 +y 2 < 1) The probability is π /4 Advanced Monte Carlo Ray Tracing y x MIT EECS 6.837, Cutler and Durand 31 MIT EECS 6.837, Cutler and Durand 32 Monte-Carlo computation of π The probability is π /4 Count the inside ratio n = # inside / total # trials π n * 4 The error depends on the number or trials Why not use Simpson integration? Yeah, to compute π, Monte Carlo is not very efficient But convergence is independent of dimension Better to integrate high-dimensional functions For d dimensions, Simpson requires N d domains MIT EECS 6.837, Cutler and Durand 33 MIT EECS 6.837, Cutler and Durand 34 What s the link to ray tracing? Dumbest Monte-Carlo integration Light source is square Occluder is sphere Some pixels have exactly π /4 visibility ;-) one shadow ray Compute 0.5 by flipping a coin 1 flip: 0 or 1=> average error =0.5 2 flips: 0, 0.5, 0.5 or 1 =>average error=0. 25 4 flips: 0 (*1),0.25 (*4), 0.5 (*6), 0.75(*4), 1(*1) => average error =0.1875 lots of shadow rays MIT EECS 6.837, Cutler and Durand 35 Does not converge very fast Doubling the number of samples does not double accuracy MIT EECS 6.837, Cutler and Durand 36 6

Convergence of Monte Carlo integration Variance decrease in 1/n 1 Convergence is n Independent of dimension Monte Carlo integration Want to evaluate b f ( x) dx a Use random variable x i with uniform probability over the domain 1 n f ( x i ) n i= 1 Note that achieving uniform probability can be tough for complex domain (e.g. sphere) MIT EECS 6.837, Cutler and Durand 37 MIT EECS 6.837, Cutler and Durand 38 Monte Carlo integration smarter Want to evaluate b f ( x) dx a Use random variable x i with probability p i n 1 f ( xi ) n 1 p i= i Sampling strategy Sample directions vs. sample light source The whole trick is to choose the x i and p i MIT EECS 6.837, Cutler and Durand 39 Images by Matt Pharr MIT EECS 6.837, Cutler and Durand 40 Sampling strategies Images by Veach and Guibas Monte Carlo recap Turn integral into finite sum Use random samples 1 Convergence n Independent of dimension Very flexible Sampling more the light Sampling more the BRDF MIT EECS 6.837, Cutler and Durand 41 Tweak sampling/probabilities for optimal result A lot of integration and probability theory to get things right MIT EECS 6.837, Cutler and Durand 42 7

What can we integrate? Pixel: antialiasing Light sources: Soft shadows Lens: Depth of field Time: Motion blur BRDF: glossy reflection Hemisphere: indirect lighting Questions? Images by Veach and Guibas MIT EECS 6.837, Cutler and Durand 43 Naïve sampling strategy Optimal sampling strategy MIT EECS 6.837, Cutler and Durand 44 Today: Monte Carlo Ray Tracing Principle of Monte-Carlo Ray Tracing Monte Carlo integration Review of Rendering equation Advanced Monte Carlo Ray Tracing The Rendering Equation ω' x' L(x',ω') = E(x',ω') + ρ x '(ω,ω')l(x,ω)g(x,x')v(x,x') da L (x',ω') is the radiance from a point on a surface in a given direction ω' MIT EECS 6.837, Cutler and Durand 45 MIT EECS 6.837, Cutler and Durand 46 The Rendering Equation The Rendering Equation ω' ω' x' L(x',ω') = E(x',ω') + ρ x '(ω,ω')l(x,ω)g(x,x')v(x,x') da x' L(x',ω') = E(x',ω') + ρ x '(ω,ω')l(x,ω)g(x,x')v(x,x') da E(x',ω') is the emitted radiance from a point: E is non-zero only if x' is emissive (a light source) MIT EECS 6.837, Cutler and Durand 47 Sum the contribution from all of the other surfaces in the scene MIT EECS 6.837, Cutler and Durand 48 8

The Rendering Equation The Rendering Equation ω' x ω ω' x ω x' L(x',ω') = E(x',ω') + ρ x '(ω,ω')l(x,ω)g(x,x')v(x,x') da x' L(x',ω') = E(x',ω') + ρ x '(ω,ω')l(x,ω)g(x,x')v(x,x') da For each x, compute L(x, ω), the radiance at point x in the direction ω (from x to x') MIT EECS 6.837, Cutler and Durand 49 scale the contribution by ρ x' (ω,ω'), the reflectivity (BRDF) of the surface at x' MIT EECS 6.837, Cutler and Durand 50 The Rendering Equation The Rendering Equation ω' x ω ω' x ω For each x, compute V(x,x'), the visibility between x and x': 1 when the surfaces are unobstructed along the direction ω, 0 otherwise x' L(x',ω') = E(x',ω') + ρ x '(ω,ω')l(x,ω)g(x,x')v(x,x') da MIT EECS 6.837, Cutler and Durand 51 x' L(x',ω') = E(x',ω') + ρ x '(ω,ω')l(x,ω)g(x,x')v(x,x') da For each x, compute G(x, x'), which describes the on the geometric relationship between the two surfaces at x and x MIT EECS 6.837, Cutler and Durand 52 Monte Carlo Path Tracing Trace only one secondary ray per recursion But send many primary rays per pixel (performs antialiasing as well) Radiosity vs. Monte Carlo We have an integral equation on an infinite space Finite elements (Radiosity) Project onto finite basis of functions Linear system Monte Carlo Probabilistic sampling MIT EECS 6.837, Cutler and Durand 53 MIT EECS 6.837, Cutler and Durand 54 9

Radiosity vs. Monte Carlo We have an integral equation on an infinite space Finite elements (Radiosity) Project onto finite basis of functions Linear system View-independent (no angular information) Monte Carlo Probabilistic sampling View-dependent (but angular information) References See also Eric Veach s PhD http://graphics.stanford.edu/papers/veach_thesis/ MIT EECS 6.837, Cutler and Durand 55 MIT EECS 6.837, Cutler and Durand 56 Questions? Arnold renderer Today: Monte Carlo Ray Tracing Principle of Monte-Carlo Ray Tracing Monte Carlo integration Review of Rendering equation Advanced Monte Carlo Ray Tracing Irradiance caching Photon mapping MIT EECS 6.837, Cutler and Durand 57 MIT EECS 6.837, Cutler and Durand 58 Path Tracing is costly Direct illumination Needs tons of rays per pixel MIT EECS 6.837, Cutler and Durand 59 MIT EECS 6.837, Cutler and Durand 60 10

Global Illumination Indirect illumination: smooth MIT EECS 6.837, Cutler and Durand 61 MIT EECS 6.837, Cutler and Durand 62 Irradiance cache The indirect illumination is smooth Irradiance cache The indirect illumination is smooth MIT EECS 6.837, Cutler and Durand 63 MIT EECS 6.837, Cutler and Durand 64 Irradiance cache The indirect illumination is smooth Interpolate nearby values Irradiance cache Store the indirect illumination Interpolate existing cached values But do full calculation for direct lighting MIT EECS 6.837, Cutler and Durand 65 MIT EECS 6.837, Cutler and Durand 66 11

Irradiance caching Radiance MIT EECS 6.837, Cutler and Durand 67 MIT EECS 6.837, Cutler and Durand 68 Radiance Radiance MIT EECS 6.837, Cutler and Durand 69 MIT EECS 6.837, Cutler and Durand 70 Radiance Radiance MIT EECS 6.837, Cutler and Durand 71 MIT EECS 6.837, Cutler and Durand 72 12

Photon mapping Preprocess: cast rays from light sources Store photons Photon mapping Preprocess: cast rays from light sources Store photons (position + light power + incoming direction) MIT EECS 6.837, Cutler and Durand 73 MIT EECS 6.837, Cutler and Durand 74 Photon map Efficiently store photons for fast access Use hierarchical spatial structure (kd-tree) Photon mapping - rendering Cast primary rays For secondary rays reconstruct irradiance using adjacent stored photon Take the k closest photons Combine with irradiance caching and a number of other techniques MIT EECS 6.837, Cutler and Durand 75 MIT EECS 6.837, Cutler and Durand 76 Photon map results 500k, use 125 vs use 500 (images by Matt Pharr) MIT EECS 6.837, Cutler and Durand 77 MIT EECS 6.837, Cutler and Durand 78 13

Photon mapping - caustics Special photon map for specular reflection and refraction 1000 paths/pixel Glass sphere MIT EECS 6.837, Cutler and Durand 79 MIT EECS 6.837, Cutler and Durand 80 Photon mapping recap Photon mapping MIT EECS 6.837, Cutler and Durand 81 Preprocess: Path tracing Store photons Special map for caustics (because not as uniform) Rendering Primary rays Direct lighting Indirect lighting Reconstruct irradiance using k nearest photons Irradiance caching Reconstruct caustics from caustic map MIT EECS 6.837, Cutler and Durand 82 Photon mapping Animation by Henrik Wann Jensen Questions? Image by Henrik MIT EECS 6.837, Cutler and Durand 83 MIT EECS 6.837, Cutler and Durand 84 14

Next time: color Why is the sky blue? MIT EECS 6.837, Cutler and Durand 85 MIT EECS 6.837, Cutler and Durand 86 Answer: because sunset is red Raileigh scattering Lord Raileigh: physicist 19 th century Light is scattered by air molecules MIT EECS 6.837, Cutler and Durand 87 MIT EECS 6.837, Cutler and Durand 88 Raileigh scattering Lord Raileigh: physicist 19 th century Light is scattered by air mollecules Scattered more in the blue wavelength Sky color Blue is more scattered MIT EECS 6.837, Cutler and Durand 89 MIT EECS 6.837, Cutler and Durand 90 15

Sun Color At sunset, longer traversal of atmosphere More blue is scattered, red remains Therefore redder Computer graphics sky models E.g. Preetham et al. SIGGRAPH 99. MIT EECS 6.837, Cutler and Durand 91 MIT EECS 6.837, Cutler and Durand 92 Night Sky Model Questions? Jensen, Durand, Stark, Premoze, Dorsey, Shirley 2001 MIT EECS 6.837, Cutler and Durand 93 MIT EECS 6.837, Cutler and Durand 94 16