Next: Constructive Solid Geometry Up: Algorithms Previous: Reflection

Refraction

Refraction, like reflection, involves the generation of recursive secondary rays. As such, they too are resticted in depth so that a ray may only be bent a finite number of times.

When considering refraction, I ran into a huge stumbling block. The problem I encountered is that for curved objects (i.e., spheres), the object can act like a lens and cause multiple light rays to focus on a single point. This would mean that for my tower inside the crystal ball, to correctly simulate physical lighting, I would have to integrate all the possible light rays which could focus at each point. I considered this impractical. As a result, while providing a partial appearance of refraction, my implementation of refraction is not physically correct. My implementation of refraction involves only refracting the viewing ray; that is, only the ray from the eye to the object. Once this ray has hit an object, I shoot a ray from the point light source directly at this intersection point. If the light ray hits a transparent object, it passes through the object without refracting. The intensity of the light is attenuated based upon the transparency factor of the object. This has the effect that the object is correctly distorted according to the laws of refraction, and light is attenuated according to the ``tint'' of the object, but the lighting of the object is still physically incorrect.

The source for refraction can be found in the file render.c, in the function RefractRay.


awscreen@noether.math.uwaterloo.ca
Wed Aug 2 20:30:34 EDT 1995