SUNY Geneseo Department of Mathematics

Homework Project 4—Glossy Reflection

Math 384
Spring 2015
Prof. Doug Baldwin

Complete by Wednesday, April 15
Grade by Friday, April 17

Purpose

This lesson reinforces your understanding of Monte Carlo integration and its application to reflections in ray tracing.

Background

This exercise is based on material from classes beginning on March 23 and continuing for about three weeks thereafter.

I expect that we will do most of the work for this exercise in a series of lab classes devoted to modifying my solution to the third ray tracer (the one with shading) into a ray tracer that handles glossy reflection. To support these labs, I have placed a ZIP file containing my ray tracer in the “Course Materials” tab in our myCourses space. Download this file to your computer, and uncompress it (on most computers, you can uncompress a ZIP file by double-clicking on it). Uncompressing the file should produce a folder named “Prototype4” containing the “.m” files for my ray tracer.

Activity

Write Matlab code to implement a ray tracer with the basic features of our third ray tracer (e.g., several kinds of object, Phong shading, shadows) except that in at least some cases the specular reflection component in the Phong shading model is replaced with a glossy reflection component.

As discussed in the background section above, we will develop this ray tracer as a group, through a series of lab classes, as follows:

  1. Derive the mathematics for a sampler for cosine distributions
  2. Write that sampler
  3. Isolate color computations in my ray tracer into a separate function
  4. Modify that function to handle reflections with a single reflection ray
  5. Extend the coloring function to handle reflections via a sample of reflection rays and Monte Carlo integration.

I want you to work through these labs per my guidance and in step with the rest of the class. There are a few days in between the last lab and the “complete by” date during which you can experiment with adding your own touches to the ray tracer, but if you get out of step during the labs there will not be good ways to get you back on track.

Follow-Up

I will grade this exercise in a face-to-face meeting with you. During this meeting I will look at your solution, ask you any questions I have about it, answer questions you have, etc. Please bring a written solution to the exercise to your meeting, as that will speed the process along. For programming parts of the exercise, please bring your code in a form we can read and run (e.g., on a laptop with Matlab installed).

Sign up for a meeting via Google calendar. If you worked in a group on this exercise, the whole group should schedule a single meeting with me. Please make the meeting half an hour long, and schedule it to finish before the end of the “Grade By” date above.