SUNY Geneseo Department of Mathematics
Wednesday, April 8
Math 384
Spring 2015
Prof. Doug Baldwin
if nReflections > 0
Calculate perfect reflection direction
Get Θ from cosine sampler
Get Φ from uniform distribution on [0, 2π]
Generate reflection vector displaced from perfect by Θ and Φ
[ reflT, reflObj, reflPoint ] = trace reflection vector
if reflT is finite
reflColor = calculateColor( reflObj,
reflPoint in world coordinates,
reflPoint in local coordinates,
reflection vector,
...
nReflections - 1 )
else
reflColor = background color
finalColor = finalColor + reflColor * coefficient of specular reflection
else
do Phong specular shading