Project 4

Reflections and Refractions

Ray Traced View

Ray tracer MK4, (extra shiny version). We're now rendering reflections (on the left) and refractions (on the right)

Effects of Absorption

As light travels through a refractive surface, part of that light is absorped. For example, the above image's right sphere is absorbing more light than the top picture, resulting in a more bluish hue.

Effects of Index of Refraction

In this image, I changed the index of refraction of the right sphere from 1.5ish to 1.9 (from glass to diamond). As a result, refracting rays bend more, and more of the scene can be viewed in the refraction.

Lots of reflections, just for fun

This is what happens when everything reflects, and when you turn things up to 11. Beautiful.

Bugs

I had a killer bug with my refractions, which i'm showing off in this photoshopped image. When a ray is transmitted through the glass sphere, I wasn't checking for reflections off back faces. The fix was to check both back and front faces when sampling reflections.

Timing

0:00:01

Hardware

Intel HD Graphics 620, Intel Core i7 - 7500U CPU @ 2.7GHz, 16GB of memory