I am writing a ray tracing based renderer

I really, really like coding. Every few weeks I start some smallish project just to scrap it a few days or weeks later. The code I hack during that span of days is most often so dirty, that I don’t dare presenting it to a wide audience on my GitHub profile.

And now, I started another hobby project. „Shouldn’t he be working on his Master’s thesis?“ I can imagine you asking yourselves. And you might be right, but it’s never a bad idea to have a fun project for lonely Saturday nights with lots of caffeinated beverages and junkfood.
So I decided to code a ray tracing based renderer.
At first I thought, that it shouldn’t take more than a weekend to produce the first results worth seeing. Yeah, right. I overestimated my actually really rusty linear algebra skills quite a lot. But as of today, I have least implemented a renderer which is capable of diffuse lighting and rendering spheres (yes, only spheres by now). There is no shadow casting, no reflection, no specular highlighting, no anti-aliasing and no zombie hedgehogs on a quest for golden triangles.

This is what a simple scene with 2 spheres and 2 diffuse light sources looks like (the white sphere is actually one of the light sources):

Ray traced scene

Not very spectacular, right? But it’s a start.

For now, I have written everything in Ruby, but once I worked out the maths completely, I plan on porting the renderer to at least Scala and maybe JavaScript. By then, I should’ve beautfied the code enough to actually add it to my GitHub.

It’s lots of fun. And vectors.