Skip to main content

Introduction

Due at 11:59pm on November 13, 2023

Assignment Git Repo

Assignment 4: Ray Tracing

In this assignment we'll explore ray tracing, a rendering algorithm that is used in many high-end applications like film production and realistic computer games. The central operation in this algorithm is tracing a ray through the scene, and the computation proceeds by computing the values of pixels one by one. This is by contrast to the rasterization approach used in most real-time graphics systems, which is organized about drawing triangles to the screen one by one.

Ray tracing is in many ways the simplest rendering method, and you'll see that you can use it to generate images with a minimal amount of code. It is also very flexible and makes it simple to compute many advanced effects (this explains its use in applications where realism is important). Getting good performance out of ray tracing is tricky, but with the right implementation running on the right hardware, one can trace billions of rays per second, and ray tracing is currently being rapidly adopted for real time applications.

This assignment focuses on building a simple toy ray tracer that can make nice renderings but is never going to be fast; we'll worry about big-O efficiency but not the constant factors. To this end we'll use Python, with NumPy for the linear algebra, because it's a familiar and expressive language that will let us get a ray tracer working with just a few hundred lines of code. We'll also follow the rule of making nearly all implementation decisions in favor of simple, direct code over constant-factor improvements in performance. The resulting (single-threaded) program should be able to render simple scenes at low resolution in a couple of minutes.

Sections: