1 / 24

Last Time

Last Time. Raytracing and PBRT Structure Radiometric quantities. Today. Radiometric Integrals Monte Carlo integration Section 5.3 and Chapter 14 of PBR. Irradiance from Radiance (PBR Sect. 5.3). Integrate radiance over directions in the upper hemisphere:

maleah
Télécharger la présentation

Last Time

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Last Time • Raytracing and PBRT Structure • Radiometric quantities © 2005 University of Wisconsin

  2. Today • Radiometric Integrals • Monte Carlo integration • Section 5.3 and Chapter 14 of PBR © 2005 University of Wisconsin

  3. Irradiance from Radiance (PBR Sect. 5.3) • Integrate radiance over directions in the upper hemisphere: • cos term deals with projected solid angle.  is angle between  and n (the normal) • We are converting “per unit solid angle per unit projected area” into “per unit solid angle per unit area” and then integrating over solid angle to get “per unit area” • Today: solving integrals like this © 2005 University of Wisconsin

  4. Integration Methods • Analytic: not tractable for most functions you want to integrate • (Numerical) Quadrature: • Break the domain of integration into pieces, evaluate the function once in each piece, and sum up value for all pieces, weighted by the “size” of each little area • A very poor strategy for high-dimensional integrals – we will have lots of these, even infinite dimensional • Monte Carlo integration: • Evaluate the function at random points in the domain, and sum up the answers • Error independent of dimensionality of problem © 2005 University of Wisconsin

  5. Probability Theory Overview • The aim is to give you enough to survive, for more see a probability (not statistics) textbook • A random variable X is a value chosen by some random process • Rolling dice, nuclear decay, pseudo random number generator, … • We are interested in the properties of random variables © 2005 University of Wisconsin

  6. Discrete Random Variables • Consider rolling a die • Possible values for random variable are Xi={1,2,3,4,5,6} • Probability of seeing some value is pi=1/6 • Sampling x according topimeans choosing a value for x such that the probability that x=Xi is pi • In rendering, the most common discrete case is choosing a light, Li{L1,…,Ln}, according to the power output: © 2005 University of Wisconsin

  7. Discrete Sampling (1) • Always assume we can sample a canonical uniform random variable[0,1) • In PBRT, function: genrand_real1() • Always get same sequence, which can be annoying • We want to use this to choose a light according to pi • Choose light Li if © 2005 University of Wisconsin

  8. Discrete Sampling (2) • Define • The cumulative distribution function, the probability that a variable chosen according to the distribution pi will be less than Li • To sample according to pi, sample  then choose Li such that • Build an array of Pi values (sorted), and then search it to find the index such that above equation is true (binary search for large arrays) © 2005 University of Wisconsin

  9. Continuous Random Variables • A random variable, X • Takes values from some domain,  • Has an associated probability density function (pdf), p(x) • Methods for sampling continuous random variables according to various distributions on various domains are discussed in PBR Sect 14.3-14.5 • Again, useful to know what is available and how to use it, but not strictly necessary to understand how they work © 2005 University of Wisconsin

  10. Expected Value • The expected value of a random variable, x, is defined as: • The expected value of a function, f(x), is defined as: • The sample mean, for samples xi is defined as: © 2005 University of Wisconsin

  11. Variance and Standard Deviation • The variance of a random variable is defined as: • The standard deviation of a random variable is defined as the square root of its variance: • The sample variance is: © 2005 University of Wisconsin

  12. Sampling • A process samples according to the distribution p(x) if it randomly chooses a value for x such that: • Weak Law of Large Numbers: If xi are independent samples from p(x), then in the limit of infinite samples, the sample mean is equal to the expected value: © 2005 University of Wisconsin

  13. Monte Carlo Integration • Say we wish to integrate • Choose some pdf, p(x) • If we sample xi, i{1,…,N}, according to p(x), then: © 2005 University of Wisconsin

  14. Simple Example • Compute • Sample xi uniform on interval [1,5), so p(x)=1/4 • Sample canonical i then xi=4i + 1 • Monte Carlo Estimate is © 2005 University of Wisconsin

  15. Output © 2005 University of Wisconsin

  16. Standard Deviation of the Estimate • Expected error in the estimate after N samples is measured by the standard deviation of the estimate: • Note that error goes down with • Often, p(x) is the uniform distribution over the domain • If p(x) is something else, the technique is called importance sampling and p(x) is the importance function • p must be >0 whenever f>0, and should be as close as possible to f • Same principle for high dimensional integrals © 2005 University of Wisconsin

  17. Radiometric Integrals (PBR 5.3) • Physically-Based rendering is all about solving integral equations involving radiometric terms • The domains of integration are areas, or regions of solid angle, or even more abstract spaces • Choosing the right domain is one consideration • The challenge is finding a way to reduce variance, which manifests itself as noise in images • More on this later, after we have some more background © 2005 University of Wisconsin

  18. Computing Irradiance • This integral is expressed in terms of solid angle within the upper hemisphere • To solve it, we need to sample directions • We can’t represent  with just one number • It’s a multi-dimensional integral • How do we parameterize directions? © 2005 University of Wisconsin

  19. In Spherical Coordinates • Note that =0 is normal vector direction • We need a basis to define  • The tangent vectors • How do we convert an angle expressed in terms of solid angle, to one in terms of spherical coordinates? • Convert domain to range of , • Convert d to dd © 2005 University of Wisconsin

  20. Solid angle to Spherical • d is projected area • Recall the definition of solid angle • What area goes with dd? © 2005 University of Wisconsin

  21. Irradiance Integral in Spherical Coords • In general, the incoming radiance varies over the scene • It depends on what is “seen” in each direction • If incoming radiance is constant, then • Conversion functions for unit vectors =(x,y,z) to spherical coordinates are available in PBRT © 2005 University of Wisconsin

  22. Solid Angle to Area • Solid angle is defined in terms of area projected onto the unit sphere © 2005 University of Wisconsin

  23. Irradiance Arriving From Surface • We want to integrate the irradiance due to an area light source • Note there are two  now • Convert integral over area into integral over (s,t) (parameters for surface) © 2005 University of Wisconsin

  24. Next Time • Cameras and Film Plane Sampling © 2005 University of Wisconsin

More Related