Unformatted text preview:

University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don FussellDistribution Ray TracingUniversity of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 2ReadingRequired:Watt, sections 10.6 ,14.8.Further reading:A. Glassner. An Introduction to Ray Tracing. AcademicPress, 1989. [In the lab.]Robert L. Cook, Thomas Porter, Loren Carpenter.“Distributed Ray Tracing.” Computer Graphics(Proceedings of SIGGRAPH 84). 18 (3). pp. 137-145. 1984.James T. Kajiya. “The Rendering Equation.” ComputerGraphics (Proceedings of SIGGRAPH 86). 20 (4). pp. 143-150. 1986.Henrik Wann Jensen, “Basic Monte Carlo Integration”,Appendix A from book “Realistic Image Synthesis UsingPhoton Mapping”.University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 3Pixel anti-aliasingNo anti-aliasingPixel anti-aliasingUniversity of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 4Surface reflection equationIn reality, surfaces do not reflect in a mirror-like fashion.To compute the reflection from a real surface, we wouldactually need to solve the surface reflection equation:How might we represent light from a single direction?We can plot the reflected light as a function of viewing anglefor multiple light source contributions:! I("out) = I("in) frH#("in,"out)d"inUniversity of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 5Simulating gloss and translucencyThe mirror-like form of reflection, when used toapproximate glossy surfaces, introduces a kind ofaliasing, because we are undersampling reflection(and refraction).For example:Distributing rays over reflection directions gives:University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 6Reflection anti-aliasingReflection anti-aliasingUniversity of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 7Full anti-aliasingFull anti-aliasing…lots of nested integrals!Computing these integrals is prohibitively expensive.We’ll look at ways to approximate integrals…University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 8Approximating integralsLet’s say we want to compute the integral of afunction:If f(x) is not known analytically, but can beevaluated, then we can approximate the integral by:Evaluating an integral in this manner is calledquadrature.! F = f (x)dx"! F "1nf (i#x)i=1n$University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 9Integrals as expected valuesAn alternative to distributing the sample positions regularlyis to distribute them stochastically.Let’s say the position in x is a random variable X, which isdistributed according to p(x), a probability density function(strictly positive that integrates to unity).Now let’s consider a function of that random variable,f(X)/p(X). What is the expected value of this new randomvariable?First, recall the expected value of a function g(X):Then, the expected value of f(X)/p(X) is:! E[g(X)] = g(x) p(x)dx"! E f (X) p(X)[ ]=f (x)p(x)p(x)dx"= f (x)dx"University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 10Monte Carlo integrationThus, given a set of samples positions, Xi, we can estimatethe integral as:This procedure is known as Monte Carlo integration.The trick is getting as accurate as possible with as fewsamples as possible.More concretely, we would like the variance of the estimateof the integral to be low:The name of the game is variance reduction…! F "1nf (Xi)p(Xi)i=1n#! Vf (X)p(X)" # $ % & ' = Ef (X)p(X)( ) * + , - 2" # $ $ % & ' ' . Ef (X)p(X)" # $ % & ' 2University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 11Uniform samplingOne approach is uniform sampling (i.e.,choosing X from a uniform distribution):University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 12Importance samplingA better approach, if f(x) is positive, would be tochoose p(x) ~ f(x). In fact, this choice would beoptimal.Why don’t we just do that?Alternatively, we can use heuristics to guess wheref(x) will be large. This approach is calledimportance sampling.University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 13Summing over ray pathsWe can think of this problem in terms of enumerated rays:The intensity at a pixel is the sum over the primary rays:For a given primary ray, its intensity depends on secondary rays:Substituting back in:! Ipixel=1nI(rii=1n")! I(ri) =1nI(rij) fr(rij" ri)j#! Ipixel=1nI(rij) fr(rij" ri)j#i#University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 14Summing over ray pathsWe can incorporate tertiary rays next:Each triple i,j,k corresponds to a ray path:So, we can see that ray tracing is a way to approximate a complex, nested lighttransport integral with a summation over ray paths (of arbitrary length!).Problem: too expensive to sum over all paths.Solution: choose a small number of “good” paths.! Ipixel=1nI(rijk) fr(rijk" rij) fr(rij" ri)k#j#i#! rijk" rij" riUniversity of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 15Whitted integrationAn anti-aliased Whitted ray tracer chooses very specificpaths, i.e., paths starting on a regular sub-pixel grid with onlyperfect reflections (and refractions) that terminate at the lightsource.One problem with this approach is that it doesn’t account fornon-mirror reflection at surfaces.University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 16Monte Carlo path tracingInstead, we could choose paths starting from random sub-pixel locations with completely random decisions aboutreflection (and refraction). This approach is called MonteCarlo path tracing [Kajiya86].The advantage of this approach is that the answer is knownto be unbiased and will converge to the right answer.University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 17Importance samplingThe disadvantage of the completely random generation ofrays is the fact that it samples unimportant paths and neglectsimportant ones.This means that you need a lot of rays to converge to a goodanswer.The solution is to re-inject Whitted-like ideas: spawn rays tothe light, and spawn rays that favor the


View Full Document

UT CS 384G - Distribution Ray Tracing

Documents in this Course
Shading

Shading

27 pages

Shading

Shading

27 pages

Load more
Download Distribution Ray Tracing
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 Distribution Ray Tracing 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 Distribution Ray Tracing 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?