This is a raytracer that I started in a graphics class during my final semester at the University of Minnesota in the spring of 2021. I've put a lot of work into this, so I'd like to showcase it for anyone who'd like to see it.
With guidance from our professor Stephen Guy, the students in this class spent three weeks creating raytracers. This is my implementation, which has grown since then and supports lots of different cool features, like
If you'd like to try out the raytracer yourself, this repository should contain
most of what you need to get started. This project is built using cmake
, so a
machine with cmake
installed is also necessary.
To build the code for the project, try the following on a bash terminal from the top-level repository directory (where this README is).
mkdir build
cd build
cmake -E env CXXFLAGS="-O3" cmake .. # turn on aggressive compiler optimization
make ray # depending on what system you're using, CMake may generate a Makefile or some other way to build the code
./ray scene_file.txt
This project was built and tested on Ubuntu 18.04, so I don't know exactly how it runs on different OSes or different versions of Linux (but it shouldn't have many issues between versions of Linux as far as I'm aware).
Some example scene files are in the scenes
directory. These can be passed to
the ray
executable to be traced.
The images
directory contains example images generated by this raytracer. Many
of the scene files / models for these scenes were given to us by Dr. Guy. They
do a good job of showing off various different features of the raytracer, like
shadows, reflections, interesting camera angles, and so on. They also expose
some bugs here and there. images/Refract
contains example images for refraction,
which I attempted but didn't get working correctly.
Some of my personal favorites are the watch images in images/Challenge
. This
watch is incredibly detailed. You can see the highest quality watch image above.
Here are some more highlights from the images
directory.