In the past assignment you wrote code for a ray casting system capable of rendering the scenes described in the driver files. In this assignment you will be adding to your existing ray tracing software a capability to perform reflection i.e., recursive ray tracing. This will include the ability to control the depth of recursion though your driver files. Moreover, your code should now be able to handle shadows and multiple materials described in the .mtl file that is associated with the model (.obj) file.
The driver file used here is identical in format to that used in the previous assignment with one exception. There is a new field specifying the recursion depth. Note this line follows the line specification of resolution as shown in this example:
As in the SageMath notebooks, a recursion level of zero means there will be no recursive ray tracing performed and your code will revert to ray-casting as in the previous assignment.
Here is a very important detail not to overlook. The .mtl file associated with the *.obj file will contain more than one materials. This is a change from the previous assignment. Also, every face from the .obj file will have a material (one of the several materials described in the .mtl file) associated with it. When rendering a face your program will read in the appropriate material linked with that face. You should use Ns, Ka, Kd, and Ks fields from the .mtl file. For spheres use phong constant = 16.
Unlike the previous assignments, in this assignment you most design and the render your own scenes. While you are being given some test cases, an important part of the assignment is for you to demopnstrate a hands-on understanding of how to create a scene. In turn, a big part of what makes your new scenes interesting will be in the interaction of objects through reflections and shadoes. To accomplish this assignment there are three principle tasks:
In this assignment your code will be responsible for correctly rendering four scenes, two of which are described in the driver files given to you in the .zip below and the other two will of your choice while adhering to the guidelines described below.
Your program will take two command line arguments. The first argument is a driver file. The second argument is the name of the image your program will write back to the disk in the same folder where your executable is located. A C++ example is:
$./raytracer driver00.txt driver00.ppm
Submit a tar file via the CANVAS assignment page that includes:
Before submitting your tarball, please check Piazza post for safe grading.
If you are using C++, your executable should be named 'raytracer'. If your are using java, the main executable class should be named 'Raytracer'. Notice the change in case for the first letter between C++ and Java. It is must for this assignment to take exactly two arguments as described above.
There is no “late period”. It is essential to start earlier and finish earlier. The program is due when it is due. All work you submit must be your own. You may not copy code from colleagues or the web or anywhere else. Cheating will not be tolerated, and will be handled in accordance with university and department policy.
driver00.txt and driver00.ppm are updated
Submission instructions are updated