Project 3-2: Raytracer


Overview

This project served as an extension to the previous project 3-1. We’ve implemented more sophisticated materials (glass and mirror to be precise) and depth-of-field effects for our camera, which refer to parts 1 and 4, respectively. Our approach was to use staff’s binary for 3-1 implementation and fully focus on the code necessary for 3-2. We have not encountered significant problems and were able to complete this project in relatively small amount of time.

Built by Raiymbek Akshulakov & Yersultan Sapar.

Part 1. Implementation overview

In Part 1, we’ve added new BSDFs to correctly render some non-Lambertian surfaces such as mirrors and glass with realistic reflections and refractions. This part had multiple sub-parts:

Part 1.1: Reflection

Part 1.2: Mirror Material

Part 1.3: Refraction

Part 1.4: Glass Material

Part 4. Implementation overview

In Part 4, we’ve implemented the depth-of-field effects. Following the algorithm outlined in the spec, we sample the point from the lens disk and compute the intersection of the ray with the focus plane. Using that information, we compute the ray that goes through the lens and return it as a result. Changing lensRadius argument to anything other than 0 (ideal pinhole camera) activates generate_ray_for_thin_lens function which we’ve implemented in this part. The image below from the spec shows three planes (image plane, lens and the focus plane) that we use in this part.

Part 1: Mirror and Glass Materials

Part 4: Depth of Field

Collaboration

We’ve worked on different parts, since it effectively utilized our strengths from Part 3-1. Raiymbek worked on Part 1 (since he had more experience working with illumination from the previous project), while Yersultan worked on Part 3 (since he mostly worked on ray generation tasks before). In order to make sure we learn each other’s parts, we’ve wrote the write-up and went through the code logic together. We think collaboration went well both from learning and time management perspectives.

The website link

The website link is https://cal-cs184-student.github.io/sp22-project-webpages-yersultan-17/