DOC PREVIEW
UCSD CSE 168 - Global Illumination

This preview shows page 1-2-3-4-5-6-43-44-45-46-47-48-87-88-89-90-91-92 out of 92 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 92 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 92 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 92 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 92 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 92 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 92 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 92 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 92 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 92 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 92 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 92 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 92 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 92 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 92 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 92 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 92 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 92 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 92 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 92 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CSE 168Global IlluminationWojciech JaroszMay 3, 2006Outline•What is Indirect/Global Illumination•The Rendering Equation•Monte Carlo recap•Computing the Rendering Equation•Path Tracing•AntialiasingWhich is the photograph?http://www.graphics.cornell.edu/online/box/compare.htmlDirect IlluminationWhat’s missing?Direct + Indirect Illum.Direct IlluminationComparisonRealSimulatedComputing Indirect Illum.Computing Indirect Illum.Computing Indirect Illum.Computing Indirect Illum.Computing Indirect Illum.Computing Indirect Illum.Direct IlluminationDirect + Indirect Illum.Indirect IlluminationThe Rendering EquationHemispherical formulationLr(x, !ωo) =!Ωfr(x, !ωo, !ωi)L(x, !ωi)(!ωi· !n) d!ωiL(x, !ωo) = Le(x, !ωo) + Lr(x, !ωo)L(x, !ωo) = Le(x, !ωo) +!Ωfr(x, !ωo, !ωi)L(x, !ωi)(!ωi· !n) d!ωiRendering vs. Reflection EqLo(x, !ωo) =!Ωfr(x, !ωo, !ωi)Li(x, !ωi)(!ωi· !n) d!ωiL(x, !ωo) = Le(x, !ωo) +!Ωfr(x, !ωo, !ωi)L(x, !ωi)(!ωi· !n) d!ωiReflection Equation:Rendering Equation:The Rendering EquationConverting to surface formulationd!ω(x) =dA!cos ϕ!x!− x!2cos ϕ ="n!· (x − x!)"x!− x"Recall that we can convert an integral over the hemisphere into one over discrete surfaces using:where:The Rendering EquationSurface formulationLr(x, !ωo) =!Sfr(x, !ωo, !ωi)L(x, !ωi)V (x, x!)cos ϕ cos θ!x!− x!2dA!L(x, !ωo) = Le(x, !ωo) + Lr(x, !ωo)The Rendering Equation•The hemispherical and surface formulations are equivalent.•Sometimes it may be more convenient to use one form over the other.•Last time we covered how to compute lighting from an area light source using the surface formulation.•Today we focus on the hemispherical form.What is Lr?Lr(x, !ωo) =!Ωfr(x, !ωo, !ωi)L(x, !ωi)(!ωi· !n) d!ωiWhat is Lr?Nearly impossible to solve analytically!Approximate numerically usingMonte Carlo integration!Lr(x, !ωo) =!Ωfr(x, !ωo, !ωi)L(x, !ωi)(!ωi· !n) d!ωiThis can be approximated using the Monte Carlo Estimator:Monte Carlo Integration!baf(x) dxRecap!baf(x) dx ≈1NN"i=1f(Xi)p(Xi)We want to compute the integral:Lets examine this visually.f(x)f(x)ab!baf(x) dxf(x)ab!baf(x) dx ≈1NN"i=1f(Xi)p(Xi)f(x)!baf(x) dx ≈1NN"i=1f(Xi)p(Xi)f(x)!baf(x) dx ≈1NN"i=1f(Xi)p(Xi)Monte Carlo IntegrationRecapWe can extend this simple 1D example to arbitrary dimensions.Recall that the integral we are interested in computing is:Lr(x, !ωo) =!Ωfr(x, !ωo, !ωi)L(x, !ωi)(!ωi· !n) d!ωiComputing LrComputing LrComputing LrComputing LrGather raysComputing LrComputing LrComputing LrComputing LrIndirect IlluminationL is recursive!L(x, !ωo) = Le(x, !ωo) +!Ωfr(x, !ωo, !ωi)L(x, !ωi)(!ωi· !n) d!ωiGlobal IlluminationFormulation of Lr is recursive! i.e. we need to compute if again at each bounce: 1, 2, 3, ... If we shoot out 10 gather rays at depth 0, and each of those generate 10 rays at depth 1, etc, we quickly get exponential growth!Depth 3 contributes less to image than depth 1, but we would spend 100 x the computation time for it!AnalysisPath TracingWe can reformulate our calculation of the rendering equation.Instead of recursively integrating over a hemisphere, we can solve the rendering equation by integrating over all possible light paths of length 0 ... infinity.These are both valid interpretations of the rendering equation.Kajiya ‘86Path TracingInstead of shooting N gather rays at each shading point to estimate Lr, shoot only 1 ray. Each eye ray creates a random path through the scene.To improve quality, shoot more eye rays for each pixel (integrate several random paths).Pros: No more exponential growth, spend less time at high depths.Kajiya ‘86Path Tracing4 rays/pixelKajiya ‘86Path Tracing8 rays/pixelKajiya ‘86Path Tracing16 rays/pixelKajiya ‘86Path Tracing32 rays/pixelKajiya ‘86Path Tracing64 rays/pixelKajiya ‘86Path Tracing128 rays/pixelKajiya ‘86OptimizationsWe saw last time that computing area light shadows works better with the surface formulation.So, compute indirect illumination separately from direct illumination. Combine the two for global illumination.i.e. shoot shadow rays and gather rays during shading. Be Careful!Kajiya ‘86Path Tracing Algorithmcolor shade (point x, normal N)for all lightsLd += contribution from light;ω = random dir in hemisphere above N;Lr = brdf * shade (trace (w)) * dot (N, ω);return Le + Ld + Lr;Kajiya ‘86Path Tracing Algorithmcolor shade (point x, normal N)for all lightsLd += contribution from light;ω = random dir in hemisphere above N;Lr = brdf * shade (trace (w)) * dot (N, ω);return Le + Ld + Lr;Kajiya ‘86Calculating ω•Need to calculate a random direction on a hemisphere.•Like last time, we can do this in a number of ways:•Rejection sampling: choose random point in cube, reject all points not in hemisphere.•Spherical coordinates.Calculating ω•Spherical coordinates:•given Xi = s,t ϵ [0,1)φ = 2πsy = sin(φ) sin(√1 − t)x = cos(φ) sin(√1 − t)z = tp(Xi) =12πCalculating ωNote that we are multiplying the returned value by dot (N, ω), i.e. cos(ϴ):Lr = brdf * shade (trace (w)) * dot (N, ω);choose p(Xi) = cos(ϴ) Importance samplingLr(x, !ωo) =!Ωfr(x, !ωo, !ωi)L(x, !ωi)(!ωi· !n) d!ωi≈1NN!j=1fr(x, !ωo, !ωi,j)L(x, !ωi,j)(!ωi,j· !n)p(Xi)Calculating ωImportance sampling≈1NN!j=1fr(x, !ωo, !ωi,j)L(x, !ωi,j)(!ωi,j· !n)(!ωi,j· !n)≈1NN!j=1fr(x, !ωo, !ωi,j)L(x, !ωi,j)Calculating ω•Spherical coordinates:•given Xi = s,t ϵ [0,1)φ = 2πsy = sin(φ) sin(√1 − t)x = cos(φ) sin(√1 − t)Importance samplingp(Xi) = cos θiz =√tCalculating ωDemo!Describing Light PathsLight Transport Notation•Express light paths in terms of the surface interactions that have occurred.•A path is a line segment chain joined at event “vertices.”Describing Light PathsLight Transport Notation•Possible “vertices:”•L a light source•E the eye•S a specular reflection•D a diffuse reflectionDescribing Light PathsLight Transport Notation•For instance LDDSE means a path starting at a light, having two diffuse reflections followed by a specular reflection before reaching the eye.Describing Light PathsLight Transport Notation•Can express arbitrary “classes” of paths using a regular express type syntax:•(k)+ one or more of event k•(k)* zero or more of event k•(k)? zero or one k events•(k|k’) a k or a k’ eventDescribing Light PathsLight Transport Notation•OpenGL: LDE, (with env. maps): LDSE•Ray


View Full Document

UCSD CSE 168 - Global Illumination

Documents in this Course
Load more
Download Global Illumination
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 Global Illumination 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 Global Illumination 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?