JERALMI CANELA

Game designer, artist, and programmer.

Raytracer
Raytracer
• Title: Raytracer
• Genre: Graphics Programming
• Role: Programmer
• Company: Personal Project
• Tech: C++
A raytracer built from scratch in C++.

Breakdown

This started on Shadertoy. A friend and I had been messing around on there for a few weeks, writing shaders and breaking things, and at some point building a raytracer just seemed like the natural next step. We found "Ray Tracing in One Weekend" and made a pact to actually finish it in one weekend.

We did not finish it in one weekend.

Turns out understanding how rays bounce off spheres is one thing, but actually implementing it is another. Getting the vector math right, debugging reflections that look wrong for reasons you can't quite articulate, figuring out why everything keeps rendering too dark, all of that takes longer than you'd think. But that was kind of the point. We wanted to struggle through it and actually understand what's happening instead of just calling someone else's function.

There's this moment when it finally works where you're just staring at the output. You wrote code that simulates light bouncing around a scene, and now there's an image on screen that looks real. It's just math, but it doesn't feel like it.

Key Accomplishments

  • Implemented complete raytracing pipeline from scratch without graphics libraries
  • Built ray-sphere intersection, Lambertian diffuse, and metallic materials
  • Developed recursive reflection and refraction with configurable depth