<<

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 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 . Sp eci cally,we will lo ok at Fermat's

Principle, rays and , and caustics.

1 Fermat's Principle

In , we assume that the -like b ehaviour of 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 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

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 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 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 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 . 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 , 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 W to b e the surface de ned by the p oints on eachrayat

a constant s. Alternatively, the wavefront can b e describ ed as the lo cus of p oints at a

given optical path length. We will not go into the details of wavefront prop erties, but one

imp ortant prop erty that should b e noted is that the wavefront surfaces are orthogonal

to the rays. You can think of wavefronts as isosurfaces in space.

This section is fo cused on intuitive concepts rather than formal derivations. In this entire

discussion, light sources are assumed to b e p oint light sources, although similar concepts

and metho ds can b e extended to the area light source case. Figure 7 depicts three simple

typ es of wavefronts: those emitted by a single lo cal p oint light, those emitted byan

in nitely distant p oint light and a set of converging wavefronts.

8 CS448: Lecture 20

S wavefront

light ray

(a) (b) (c)

Figure 7: Three di erent wavefronts: a those emitted by a single lo cal p oint light

source, b those emitted by an in ntely distant p oint light and c a set of converging

wavefronts.

We are interested in the convergence and divergence of the rays b ecause we need to b e

able to calculate the of the light at a p oint b eing illuminated, and the intensity

of the light can b e shown to b e equal to the radiantpower of the light divided by the

wavefront area.

Intuitively, this makes sense. Consider a set of rays which represent lightmoving forward

over time, and twowavefronts de ned by these rays at di erent p oints in time. Further-

more, consider the two patches of area on these wavefronts, shown in Figure 8, which are

de ned by this set of rays. The situation in the gure is a divergentwavefront, so the

0

area dA is greater than the area of dA. If the wavefrontwere converging, the opp osite

would hold.

We can think of these two patches of area as the ends of a tub e containing the set of rays.

Although the area of the two patches is di erent, the total p ower transmitted through

the tub e is a constant. Thus the intensity, which can b e thought of as the number of

rays p er unit area, decreases as it passes through the tub e. Note again that the intensity

would increase in the case of a convergentwavefront.

We can formalize this intuition. We consider the general situation of the neighborhood

of a p oint on a rectilinear ray. There is some orientation of a cutting plane at this p oint

that will yield the maximum radius of curvature r , and another orientation of a di erent

1

cutting plane which will yield the minimum radius of curvature r .Furthermore, we know

2

the planes asso ciated with these two radii of curvature are orthogonal from our earlier

lectures on di erential geometry. These radii of curvature are depicted in Figure 8.

Let dA b e this element of area on the wavefront. All rays passing through dA will

0

intersect some subsequentwavefront with area dA . Let d , d b e the elements of angle

1 2

CS448: Lecture 20 9

r 2

f1 f 2 r dA ray

1 dA’

0

Figure 8: A ray and two small patches of area, dA and dA on twowavefronts asso ciated

with the ray.For small enough patches, the area of the patch is de ned by the radi of

curvature and the angle subtended at the center of curvatures as dA = r d r d .

1 1 2 2

subtended at the centers of curvature by these p oint areas. Because of the conservation

of energy,wemust have

0 0

d=I dA = IdA

where dispower and I is intensity. Therefore

0

r r dA r r d d  I

1 2 1 2 1 2

= = = =

0 0 0 0

0 0

I dA r r d d r r 

1 2

1 2 1 2

This illustrates the imp ortant p oint that the intensity is not only related to the area of

the wavefront, but also to the inverse of the Gaussian curvature of the wavefront.

We know also that as a wavefrontevolves forward according to the principles of optics,

that the new wavefront will b e an o set surface from the original wavefront. Thus, if the

wavefrontisdiverging we can express the new radii of curvature as

0

= r + d r

1

1

0

r = r + d

2 2

10 CS448: Lecture 20

Alternatively, if the wavefront is converging, we can express the radii of curvature as

0

r = r d

1

1

0

r = r d

2

2

Since intensityisinversely prop ortional to the radi of curvature, this means that at some

p oint there must b e in nite brightness. This p oint of in nite brightness is called a caustic,

from the dimunitive form of the Greek word for \burning iron".

The caustic is thus the , the lo cus of the centers of curvature. In the three dimen-

sional case, there will b e two caustic surfaces, one for each of the principal directions of

curvature. What we collo qially call \caustics" are the curves formed by the intersections

of these surfaces with a ground plane or ob ject.

5 Orthotomics

Wehave seen from ab ove that when a wavefront converges, a caustic is created. We are

interested sp eci cally in the case where a p oint light source shines up on a curved re ector,

and the re ected light converges to a caustic. The orthotomic curve is an intermediate

curve that we will use to nd the caustics in this re ected case.

Because of the complexities of the three dimensional case, where the caustic is a curve

and there are two caustic surfaces, we will fo cus our discussion on the orthotomic in the

two dimensional case.

We will construct the orthotomic for an arbitrary light source and re ective surface. In

doing so, we will show that the orthotomic corresp onds to the re ected wavefront.

We construct the orthotomic as follows. Given a source s and a curve c, pick a p oint x

on the curve and nd its tangent. Then the lo cus of re ections of s ab out such tangents

form the orthotomic curve, also known as the secondary caustic. This construction is

depicted in Figure 9.

Wenow explain the construction of the orthotomic more rigorously. In this explanation,

let n b e the normal to the curveatpoint x and t b e the tangent. Let x b e the vector

from s to the p oint x.

We know that if we re ect x ab out the tangentat x, this will de ne the p oint:

CS448: Lecture 20 11

y

y t

x x

s r

n

Figure 9: Construction of the Orthotomic Curve

y =2[x  n]n

Lo oking at Figure 9 we can understand the formula for the p oint y . When we re ect the

vector x across the tangent to the curveat x, it de nes this new p oint. We can then

note that the pro jection of x onto the normal n multiplied by 2 also gives us this same

p oint. Wemust multiply bytwo to account for the fact that wehave re ected the vector

0

x across the tangent. To nd y we simply di erentiate:

0 0 0 0

y = 2[x  n]n +2[x  n ]n +2[x  n]n

= 2[t  n]n 2[x  t]n 2[x  n]t

= 2[x  tn +x  nt]

/ x  tn +x  nt

0 0

We use identities from the previous lectures: t  n =0, n = t, x = t.

Consider the vector [y x]. Wewould like to show that the normal to the orthotomic

curve at the p oint y lies in the same direction as this vector. The normal at the p oint y

must b e p erp endiculer to the tangentaty whichwe will call t . If the vector r which

y

is the re ection of x across the tangent to the curveat x is in the same direction, it to o

0 0

must b e p erp endiculer to t . Since t = y , it is sucient to show that [y x]  y =0:

y y

12 CS448: Lecture 20

0

[y x]  y / [y x]  [x  tn +x  nt]

= y  [x  tn x  nt] x  [x  tn x  nt]

= x  tn  y  x  nt  y  x  tx  n+x  nt  x

= x  tn  2x  nn x  nt  2x  nn

= 2x  tn  nx  n 2x  tn  nx  n

= 0

We know that the normal to the p oint y must b e p erp endicular to the tangentaty ,

whichwe calculated ab ove. Since the dot pro duct of the vector [y x] with this tangent

is zero, this vector must lie in the same direction as the normal at y .Furthermore, from

the gure and the law of congruent triangles, we can see that the re ected lightray r

from the source must also travel in the direction of [y x].

Therefore the normal to the orthotomic at y is along the direction of r and passes through

x. In more detail, light from s is re ected by the curveat x, according to the the Law

of Re ection. Thus the incidentray and the re ected ray make equal angles on opp osite

sides of the normal to x. By congruent triangles, the re ected ray is along the line from

y to x.From ab ove, this is the normal to y .

It follows then that lightrays having the orthotomic as their intial wavefront i.e light

rays starting simultaneously at all p oints on the orthotomic and then propagating down

the normals are the same as light incident from s and re ected by x.Thus the caustic

by re ection of s is the caustic of the orthotomic.

Now, let's sum up intuitively what wehave just formally explained. Given a light source

and a curved re ector, wewant to b e able to nd the caustics that would b e formed. An

easy way to compute these caustics is to use the orthotomic curve. The orthotomic curve

has the prop erty that its wavefronts will evolve to the same caustics as the wavefronts

from the true light source will after b eing re ected.

6 The Gauss Map

Every p oint on a surface has some normal nu; v . The Gauss map is a mapping of every

p oint on a surface to the p oint on the unit sphere with the same normal. This map is not

one-to-one. Figure 10 shows an intuitivesketch of this construction for a small p ortion

of the gauss map. The 3D case is to o complicated to draw, so we show the 2D analog.

CS448: Lecture 20 13

H

H

H

G

Figure 10: Construction of the Gauss map: the multiple normals on the original surface

that are in the same direction as the vector N map to the single p oint on the unit sphere

with normal in the direction of N . When the multiplicty of p oints b eing mapp ed to a

single p oint on the unit sphere is greater than one, folds develop in the Gauss map.

The resulting Gauss map mayhave folds. These folds corresp ond to in ection p oints on

the original surface, that is, the b ottom of a concavevalley, the top of a convex hill or

a saddle p oint. At these p oints, the map whichwe are tracing out on the unit sphere

changes direction b ecause of the change in curvature at the in ection p oint on the original

surface. If the original surface is smo oth, the Gauss map will b e continuous.

Consider a small patch of area S on the original surface. There will b e a corresp onding

area patch w on the Gauss map. The Gaussian curvature is the di erential ratio of the

S

two areas:  = lim .

S !0

w

We can formally de ne the Gauss map:

Gxu; v  = f u; v 

2 2

as a map G : s = S from the surface patch S to the unit sphere S .

When we are dealing with in nitely distant p oint light sources, the Gauss map can b e

used to tell how many virtual will b e created by a re ective surface. Consider

Figure 11. For every p osition of the viewer and the light source there is a vector H :

L + E

H =

jL + E j

14 CS448: Lecture 20

L

H H

E

G

H

Figure 11: Specularities The numb er of virtual lights is the multiplicity of the p oints on

the Gauss map with normal equal to H .

The numb er of virtual lights created by a re ective surface is the multiplicity of p oints

on the Gauss map with normal equal to H , that is how manylayers exist on the Gauss

map.

We are thus interested in the folds created on the Gauss Sphere when the mapping is

p erformed. When the re ective ob ject is deformed or moved, the virtual lights on its

surface move, and may b e created or destroyed. This creation or destruction of virtual

lights o ccurs at the parab olic p oints on the Gauss map.

7 Implementation Issues

When trying to implement shading calculations using virtual lights, we can utilize some

of the prop erties wehave learned to optimize our calculation. A brief overview of the

techniques that can b e used when implementing virtual lights is provided here. For a

more detailed exp osition, see [1].

Most imp ortantly,we can leverage the observation made ab ove that the intensity of light

is prop ortional to the Gaussian curvature of the wavefront asso ciated with that p oint.

Thus, rather than keep track of all of the geometry asso ciated with the wavefronts we

can simply track the Gaussian curvature as the wavefronts evolve forward.

Prop ogating curvature through free space is trivial - we just need to add distance to the

radius of curvature. The diculty lies in eciently calculating the change in curvature

that o ccurs when the wavefront is re ected o a curved re ector.

CS448: Lecture 20 15

We derive the equations necessary to calculate the re ected curvature. Recall the equa-

tion giving the directions of the re ected ray:

r  i s

n = n + 2 cos in

i s

In these equations, n and n are the normals to the incidentwavefront and surface

r 

resp ectively; n is the normal to the re ected wavefronts. i is the angle of incidence of

the rays.

i s

We calculate the vector u = n  n . This vector must b e tangent to b oth the incident

wavefront and the surface since it is p erp endicular to b oth normals. We can calculate

the curvatures of the incidentwavefront in the direction of u by rotating the principal

curvatures using the angle b etween u and the line of curvatures and Euler's Formula. The

curvatures of the surface in this direction can b e computed using the curvature tensor of

the surface.

The curvatures of the new wavefronts are computed by taking the directional dervvatives

r 

of n in the direction u. These derivatives can b e computed from the formulae for the

re ected vectors and the directional derivatives of the normals on the incidentwavefront

and the surface.

For re ection:

r  i s

 =  + 2 cos i

u u u

r  i s

 =  2

uv uv uv

r  i s

 =  +2= cos i

v v v

For refraction:

s i t

+  =  

u u u

t i s

 =  + cos i= cos t

uv uv uv

2 s i t

+ cos i= cos t  =  

v v v

Rememb er that the curvature of a plane is 0. Therefore, the curvatures of an outgoing

wavefront re ected from a planar surface will b e the same as the incoming wavefront

the fact that  switches sign is a result of the change in orientation of the co ordinate uv

16 CS448: Lecture 20

system due to re ection. This is as exp ected, since a p erfectly re ected wavedoes

not change its shap e. Note also that a planar wavefront incidentonto a a re ecting

surface essentially inherits the curvature of the surface. Thus if the surface is convex,

the re ected wavefront will b e diverging; whereas if the surface is concave, the wavefront

will b e converging, eventually forming a caustic.

References

[1] Mitchell,D. and Hanrahan,P., Illumination from Curved Re ectors, Computer

Graphics 26, 2 1992, 283-291.

[2] Stavroudis, O. N. The Optics of Rays, Wavefronts and Caustics,Academic, 1972.