Now that we have reflection in our scene, we can go ahead and add refraction. The computation for refractions is based on snell’s law and is a bit more complex than reflections, but nonetheless, since we already have our raytracer setup to spawn additional rays, it’s not too difficult to add support. Below is our scene with transmission enabled to make a glass-like sphere: