Ray Tracing Devlog 1 - Assessing a Dormant Project

2020-02-19 // 3 minutes

I had originally started writing this ray tracer back in 2014 during CMSC 435 under Prof. Marc Olano. I attempted to invest time here and there into the project over the years, but life/work kept intruding. I'm using this blog as a way to keep me honest about the progress I'm making and share anything interesting I'm learning along the way.

My coding style has certainly changed in the six years since I submitted this project - hopefully improved as well! First order of business is to assess what's in the project, what can be kept, and what needs to drastically changed or deleted. I had originally written the project in C++ - including an exploratory foray in OOP that I likely will not keep. I lean much more heavily towards to C spectrum these days, but I plan to use some C++ features - operator overloading is too good to pass up.

I also plan on starting concurrent ray tracing projects in other programming languages. The C/C++ project will remain my flagship ray tracing project, but I figure using a well tread project to pick up a new programming language will serve as an excellent learning exercise.

Old Render

The original assignment has us parsing an NFF file to generate a scene which was then lit according to a mathematical lighting model - Lambert, Blinn-Phong, etc. We were asked to output to a ppm file. However, I have since switched to outputing to a png file. Since this project is meant as a learning exercise, I do eventually want to hand write code to generate a png file, but for the moment I am using the excellent stb_image single header library. I may also add ppm output support back into the project in addition to other file formats.

With apologies for garish green background - I was debugging the background plane reflecting properly at the time of capture - here is where I left off with the school assignment.

Baby Steps

I knew that I wanted to add support for OBJ files, especially so that I could take advantage of the meshes made available by Morgan McGuire. I figured that the first reasonable step to adding OBJ support was hand writing a file that contains a single triangle.