Tracing The Late Ray

Work has been crazy the past few weeks, so I apologize for not writing this earlier. I've had a version of this text ready to go almost two weeks ago, but life conspired against me posting it. So here I am, on a Thursday almost two weeks late, writing about my "Weekend Project".

I started reading the book, and everything went fine until I hit Chapter 2 (yes, that two). He throws a bunch of math at you and my mind just sort of tunes out if there's too many formulas. There's probably some math-related school trauma I haven't dealt with. I got through it eventually, making notes and adding post-its along the way. That was Saturday.

Sunday was when where the real fun began as I read Chapter 3. I found the code snippets easy to follow (even if I don't quite get why there's only snippets and not the full code in a book with "from the ground up" in the title). I read the whole chapter, and then wanted to get back and implement the thing myself. I downloaded the complete code from the website to have pointers for everything and then hit my first snag: He uses wxWidgets as the frontend, which only sort of works on macOS. Oh boy. Three chapters in and I was already in trouble. I had three choices:

  1. Develop on Linux (Or Windows, but seriously. No.)
  2. Make the code run on macOS.
  3. Write a new frontend.

I didn't want to set up a Linux environment, because I was busy enough following all the math. The second option, rewriting code from a book, is a dangerous endeavor in my experience; you create way more trouble for yourself, because the two codebases look too similar to distinguish them at a glance, which leads to unnecessary errors. So I picked the third option: Write a new frontend. I've done a few games in SFML over the last few months, so that seemed like the natural place to go. It offers similar capabilities and I know how to work it. The code is up on github. I didn't get to do the exercises, though. I'm aiming to get them done by Sunday.

But I'm not telling you which Sunday...

Ray Tracer, Graphics Investigator

The thing about not having a formal education is that you learn things in a different order than most people in your field. Or sometimes you don't learn some theoretical thing at all, because it's really not relevant to the work you do, and then you feel like a fraud when it comes up and you have no clue.

I understand that ray tracing is pretty fundamental to graphics programming, and that it's something comp-sci people learn in university. Well, I never went to university. I have a high-level understanding of the concepts behind it, but I never felt the need to learn more than that. Now that I've switched my game development efforts to Unity, I have even less reason to dig into the details. And yet, I find myself compelled to do just that.

I picked up "Ray Tracing From The Ground Up" by Kevin Suffern. For the next few weeks, I will work through one or two chapters every weekend, post my progress on github, and write a little something on here. That way, I'll have an audience while I stumble through all the hard mathy stuff. I love struggling in public. Just ask the people in the Berlin comedy scene.