Tutorials Index   Page 1 Page 2 Page 3 Page 4
Chapter 9 - Shadow types and their typical uses

 

 

Shadow Map

This is where one of my favourite features comes in - shadow maps. The real beauty of shadow maps is how good they can look compared to what a cheap trick they actually are. First of all, shadow maps can only be used with spotlights. Unfortunate, but true.

Shadow mapping uses a technique similar to how the camera determines whether or not areas are hidden from the camera's view, but instead of the camera, they determine what areas are hidden from the light's view. Areas that are hidden from the light's view are in shadow.

Now the true beauty of shadow mapping is not how it calculates its shadows but rather the fact that you can add fuzziness to the shadows. As with ray tracing, shadow maps and shadow fuzziness have their advantages and disadvantages. The great advantage to shadow fuzziness is that it is calculated very quickly and lets you avoid the very CG hard shadow look. LightWave simply blurs the shadow outline to make the shadow soft. Let's take another look at the shadow map options.

Shadow Map Size refers to the pixel dimension of the map. The default is 512, meaning the shadow map is 512 x 512 pixels. I often find this to be too small, resulting in obvious pixelation, or "jaggy" edges. You can either change the setting to create a higher resolution shadow map or increase the fuzziness to blur out the pixels, or both. I often use a fuzziness in the 10 to 20 range. Using a fuzziness of 0 will not blur the shadow map at all. You will see the sharp edge of the pixels unless you use a very high-resolution shadow map.

Beware: Shadow Fuzziness values that are too high can result in crawling shadow artifacts over an image sequence.

 

Figure 9.6: The Shadows sub-tab

The only real disadvantage to shadow maps is that they are soft-edged all the way around. Once again, real shadows tend to be harder near the object and softer farther away. If the area near an object is not obvious or not visible in the shot, you can safely use shadow mapping to add the softness to your shadows instead of the render-intensive area light method.

Shadow maps are typically used in situations where render speed is a big issue and the sharpness of shadows is not obvious or visible in frame, or where you only require soft shadows for the shot.

Spotlights with shadow maps can be used as skylight fill lights, for example. You might move a spotlight way up the Y-axis and spot the light down to a very small cone angle so that the light rays are somewhat parallel.

 

Note: To "spot" a light means to narrow its beam angle, while to "flood" a light means to widen its beam angle.

 

If you then turn on a high fuzziness and use a nice large shadow map size, the spotlight can provide a reasonable and very quick-rendering replacement of an area light or even a global illumination solution.

 

Figure 9.7: The top image used an area light for fill with ray tracing turned on. The bottom image, which is nearly identical, rendered in 0.06 the time - a significant speed increase for such an easy and effective trick.
The second image simply used the above-mentioned technique of using a spotted down spotlight with a high fuzziness. I set up the light, rendered once, adjusted the intensity once, rendered again, and very closely matched the original area-lit image.

 

 

Tutorials Index   Page 1 Page 2 Page 3 Page 4
Copyright © 2005 NewTek Europe