Pete's Rendering - 98/02/18 --------------------------- Will talk about caustics today (see email). Caustics are nonphysical; you do start up with, and you can end up with infinite radiance (a point light source). Informally, any kind of light pattern that results from light transport is called a caustic in graphics (physicists would get upset). Pete doubts there's a glass-ball caustic analytic solution. More importantly, caustics by sun through windows is important for architectural simulation, so we care. Might represent caustic on surface as a texture map attached to all diffuse surfaces. Alternatively, you could parameterize the surface in u,v and store a matrix. This is bothersome, because nature doesn't need to do more work to get the answer. It's ugly that we have to. Nobody models overhead projectors physically, they just put an image on the wall. Paper at siggraph last year: Metropolis light transport. It's a nightmare, and there's only one implementation. Everyone's intimidated by it. There's some intrinsically nightmarish qualities to that algorithm. Some beautiful elegance, too. Last lecture, perhaps? First we need to understand path tracing (this week and next). People have been working hard on rendering for 30 years, no good solutions. 'Tis a little worrisome. Question: What about blurry reflection by jittering? Ans: Any time you build a reflection model in, you're making assumptions about how reflection works. (eg: brushed aluminum). Homework: The Assignment is due Wednesday, not Monday, 'cause it's big. Lecture Exists some area light source, which has an emitted radiance that you look up. At every point on it, there is some radiance that's a function of both direction and orientation. If you vary the direction that light's coming out of the car headlight (where you're standing looking at it), that's varying omega. v{x} is the position on the area light source. Le(v{x},v{omega},lambda) You look at it from somewhere. All that matters (diffuse surface) is the point on the surface, the normal there, the direction to the light, etc. For this program, light does not bounce (direct lighting). We do direct highly accurately, we call indirect things zero for now. This forms a simple enough physical approx that it's easy to implement. Call the point on the diffuse surface v{x'}. It will have some color L(v{x'},lambda) - since it's diffuse, its radiance does not vary with direction. Consider a dA of the light area. The little chip will produce some dL(v{x'},lambda) which is the radiance due to dA. If you double the reflectance of a surface, the radiance doubles. Reflectance is the ratio of light out to light in. Most things in this light transport stuff are linear; big streams of virtual photons floating around. Call the reflectance here R(v{x'},lambda). dL is linearly prop to R, dA. Falls off as inverse square of distance. Also cosine of dA normal to ray (theta), as well as cosine of surface normal to ray (theta'). Also, there is a normalization term to conserve energy of 1/Pi. Pete's never seen a good argument as to where it comes from. Has seen proofs that it must be there, but no good intuitive argument. Integrating: x=v{x}, x'=v{x'}, l=lambda, t=theta, t'=theta' dL(x,l) = (1/Pi) R(x',l) 1/(|| x-x' ||^2) cos(t) cos(t') dA L(x,l) = Int_AllXOnLight (ditto) In this class, when you see an integral, that means: Monte Carlo! Figuring out an anaytic domain of integration is a problem due to shadowing. If there's something between x and x', the light gets blocked. Call it g(x,x') the "geometry term". We'll call it s(x,x') the "shadow term": s(x,x') = 1 iff x "sees" x', 0 otherwise. Stuff s(x,x') in there next to the 1/Pi. Review Monte Carlo Int: Domain Omega Int_Omega f(x) dmu(x) = f(y)/p(y) where y has density function p ( "y ~ p" ) Domain of integration is the light source, the measure mu is area. We need a probability density function on the light source, let's say uniform! On light: p(x) = 1/A. Say light is rectangle in 3D. Pick a uniform random (u,v). So Monte Carloing becomes: L(x',l) ~= s(x,x') (1/Pi) R(x',l) (1/distance) cos(t) cos(t') A where x is a uniform random position on the Light. - is like a point sample that you're treating as the whole light area - evaluating s requires sending out a "shadow ray" Will produce soft shadows: umbra (no shadow rays will hit, s always 0). antiumbra (all hit, s always 1). penumbra requires hundreds of samples to eliminate noise effects. Width of penumbra goes to zero as you approach the point where the umbra starts (at intersection of two objects). An area of noise looks more obnoxious than a line of noise - that's why you need hundreds of samples in the penumbra but only 9 for checkerboard. Definitely want to stratefy your samples in the penumbra. Crucial thing is to make the random point on the LIGHT stratefied. Is a PD program, "radiance" that creates virtual lights for all flat mirrors to get pseudo-caustic splotches on the floor. Not a good solution for glass or nonplanar mirrors. Just don't put them in the scene is the usual answer. MacBeth color checker is a good way to check your color code. Now is the time to switch from RGB to spectrum if you plan to use the color checker at the end of the quarter. Final question on light is what if you want a spherical light source? Picking something on the front isn't picking from exactly half the sphere. cosine varies a lot over the surface of the sphere. 1/A requires lots of samples. Is a graphics gem on this. Buzzword for fog is "participating medium". Trouble is light scatters off the medium and indirectly lights stuff in zillions of ways. If you allow light to bounce twice in fog it's horrid! Multiple scattering sol'n paper has been submitted to siggraph this year. Maybe a lecture at the end if it gets in. Steve Parker has hacked soft shadows: perceptually all you care is that the penumbra is soft. He measures the closest distance that a ray comes to the object. Gives a shadow that's about the right shape, about the right blurriness. For small objects, makes big unphysical penumbrae. Beauty of it is there's no noise; one sample per pixel.