Digital Cinematography
Arts Col 752
 

 


Shadows
In Maya, an individual light source can produce no shadows (default), depth map shadows or raytraced shadows. You can combine depth map shadow casting lights and raytraced shadow casting lights in a scene.

Depth map shadows and ray traced shadows produce similar results, though depth map shadows usually take less time to render. Generally, choose depth map shadows unless they cannot accomplish your visual goal.

Depth Map Shadows
Raytraced Shadows
Solving Shadow
Problems


  Depth Map Shadows

Depth map shadows can produce very good results in almost all situations, with marginal increase to rendering time.

A depth map represents the distance from a specific light to the surfaces the light illuminates. A depth map is a data file that contains the depth data rendered from a light's point of view. Each pixel in the depth map represents the distance from the light to the nearest shadow casting surface in a specific direction.

If a scene contains a depth map shadow casting light source, Maya creates a depth map file (stored as a Maya IFF File) for that light source during rendering and uses the depth map file to determine which surfaces are in shadow. In some cases, you can reduce rendering times by saving and reusing a depth map (with the Disk-based Dmap option settings).

  Depth Map Shadow Attributes

Dmap Resolution
The pixel resolution of the light's shadow depth map.

If the Dmap Resolution is too low, shadow edges appear jagged or pixelated. Increasing the Dmap Resolution also increases rendering times, so set it to the lowest value that produces shadows of acceptable quality. Default is 512.

Important Consideration for Dmap Resolution:
The shape nodes for all objects in your scene have a "casts shadows" option in the Render Stats section. By default (with Dmap Auto Focus) the shadow-casting light takes into account the size of every shadow-casting object (with the exception of the spot light). Turning off the "casts shadow" option for selected objects can dramatically affect the apparent resolution of shadows, e.g., the landscape or floor.

Spot lights calculate a depth map restricted to the cone angle. Reducing the cone angle can improve the apparent resolution of the depth map.

Dmap Filter Size
Controls the softness of shadow edges. (The softness of shadow edges is also influenced by the size of the shadow and the Dmap Resolution.) Increasing Dmap Filter Size also increases rendering times, so set it to the lowest value that produces acceptable results. A Dmap Filter Size of 3 or less is usually sufficient. The valid range is 0 to ·. The slider range is 0 to 5. The default value is 1.

Tip: If you want very soft shadows, use a low dmap resolution, then adjust this setting.

Use Mid Dist Dmap
If off, Maya calculates the distance from the light to the nearest shadow casting surface for each pixel in the depth map. If the distance from the light to another shadow casting surface is greater than the depth map distance, that surface is in shadow.

If on, for each pixel in the depth map, Maya calculates the distance from the light to the nearest shadow casting surface and the distance from the light to the next nearest shadow casting surface and averages them.

If the distance from the light to another shadow casting surface is greater than the depth map distance, that surface is in shadow. Use Mid Dist Dmap is on by default.

Use Dmap Auto Focus
If on, Maya automatically scales the depth map so that it only fills the area of the light's illumination that contains shadow casting objects.

For example, if shadow casting objects are only in the center of a spot light's beam, the depth map only covers the region occupied by those objects. Because the Dmap Resolution is an absolute resolution (that is, pixels, not pixels per inch), decreasing the size of the depth map effectively increases the resolution of the depth map and the quality of the shadows without increasing rendering times.

If off, you can manually scale the depth map within the area of the light's illumination using the Dmap Focus attribute (for point lights and spot lights) or the Dmap Width Focus attribute (for directional lights). Use Dmap Auto Focus is on by default.

Dmap Focus, Dmap Width Focus
The angle (Dmap Focus) or width (Dmap Width Focus) to scale the depth map within the area of the light's illumination. (You can scale the depth map automatically by turning on Use Dmap Auto Focus.)

Because the Dmap Resolution is an absolute resolution (that is, pixels, not pixels per inch), decreasing the size of the depth map effectively increases the resolution of the depth map and the quality of the shadows without increasing rendering times.

Dmap Focus is only available for point lights and spot lights if Use Dmap Auto Focus is off. The slider range is 0 to 360. The default value is 90.

Dmap Width Focus is only available for directional lights if Use Dmap Auto Focus is off. The valid range is 0 to ·. The default value is 100.

Use Light Position
Use Light Position is only available for directional lights. If on, only objects in front of the directional light's icon are lit and cast shadows. If off, objects both in front of and behind the directional light's icon are lit and casts shadows.Use Light Position is only available for directional lights. Use Light Position is off by default.

Dmap Bias
Offsets the depth map toward or away from the light. Adjust the Dmap Bias only if you encounter the following problems and cannot resolve them by adjusting other attributes:

If dark spots or streaks appear on illuminated surfaces, gradually increase the Dmap Bias value until the spots or streaks disappear.
If a shadow appears to be detached from the shadow casting surface, gradually decrease the Dmap Bias value until the shadow looks correct. The slider range is 0 to 1, but you can type in a higher value. The default value is 0.001.

Fog Shadow Intensity
Controls the darkness of shadows appearing in illuminated (light) fog. The valid range is 1 to 10. The default value is 1.

Fog Shadow Samples
Controls the graininess of shadows appearing in illuminated (light) fog. Increasing Fog Shadows Samples also increases rendering times, so set it to the lowest value that produces acceptable results. Shadows that are cast from very narrow objects into illuminated fog may shift during an animation. In this case, increase the Vol Shadow Samples value. The default value is 20.

Disk Based Dmaps
Lets you save a light's depth maps to disk and reuse them during subsequent renders. By saving depth maps to disk, and reusing them later, you can decrease the time it takes to render the scene (see Reuse depth maps). Depth maps are saved in the renderDate/depth directory.

Off
Maya creates new depth maps during rendering. Maya does not read depth maps from disk. Maya does not save depth maps to disk.

Overwrite Existing Dmap(s)
Maya creates new depth maps, and saves them to disk. If depth maps already exist on disk, Maya overwrites them. When you write them to disk, you get two dmaps: One is the first shadow casting surface, the other is the second shadow casting surface.

Reuse Existing Dmap(s)
Maya checks to see if depth maps have previously been saved to disk. If so, Maya uses them instead of creating new depth maps. If not, Maya creates new depth maps and saves them to disk.

Tip:
If you are saving depth maps to disk, check the renderDate/depth directory occasionally, and remove any unnecessary depth map files.
 


  Raytraced Shadows
  Raytraced shadows can produce soft and transparent shadows but can be very time consuming.

Raytracing is a type of shadow rendering where the path of individual light rays are calculated from their source (the light) to their destination (the camera).

Use raytraced shadows only to produce more physically accurate shadows (like those in the real world).
Common purposes include:

  • (for area lights only) where shadows blur and become lighter as they increase in distance from the object
  • to produce shadows from transparent colored surfaces
  • to produce soft-edged shadows (though depth maps can also produce good results)

  Raytraced Shadow Attributes:
  Shadow Radius, Light Radius, Light Angle
Controls the softness of shadow edges by setting the size (Shadow Radius or Light Radius) or angle (Light Angle) of the light. For example, a large light produces softer shadows than a small light. The light radius is also used for light glows to determine the occlusion/visibility (for point and spot lights).

The Shadow Radius attribute is only available for ambient lights.

The Light Radius attribute is only available for point lights and spot lights. The slider range is 0 (hard shadows) to 1 (soft shadows). The default value is 0.

The Light Angle attribute is only available for directional lights. The slider range is 0 (hard shadows) to 180 (soft shadows). The default value is 0.

Shadow Rays
Controls the graininess of soft shadow edges. Increasing the number of Shadow Rays also increases rendering times, so set it to the lowest value that produces acceptable results. The slider range is 1 to 40. The default setting is 1.

Ray Depth Limit
Ray depth specifies the maximum number of times a light ray can be reflected and, or refracted and still cause an object to cast a shadow. Transparent objects between those points in which the ray changes direction will have no affect on the light ray's termination. This can best be visualized by example in which the ray traced shadow is visible on both the ground plane and reflection plane. If the ray depth is set to 1, the shadow will only be visible on the ground plane. If the ray depth is set to 2, the shadow will be visible on both the ground plane and the reflected plane.