VII.6 SHADOW ATTENUATION FOR RAY TRACING TRANSPARENT OBJECTS
A trick I prefer is to attenuate the intensity of the light source based on the cosine of the incident angle of the shadow ray with the transparent object at each intersection along the shadow ray. The amount of attenua-tion is controlled by a scale value, which has a range from 0.0 to 1.0. The rationale for this trick is that shadows from glasses of water or crystal balls tend to focus light more toward the center of the shadow where the angle between the light rays and the surface normal is small. This is not always true; the focus can be totally outside of the shadow altogether, usually seen from objects with a high index of refraction. This trick is good enough to fool the eye on objects with small indices of refraction, such as glass ashtrays, plastic marbles, or bottles of beer.
|tm = MAX[0, 1 + (|
S is the normalized shadow ray direction vector
Nisthe surface normal vector (facing the eye)
The term tm is computed for every transparent surface intersected by the shadow ray and factored into ′kt , which is initialized to 1.0 for the shadow ray. Of course all of this work is wasted if the shadow ray strikes
GRAPHICS GEMS I Edited by ANDREW S. GLASSNER 398
GRAPHICS GEMS I Edited by ANDREW S. GLASSNER 399