Given a viewing ray (p + td) and the t at which it intersects a surface, find a unit vector giving the direction from the surface towards the viewer.
Given a ray (p + td) and the t at which it intersects a surface, calculate a unit vector giving the direction from the surface towards:
A scene contains a unit sphere centered at the origin. A directional light shines on the scene, coming from direction .
traceray
function that takes a ray, the scene, and returns the color seen along that ray. When implementing traceray
, what do we do in the case where the object the ray hits is a mirror?