5.1.1 Standard Shadow Maps
Those are normal shadow maps that are widely used in the industry. Generating such shadow maps implies placing the camera at the position of the light source and rendering the scene from that view point (`zfile' or `shadowmap' display driver has to be selected, see section 7.3 The zfile display driver and section 7.4 The shadowmap display driver). The shadow map is then used from inside a light source shader to cast shadows on objects. Shadow maps have a number of advantages:
- They are fast to generate. Indeed, shadow maps can be generated much faster than a normal "color" image, mainly because only depth informations are needed. When rendering a shadow map, one could remove all surface and light shaders, even displacement shaders can be removed if they do not affect the geometry too much. Also, filtering (using
PixelFilter
command) can be lowered (even to 1x1) and ShadingRate
increased (up to 10 or more).
- They can be reused in more than one render. If the scene is static and only the camera moves, a generated shadow map can be used for all subsequent renders. This often happens in the lighting stage of a production pipeline;
- They can be used to generate low cost penumbra. Specifying an appropriate blur to the
shadow()
call, one can simulate penumbra effects;
- They provide fairly good results when used carefully. Many of the recent CG productions use normal shadow maps and obtain excellent results.
Now, the drawbacks:
- Self shadowing. The most common problem encountoured when using shadow maps. It appears as dark artifacts in areas that should appear completly lit;
- Nearly impossible to generate high quality area shadows. Even if tweeking with shadow blur can give a nice penumbra effect, it is impossible to generate a true area shadow;
- Expensive to generate really sharp shadows. High resolution shadow maps are needed which often leads to higher render times and memory/disk usage;
- No motion blur in shadows.
Moving geometry will cast still shadows, it is wise to remove motion blur when rendering shadow maps;
- No coloured shadows. Translucent surfaces will cast opaque shadows;
- Only objects that are in the shadow map can cast shadows. That is why shadow maps work so well with spot lights: they can only light a limited field of view. Point lights are more tricky to handle (need six shadow maps) and distant lights are difficult to setup with shadow maps.
When creating shadow maps, make sure that shadow casting objects are framed correctly (and tightly) in the camera view which is used to render the shadow map. If objects are too far (small in shadow map view), precision problems may arise and high resolutions shadow maps will be needed. If objects are too close and parts of them are clipped, shadows might be missed.
3Delight supports the "midpoint" (section 4.1 Options) algorithm for normal shadow maps. This should help you get rid of shadow bias problems in most cases.
This document was generated
by Aghiles Kheffache on July, 31 2003
using texi2html
3Delight 1.0.0. Copyright 2000-2003 The 3Delight Team.
All Rights Reserved.