Caustics 1 Fermat's Principle
Total Page:16
File Type:pdf, Size:1020Kb
CS448: Topics in Computer Graphics Lecture 20 Mathematical Mo dels for Computer Graphics Stanford University Tuesday, 6 January 1998 Caustics Lecture 20: Tuesday, 9 Decemb er 1997 Lecturer: Pat Hanrahan Scrib e: Christopher Stolte Reviewer: Tamara Munzner In this lecture, we discuss applications of di erential geometry within the eld of com- puter graphics. We will see how concepts discussed in earlier lectures can b e used to solve problems involving the geometry of optics. Sp eci cally,we will lo ok at Fermat's Principle, rays and wavefronts, and caustics. 1 Fermat's Principle In geometrical optics, we assume that the wave-like b ehaviour of light is insigni cant and thus mo del the b ehaviour of light using rays. Light emitted from a p oint is assumed to travel along sucha ray through space. In an e ort to explain the motion through space taken byrays as they pass through various media, Fermat develop ed his Principle of Least Action. The path of a lightray connecting two p oints is the one for which the time of transit, not the length, is a minimum. At the time that Fermat develop ed this principle, his justi cation was more mystical than scienti c. His justi cation can b e summarized by the statement that nature is essentially lazy, and these rays are simply doing the least p ossible work. We can however develop a more useful formulation of the principle. We know from earlier lectures that the time along a curve through space can b e calculated as Z Z ds dt = S t= ds =dt ds c We also know that ds =dt is velo city, which for lightisknowtobe = where is the dt refractive index of the medium. Therefore, wehave 2 CS448: Lecture 20 Z Z Z 1 ds = sds / sds S t= c c s We can thus de ne the optical path length from one p ointonaray to another as the geometric path length weighted by the refractive index of the media. Furthermore, we can now restate Fermat's Principle as Light travels along paths of stationary optical path length, where the opti- cal path length is a lo cal maximum or minimum with resp ect to any small variation in the path. Determining the path taken by a lightraybetween two p oints then b ecomes a simple matter of optimizing S tbetween the p oints. 2 Applications of Fermat's Principle We can make several observations as a result of Fermat's Principle which will prove useful as we explore the realm of geometric optics: 1. In a homogenous medium, lightrays are rectilinear. That is, within any medium where the index of refraction is constant, light travels in a straight line. 2. The angle of re ection o of a surface is equal to the angle of incidence. This is the Law of Re ection. We can also make some interesting and useful observations ab out conic surfaces. Conic surfaces are particulary useful in mirror optics - for example, the design of telescop es. We consider two conjugate p oints - two p oints that are p erfect images of each other. A salient prop erty of these conjugate p oints is that the optical path length of all rays connecting them is equal. Consider a conic surface such as an ellipse. An ellipse is de ned as the lo cus of all p oints such that the sum of the distances from each p ointtotwo xed p oints the fo ci is constant, as in Figure 1. The two fo ci of a mirrored ellipse must then b e optically conjugate p oints. A p oint source lo cated at one fo cus must b e imaged p erfectly at the other fo cus. CS448: Lecture 20 3 d2 d1 Figure 1: An el lipse. The ellipse is de ned as the lo cus of all p oints such that the sum of the distances from each p ointtotwo xed p oints is constant: d + d = c. 1 2 In the case of a parab ola, one fo cus has b ecome in nite. This can b e interpreted by saying that an aggregate of rays, parallel to one another and to the axis of a parab oloid after b eing re ected by the parab oloid, will pass through the fo cus of the parab oloid. The Newtonian telescop e leverages this fact in its design to collect and fo cus light from distant ob jects. In general, a conic surface can b e thoughtofashaving two fo ci and these fo ci will b e optically conjugate p oints. Figures 2 and 3 illustrate how this prop erty of conic surfaces and geometrical optics has b een applied in the design of the Cassegrainian telescop e and the Gregorian telescop e. As a side note, a construction called a \Cartesian Oval" is similar to an ellipse, but has weighted distances. That is, rather than b eing constrained by the equation d + d = c, 1 2 as in Figure 1, the oval is constrained by the equation n d + n d = c. The resulting 1 1 2 2 non-elliptical shap e will nevertheless havetwo p oints of p erfect fo cus. 3 Virtual Light Sources Wenow turn our fo cus to virtual light sources. In traditional ray tracing, a visual ray that encounters a re ective surface is b ounced o of that surface and cast in the direction of re ection. Similarly, visual rays are refracted through volumes. Eventually these visual rays reach a non-re ecting surface and the shading calculation is calculated at this p oint of intersection. This traditional mo del is depicted in Figure 4. Although this traditional ray tracing mo del do es allowustosimulate the e ect of seeing a scene through a re ective or refractive surface, it do es not extend to the simulation of refracted or re ected illumination. In other words, the shading calculation at the p oint of intersection is limited to the direct comp onents of illumination. 4 CS448: Lecture 20 A Hyperboloid Paraboloid B Figure 2: The Cassegrainian telescopecon guration Point A is where the fo cus of the parab oloid and the virtual fo cus of the hyp erb oloid coincide. Point B is the real fo cus of the hyp erb oloid. We can utilize di erential geometry to allow us to solve this more complex problem - determining the re ected illumination at a p oint on a surface. To do this, wemust cast rays from light sources so that they will re ect o of the mirrored surfaces and intersect the p oint b eing illuminated. When the light is re ected o the mirrored surfaces it is p ossible that the lightrays may diverge or converge dep ending on the curvature of the re ective surface at the p oint of re ection. Thus there are twokey problems that must b e solved - determining which lightrays will intersect the p oint b eing illuminated and calculating the prop er irradiance at that p oint. The problem of re ected illumination is depicted in Figure 5. Finding the paths from the light source to the p oint P that re ect o of the mirrored surface is not as complex as might b e assumed. A p ossible path from the light source to the p oint P is depicted in Figure 5. The optical path length is q q 2 2 dx= s x + p x CS448: Lecture 20 5 Ellipsoid A Paraboloid B Figure 3: The Gregorian telescopecon guration Point A is where the fo cus of the parab oloid and one of the fo ci of the ellipsoid coincide. Point B is the other fo cus of the ellipsoid. According to Fermat's Principle, wewant to optimize dx in order to determine the path of the lightrays. If the mirrored surface is de ned by g x = 0 then we can optimize dx sub ject to the constraint that x lie on the surface de ned by g x using the technique of Lagrange multipliers: rdx+ rg x = 0 g x = 0 Solving these equations yields paths of lo cally extremal length. Recall from our earlier discussion of conic gures that the two fo cal p oints of an ellipse are p erfect images of each other - the optical path lengths of all re ected rays connecting 6 CS448: Lecture 20 S Eye Light Ray Reflector Visual Ray P Figure 4: Re ected Visual Rays S Eye Reflector Visual Ray Light Ray P Figure 5: Re ected Ilumination them are equal. If we select s and p as our fo ci of a family of ellipsoids and vary the optical path length, we get a family of confo cal ellipsoids. The system of equations pro duced by the Lagrange multipliers have a simple geometric interpretation. The extremal p oints must not only lie on the surface de ned by g x=0, but they must also lie on the surface of one of these confo cal ellipsoids and the ellipsoid must b e tangent to the surface at the p ointofcontact. Figure 6 depicts this geometric CS448: Lecture 20 7 S X P Figure 6: Osculating Ellipsoid interpretation. 4 Rays and Wavefronts In order to b e able to compute the prop er irradiance at a p oint b eing illuminated, we will need to determine if the rays of light from the light source are converging or diverging at the p oint. A given light will b e the source of manyrays, and the paths of the rays emitted are determined by the following equation: Z sds S = We will de ne a wavefront W to b e the surface de ned by the p oints on eachrayat a constant s.