Simulating Shadow Rays

[ LiB ]

Simulating Shadow Rays

Wow, you've come a long way and now you can do many wonderful natural lighting effects such as diffuse interaction on surfaces, specular reflection, specular highlights, and refraction. But you're still missing one very important natural lighting effect. Shadows are very important to simulating real-world examples because shadows are the most common lighting effect you see. You need to simulate shadows in your rendering environment using ray tracing. Shadows are very simple to simulate using ray tracing. In order to do diffuse shading on a surface you need the point of intersection. This same point of intersection is needed to do shadows.

This point can be used as the origin of the shadow ray. The direction of the shadow ray is the point of intersection towards the light source. If any other object in the scene is blocking this line of sight between the point of intersection and the light source, this is considered a shadow and must be shaded accordingly . As you can see from the previous figure, the sphere casts the shadow on the flat polygon because it obstructs the line of sight between portions of the polygon and the light source. In order to simulate shadows, you need a function that determines whether the line of sight between two vec-tors is obstructed by objects in the scene. This effect can be easily applied to the shade point method.

[ LiB ]


Focus On Photon Mapping
Focus On Photon Mapping (Premier Press Game Development)
ISBN: 1592000088
EAN: 2147483647
Year: 2005
Pages: 128
Authors: Marlon John

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net