DEV Community

Pranjal Sailwal
Pranjal Sailwal

Posted on

Building a spectral ray tracer, one wavelength at a time

I built Monte Carlo Spectral Ray Tracer as a C++14 ray tracer that traces light through a scene with Monte Carlo sampling and wavelength-based color calculation instead of only RGB shortcuts.

What made this project interesting was how much of the light pipeline had to be made explicit: a spectral power distribution over 380–780 nm, a Ray structure with time support for motion blur, Fresnel handling for dielectrics and conductors, BVH construction for faster intersection checks, and a heterogeneous Volume class for participating media.

It was a useful reminder that rendering is mostly careful bookkeeping: the right sampling, the right geometry, and enough patience to let the image come together.

Repo: spectral-monte-carlo-raytracer

Paper: Read Paper

Open to remote tech consulting, Senior Software Engineer, and SDE roles.

Top comments (0)