I'm implementing Peter Shirley's "Raytracer in a Weekend: The next week" and I'm having some trouble with rendering a scene with a light. I'm not sure if the issue is the background color or the light itself but the raytracer seems to be working fine in any scenes that have no lights.
The image rendered is supposed to be:
When I try to troubleshoot and change the background color to blue the image is:
Hopefully someone who has implemented this raytracer before or who has intuition about raytracing has an idea why this might be happening??
if(!scene.hit(r, 0.001, infinity, rec))
toif(!scene.hit(r, 0.01, infinity, rec))
and see if that changes anything. $\endgroup$