This is (or at least used to be) a right of passage in the graphics world.
I think many people go through the very popular https://raytracing.github.io/
There was a big influx of this when Sebastian Lague did his video series on building a ray tracer.