CSE168 notes 3, ray casting, shading, recursive

  • camera Ray Casting
  • Ray-object intersections
  • Ray-tracing transformed objects
  • Lighting calculations
  • Recursive ray tracing

camera ray casting

  • finding ray direction for given pixel i and j
  • ray has origin and direction
  • find direction given camera params and i and j
  • first construct coordinate frame
  • a is given by eye – center
  • b is the up vector
  • camera direction is w or -w
  • ray also moves certain direction along the u and v

from this get the ray :

\vec{r} = \vec{eye} + \frac{\alpha \vec{u} + \beta \vec{v} - \vec{w}}{\left| \alpha \vec{u} + \beta \vec{v} - \vec{w} \right|} t

Shading Model

Recursive Ray Tracing

For each pixel 
trace primary ray, find intersection
trace secondary shadow ray to all lights
- color = visible ? illmodel : 0
trace reflected ray
- color += reflectivity * color of reflected ray (recursion)

Leave a Reply

Your email address will not be published. Required fields are marked *