Presentation is loading. Please wait.

Presentation is loading. Please wait.

01/24/05© 2005 University of Wisconsin Last Time Raytracing and PBRT Structure Radiometric quantities.

Similar presentations


Presentation on theme: "01/24/05© 2005 University of Wisconsin Last Time Raytracing and PBRT Structure Radiometric quantities."— Presentation transcript:

1 01/24/05© 2005 University of Wisconsin Last Time Raytracing and PBRT Structure Radiometric quantities

2 01/24/05© 2005 University of Wisconsin Today Radiometric Integrals Monte Carlo integration Section 5.3 and Chapter 14 of PBR

3 01/24/05© 2005 University of Wisconsin 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

4 01/24/05© 2005 University of Wisconsin 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

5 01/24/05© 2005 University of Wisconsin 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

6 01/24/05© 2005 University of Wisconsin Discrete Random Variables Consider rolling a die Possible values for random variable are X i ={1,2,3,4,5,6} Probability of seeing some value is p i =1/6 Sampling x according to p i means choosing a value for x such that the probability that x=X i is p i In rendering, the most common discrete case is choosing a light, L i  {L 1,…,L n }, according to the power output:

7 01/24/05© 2005 University of Wisconsin 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 p i Choose light L i if

8 01/24/05© 2005 University of Wisconsin Discrete Sampling (2) Define –The cumulative distribution function, the probability that a variable chosen according to the distribution p i will be less than L i To sample according to p i, sample  then choose L i such that –Build an array of P i values (sorted), and then search it to find the index such that above equation is true (binary search for large arrays)

9 01/24/05© 2005 University of Wisconsin 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

10 01/24/05© 2005 University of Wisconsin 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 x i is defined as:

11 01/24/05© 2005 University of Wisconsin 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:

12 01/24/05© 2005 University of Wisconsin 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 x i are independent samples from p(x), then in the limit of infinite samples, the sample mean is equal to the expected value:

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

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

15 01/24/05© 2005 University of Wisconsin Output

16 01/24/05© 2005 University of Wisconsin 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

17 01/24/05© 2005 University of Wisconsin 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

18 01/24/05© 2005 University of Wisconsin 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?

19 01/24/05© 2005 University of Wisconsin 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 

20 01/24/05© 2005 University of Wisconsin Solid angle to Spherical d  is projected area –Recall the definition of solid angle What area goes with d  d  ?

21 01/24/05© 2005 University of Wisconsin 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

22 01/24/05© 2005 University of Wisconsin Solid Angle to Area Solid angle is defined in terms of area projected onto the unit sphere

23 01/24/05© 2005 University of Wisconsin 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)

24 01/24/05© 2005 University of Wisconsin Next Time Cameras and Film Plane Sampling


Download ppt "01/24/05© 2005 University of Wisconsin Last Time Raytracing and PBRT Structure Radiometric quantities."

Similar presentations


Ads by Google