Skip to main content

Requirements

  • Support scenes consisting of spheres and triangles. The algorithms described in lecture for intersecting these shapes translate well into brief Python/NumPy implementations.
  • Support perspective cameras. In our system the camera's position and orientation are specified in the from-target-up style, and the camera parameters are described using vertical field of view and aspect ratio.
  • Support modified Blinn-Phong shading with point and ambient lights. The equations for this are laid out in Steve's lecture video on shading if anyone needs a refresher. The names for the material parameters match the slides from his video, though we use k_d for the diffuse coefficient that is mostly written "R_d / pi" in his slides.
  • Render mirror reflection and shadows. The algorithms are described in the slides from the video. Limit recursion depth to 4 levels. Mirror reflections should use the mirror reflection coefficient k_m stored in the material.
  • The bg_color property of the scene should appear in the background of the image.

The combination of point lights, one ambient light, and mirror reflection constitutes the "glazed" shading model from lecture (also Steve's video).

Your program must implement the interfaces specified in the starter code, so that it is compatible with our test cases. You should not import new packages beyond the ones we are using.

There will be additional tests

The tests provided to you in the starter code should prove quite useful, but ther are not complete. We will be using additional tests for grading and you should not assume that passing the provided tests will guarantee a perfect score. We encourage you to think about the behavior of your ray tracer and whether it is correct. You may modify testray.py to add your own tests for this purpose.

caution

If you are using Steve's videos as a reference, toward the end of his ray generation video he describes a slightly different convention for generating rays where the coordinates of an image start at the bottom left. The assignment uses more standard texture coordinates, which place the origin at the top left. Be aware of this difference and implement your code as specified in the assignment!