DOC PREVIEW
Berkeley COMPSCI 294 - Lecture Notes

This preview shows page 1-2-3 out of 8 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Advanced Computer Graphics Advanced Computer Graphics (Fall 2009)(Fall 2009)CS 294, Rendering Lecture 5: Monte Carlo Path Tracing Ravi Ramamoorthihttp://inst.eecs.berkeley.edu/~cs294-13/fa09Acknowledgements and some slides: Szymon Rusinkiewicz and Pat HanrahanTo DoTo Do Start working on assignment Find partners for this purposeMotivationMotivation General solution to rendering and global illumination Suitable for a variety of general scenes Based on Monte Carlo methods Enumerate all paths of light transportMonte Carlo Path TracingMonte Carlo Path TracingBig diffuse light source, 20 minutesBig diffuse light source, 20 minutesJensenJensenMonte Carlo Path TracingMonte Carlo Path Tracing1000 paths/pixel1000 paths/pixelJensenJensenMonte Carlo Path TracingMonte Carlo Path TracingAdvantages Any type of geometry (procedural, curved, ...) Any type of BRDF (specular, glossy, diffuse, ...) Samples all types of paths (L(SD)*E) Accuracy controlled at pixel level Low memory consumption Unbiased - error appears as noise in final imageDisadvantages (standard Monte Carlo problems) Slow convergence (square root of number of samples) Noise in final image2Monte Carlo Path TracingMonte Carlo Path TracingIntegrate radiance for each pixel by sampling pathsrandomlyDiffuse SurfaceDiffuse SurfaceEyeEyeLightLightxxSpecularSpecularSurfaceSurfacePixelPixelwdnw)w(x,Lwwxf)w(x,L)w(x,Lireo)(),,( -wdnw)w(x,Lwwxf)w(x,L)w(x,Lireo)(),,( -Simple Monte Carlo Path TracerSimple Monte Carlo Path Tracer Step 1: Choose a ray (u,v,,) [per pixel]; assign weight = 1 Step 2: Trace ray to find intersection with nearest surface Step 3: Randomly choose between emitted and reflected light Step 3a: If emitted,return weight’ * Le Step 3b: If reflected,weight’’ *= reflectanceGenerate ray in random directionGo to step 2Sampling TechniquesSampling TechniquesProblem: how do we generate random points/directions during path tracing and reduce variance? Importance sampling (e.g. by BRDF) Stratified samplingSurfaceSurfaceEyeEyexxOutlineOutline Motivation and Basic Idea Implementation of simple path tracer Variance Reduction: Importance sampling  Other variance reduction methods Specific 2D sampling techniques Simplest Monte Carlo Path TracerSimplest Monte Carlo Path TracerFor each pixel, cast n samples and average Choose a ray with p=camera, d=(,) within pixel Pixel color += (1/n) * TracePath(p, d)TracePath(p, d) returns (r,g,b) [and calls itself recursively]: Trace ray (p, d) to find nearest intersection p’ Select with probability (say) 50%: Emitted:return 2 * (Lered, Legreen, Leblue) // 2 = 1/(50%) Reflected:generate ray in random direction d’return 2 * fr(d d’) * (nd’) * TracePath(p’, d’)Simplest Monte Carlo Path TracerSimplest Monte Carlo Path TracerFor each pixel, cast n samples and average over paths Choose a ray with p=camera, d=(,) within pixel Pixel color += (1/n) * TracePath(p, d)TracePath(p, d) returns (r,g,b) [and calls itself recursively]: Trace ray (p, d) to find nearest intersection p’ Select with probability (say) 50%: Emitted:return 2 * (Lered, Legreen, Leblue) // 2 = 1/(50%) Reflected:generate ray in random direction d’return 2 * fr(d d’) * (nd’) * TracePath(p’, d’)3Simplest Monte Carlo Path TracerSimplest Monte Carlo Path TracerFor each pixel, cast n samples and average Choose a ray with p=camera, d=(,) within pixel Pixel color += (1/n) * TracePath(p, d)TracePath(p, d) returns (r,g,b) [and calls itself recursively]: Trace ray (p, d) to find nearest intersection p’ Select with probability (say) 50%: Emitted:return 2 * (Lered, Legreen, Leblue) // 2 = 1/(50%) Reflected:generate ray in random direction d’return 2 * fr(d d’) * (nd’) * TracePath(p’, d’)Weight = 1/probabilityRemember: unbiased requires having f(x) / p(x)Simplest Monte Carlo Path TracerSimplest Monte Carlo Path TracerFor each pixel, cast n samples and average Choose a ray with p=camera, d=(,) within pixel Pixel color += (1/n) * TracePath(p, d)TracePath(p, d) returns (r,g,b) [and calls itself recursively]: Trace ray (p, d) to find nearest intersection p’ Select with probability (say) 50%: Emitted:return 2 * (Lered, Legreen, Leblue) // 2 = 1/(50%) Reflected:generate ray in random direction d’return 2 * fr(d d’) * (nd’) * TracePath(p’, d’)Path terminated when Emission evaluatedArnold Renderer (M. Arnold Renderer (M. FajardoFajardo)) Works well diffuse surfaces, hemispherical lightAdvantages and DrawbacksAdvantages and Drawbacks Advantage: general scenes, reflectance, so on By contrast, standard recursive ray tracing only mirrors This algorithm is unbiased, but horribly inefficient Sample “emitted” 50% of the time, even if emitted=0 Reflect rays in random directions, even if mirror If light source is small, rarely hit it Goal: improve efficiency without introducing bias Variance reduction using many of the methods discussed for Monte Carlo integration last week Subject of much interest in graphics in 90s till todayOutlineOutline Motivation and Basic Idea Implementation of simple path tracer Variance Reduction: Importance sampling Other variance reduction methods Specific 2D sampling techniques4Importance SamplingImportance Sampling Pick paths based on energy or expected contribution More samples for high-energy paths Don’t pick low-energy paths At “macro” level, use to select between reflected vsemitted, or in casting more rays toward light sources At “micro” level, importance sample the BRDF to pick ray directions Tons of papers in 90s on tricks to reduce variance in Monte Carlo renderingImportance SamplingImportance SamplingCan pick paths however we want, but contribution weighted by 1/probability Already seen this division of 1/prob in weights to emission, reflectance)()(1)(1iiiNiixpxfYYNdxxf)()(1)(1iiiNiixpxfYYNdxxfxx11xxNNE(f(x))E(f(x))Simplest Monte Carlo Path TracerSimplest Monte Carlo Path TracerFor each pixel, cast n samples and average Choose a ray with p=camera, d=(,) within pixel Pixel color += (1/n) * TracePath(p, d)TracePath(p, d) returns (r,g,b) [and


View Full Document

Berkeley COMPSCI 294 - Lecture Notes

Documents in this Course
"Woo" MAC

"Woo" MAC

11 pages

Pangaea

Pangaea

14 pages

Load more
Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?