All right. Hang on to your passenger assist handle, because you’re about to add another bit of material finesse to your ray tracer. Check out this sneak preview:
That’s right, boys and girls. You’re going to make objects reflective and transparent. Mirrors and glass marbles will be your oyster.
Both of these work through similar means: spawning an additional ray at the point of intersection and recursively following it to determine the color at that point. You’ll tackle them one at a time: reflection first, and then transparency and refraction.
Are you ready? Here goes!
18.224.149.242