Lecture16 - Lights
Lecture16 - Lights
Lecture 16 Slide 1 6.837 Fall '00 Lecture 16 Slide 3 6.837 Fall '00
Lecture 16 --- 6.837 Fall '00 Lecture 16 --- 6.837 Fall '00
Lecture 16 Slide 2 6.837 Fall '00 Lecture 16 Slide 4 6.837 Fall '00
Lecture 16 Slide 5 6.837 Fall '00 Lecture 16 Slide 7 6.837 Fall '00
Lecture 16 --- 6.837 Fall '00 Lecture 16 --- 6.837 Fall '00
The direction of the light to each point on a surface changes when a point light source is
used. Thus, a normalized vector to the light emitter must be computed for each point that is
illuminated.
Lecture 16 Slide 6 6.837 Fall '00 Lecture 16 Slide 8 6.837 Fall '00
Ideal diffuse reflectors reflect light according to Lambert's cosine law, (these are sometimes
called Lambertian reflectors). Lambert's law states that the reflected energy from a small
surface area in a particular direction is proportional to the cosine of the angle between that
direction and the surface normal. Lambert's law determines how much of the incoming light
energy is reflected. Remember that the amount of energy that is reflected in any one
direction is constant in this model. In other words, the reflected intensity is independent of
the viewing direction. The intensity does, however, depend on the light source's orientation Why do you think spheres are used as examples when shading?
relative to the surface, and it is this property that is governed by Lambert's law.
Lecture 16 Slide 9 6.837 Fall '00 Lecture 16 Slide 11 6.837 Fall '00
Lecture 16 --- 6.837 Fall '00 Lecture 16 --- 6.837 Fall '00
Lecture 16 Slide 10 6.837 Fall '00 Lecture 16 Slide 12 6.837 Fall '00
Reflection is a very special case of Snell's Law where the incident light's medium and the
reflected rays medium is the same. Thus we can simplify the expression to:
Lecture 16 Slide 13 6.837 Fall '00 Lecture 16 Slide 15 6.837 Fall '00
Lecture 16 --- 6.837 Fall '00 Lecture 16 --- 6.837 Fall '00
Lecture 16 Slide 14 6.837 Fall '00 Lecture 16 Slide 16 6.837 Fall '00
The V vector is the unit vector in the direction of the viewer and the R vector is the mirror reflectance direction. The vector
R can be computed from the incoming light direction and the surface normal as shown below.
Lecture 16 Slide 17 6.837 Fall '00 Lecture 16 Slide 19 6.837 Fall '00
Lecture 16 --- 6.837 Fall '00 Lecture 16 --- 6.837 Fall '00
Notes:
In this equation the angle of specular dispersion is computed by how far the surface's normal
is from a vector bisecting the incoming light direction and the viewing direction. ● The Phong Lighting model
● Once per light
● Once per color component
● Reflectance coefficients, ka, kd,
and ks may or may not vary
with the color component
If they do, you need to be
careful.
On your own you should consider how this approach and the previous one differ.
Lecture 16 Lecture 16 Slide 20 6.837 Fall '00
Slide 18 6.837 Fall '00
Lecture 16 --- 6.837 Fall '00 Lecture 16 --- 6.837 Fall '00
Lecture 16 Slide 22 6.837 Fall '00 Lecture 16 Slide 24 6.837 Fall '00
The problem with transforming normals occurs when objects undergo an anisotropic scaling
(scaling that is not uniform in all directions). Such scaling results only from affine modeling
transforms (Why not Euclidean transforms?).
Lecture 16 Slide 25 6.837 Fall '00 Lecture 16 Slide 27 6.837 Fall '00
Lecture 16 --- 6.837 Fall '00 Lecture 16 --- 6.837 Fall '00
In three dimensions the tangent space at a point is a plane. A plane can be represented by
Phong shading will usually result in a very smooth appearance, however, evidence of the
either two basis vectors, but such a representation is not unique. The set of vectors
polygonal model can usually be seen along silhouettes.
orthogonal to such a plane is, however unique and this vector is what we use to represent the
tangent space, and we call it a normal.
Lecture 16 Slide 26 6.837 Fall '00 Lecture 16 Slide 28 6.837 Fall '00
All that we need to do is find a value for the Q matrix so that the transformed normal and the
Normals are always orthogonal to the tangent space at a point. Thus, given two tangent transformed tangent are still orthogonal. This can be accomplished by letting
vectors we can compute the normal as follows:
which gives
Lecture 16 --- 6.837 Fall '00 Lecture 16 --- 6.837 Fall '00
For parametric surfaces two vectors in the tangent plane can be found by computing partial
derivitives as follows.
If we multiply this out we get
Lecture 16 Slide 30 6.837 Fall '00 Lecture 16 Slide 32 6.837 Fall '00
Discuss Project #4
Rule Changes:
● Project is due midnight Monday (11/20/00)
● You are required only to implement an ambient and a directional light source
● Parser for input files:
❍ Comments - # the rest of the line after a pound sign is ignored
❍ Eye Position - eye x y z
❍ Look-at Position - look x y z
❍ World-space up vector - up x y z
❍ Horizontal field-of-view - fov angle_in_degrees
❍ Ambient Light Source - la r g b # color intensities range from 0 to 1
❍ Directional Light Source - ld r g b x y z # x y z is a vector from the light to the
surface
❍ Polygon Vertex - v x y z
❍ Polygon Facet - f i1 i2 i3 i4 ... in # index to vertex 0-based
❍ Surface Parameters - surf r g b ka kd ks nshiney
Lecture 16 Slide 33 6.837 Fall '00
Next Time