University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner http://www.ugrad.cs.ubc.ca/~cs314/Vjan2005
Lighting and Shading Week 5, Wed Feb 2
2
News: Homework
homework correction: questions 13-16 should
use:
unit square has points A=(0,0,0,1),
B=(0,1,0,1), C=(0,1,1,1), D=(0,0,1,1) in world coordinates
homework clarification: question 1
C_i is down one-half unit and sideways one
unit.
3
News: Project Handin
when handing after the deadline, handin has this
unfriendly warning message
Checking that handin was successful ...
/cs/csbox/user FAILED to find user a1b2. Your files DO NOT appear to be handed in successfully
Do you want to cancel?
don’t panic
go ahead and complete the handin, do not cancel! your submission will be put in the LATE directory 4
Review: Reflectance
specular: perfect mirror with no scattering gloss: mixed, partial specularity diffuse: all directions with equal energy
+ + =
specular + glossy + diffuse = reflectance distribution
5
Review: Reflection Equations
Idiffuse = kd Ilight (n • l)
n l
- 2 ( N (N · L)) – L = R
Ispecular = ksIlight(v•r)nshiny
6
Clarification: Calculating The R Vector
P = N cos = projection of L onto N why is P = N cos , not L cos ?
N and R and L are unit length difference between length of projection of u onto v
scalar: |u| cos in this case length of u is 1 cos projection of u onto v vector in direction of v, with scale factor scale depends on angle between u and v, length of u v |u| cos in this case length of u is 1 v cos
L P N
- u
v
- cos
u
R
scalar length!