Shadows are an important scene element because they secure an object's placement in a scene. Objects without shadows look free floating (Figure 15.60) and, by extension, unrealistic. Shadows are also important artistically. Most lights in Maya have the option to cast shadows, but you only want a few in each scene to cast them; the most dramatic effects are produced with a few bold shadows. Figure 15.60. Shadows help to visually plant objects on the ground.
A real-world shadow is the complementary color of the light source: The sun is yellow; therefore, the shadows it casts are purplein essence, there are no black shadows in the real world, only very dark representations of a particular color. Keep this in mind as you create both realistic and artistic shadows: If you apply this principle to your 3D work, you'll produce deeper, richer imagery. A real shadow is darkest close to an object, fading and blurring as it gets farther away (Figure 15.61). The bounce of light and variations in light source illuminate a shadow and ensure it isn't pitch black (Figure 15.62). A shadow that is very precise or very dark will stand out and thus appear unrealistic. Figure 15.61. A real shadow's darkest area is slightly away from the object's edge, near the base of the shadow.
Figure 15.62. Light from bright areas leaves from more than just one point. In the areas where light is partially blocked, a light, blurry shadow forms (Top). The closer a shadow is to the object that casts it, and the smaller the source, the sharper a shadow gets (Bottom).
Creating shadowsShadows are turned off on all lights by default. To see shadows in a render, you must turn them on. Because you will have many lights in most scenes, you should turn on shadows for only a few key lights. Always try to ensure that your shadows come from obvious light sources. Another way to help your shadows look good is to be sure you don't have too many in your scene. Too many shadows can look as odd as none (Figure 15.63), and Maya gives you the ability to limit the shadows cast by objects. An individual object doesn't cast a shadow if shadow casting is turned off on the object. This applies even if the object is struck by a shadow-casting light. Figure 15.63. Too many shadows make it hard to tell what is going on.
Maya uses two types of shadows: depth map (Figure 15.64) and raytraced (Figure 15.65). Both methods can produce good-looking shadows, although raytracing often produces more realistic shadows with less effort and tweaking. However, raytraced shadows can take much longer to render than depth-map shadows, so the choice is a trade-off. It's a constant battle to produce good-looking shadows while keeping rendering time to a minimum for each scene. Figure 15.64. Depth-map shadow.
Figure 15.65. Raytraced shadow.
Depth-map simulated shadows are usually much faster to render than raytraced shadows, but you pay for that speed with increased RAM use at render time. A depth map is an image file that contains a depth channel (a grayscale representation of how far objects are from the camera, the lights, and each other) rendered from a light's point of view (Figure 15.66). Maya uses the depth map to determine which surfaces have light hitting them and which surfaces are in shadow. Think of the depth map as a pre-drawn shadow brought into the scene just before it's rendered. This image is then projected from the light's point of view, like a texture, darkening the areas where shadows should be. The image resolution and your object's distance from the light are key to ensuring a good-looking depth map. If you need to redo a render, these depth-map image files can be reused, saving even more rendering time. Figure 15.66. On the left is a render of the scene, on the right is the depth map used to determine which objects are closest to the light.
In most scenarios, raytraced shadows produce great-looking, realistic imagesresults you wouldn't be able to achieve with depth-map shadows. One example is a transparent shadow cast from a partially transparent object (Figure 15.67). Figure 15.67. A depth-map shadow can't show an object's transparency within the shadow (top);a raytraced shadow can (bottom).
However, raytraced shadows have some restrictions as well. For one, they don't show up if rendered with interactive photorealistic rendering because IPR doesn't allow raytracing. This represents an additional speed cost because you can use IPR to see depth-map shadows, making depth-map shadow adjustment much faster. You can also preview light placement and depth-map shadows using the shaded mode in any view. Depth-map shadowsDepth-map shadowswhich are available in all but ambient lightcan simulate relatively realistic shadows without greatly affecting rendering time. To create a depth-map shadow:
To preview depth-map shadows:
The following are common depth-map shadow attributes:
Raytraced shadowsRaytraced shadows can create highly realistic shadows but also add expensive rendering time. To produce raytraced shadows, you must check three things:
To create a raytraced shadow:
The following are common raytraced shadow attributes:
|