Chapter 11
Reflection and Refraction

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:

images/reflection/reflect-refract.png

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!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.149.242