You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 28 Next »

The Shadow Maps group of light attributes control the shadow map generation for the attached light source.

 

Generate Shadow Maps 

Toggle to enable the generation of a shadow map for this particular light. It is set to off by default. This attribute works in conjunction with the Auto-Generate Shadow Maps attribute in the Shadow Maps group of rendering attributes. They both have to be turned on for the shadow map to be generated.

Shadow Map Name

Specifies the file name of the shadow map. It is empty by default. The name can contain tokens (see File Path Expressions for recognised tokens). If the path name is relative, it is saved in the 3Delight ShadowMap Location defined in the 3Delight Data Locations. If this attribute is left empty, the shadow map name will be generated using each of the attached light node’s Shadow Map File Name, Add Scene Name, Add Light Name and Add Frame Ext attributes. This name generation will occur regardless of the light node’s Use Depth Map or Disk Based Dmaps attributes. Using this method (or using the <shape_name> expression), a single Light Attribute Node can be attached to several light sources and generate shadow maps for each and everyone of them, as long as they can all share the same parameters except for the file name. It is recommended to turn on the light node’s Add Frame Ext attribute if the Generate First Frame Only attribute is turned off. Note that a decent default file name is automatically generated when the "Generate Shadow Maps" toggle is turned on while the shadow map name is left empty.

Shadow Map Resolution

Specifies the image resolution for the shadow map. The default resolution is 512 x 512.

Shadow Map Shading Rate

Specifies the shading rate to use for rendering this shadow map. The default value is ‘1.0’. Note that the shading rate value specified here is not a multiplier of Shading Rate attribute in the Quality group of rendering attributes; it serves the same function but in the context of rendering the shadow map and it is used as specified here.

Shadow Map Type

Specifies the shadow map type to use: ‘normal’ or ‘deep’ (for deep shadow maps). A detailed description of the pros and cons of each type is provided in the following section.

Shadow Map Depth Filter

This attribute is only available when Shadow Map Type is set to ‘normal’. The value selected here defines what depth filter is used when rendering the shadow map. If some objects exhibits self-shadowing problems, adjust the ‘shadow bias’ value in the light shader (or the Maya light node if there are no RenderMan shaders attached to the light), or choose a different ‘depth filter’ value. The available values are: ‘min, ‘average’ and ‘midpoint' (the latest value is a little slower to compute but is usually very good at getting rid of the self-shadowing problems).

Volume Interpretation 

This attribute is only available when Shadow Map Type is set to 'deep'. The possible values are listed in the table below.

ValueDescription
Discrete

This value should be used to compute shadows cast by solid objects.

Continuous This value should be preferred for computing shadows cast by participating media (fog, clouds, smoke, etc.)

Distance Inside

Only useful for a specific hack where the deep shadow map contains the distance to the occluding surface (to render absorption, for example).

Shadow Map Pixel Samples

This attribute specifies in how many sub-samples each pixel will be subdivided for the deep shadow map rendering. The default is 2x2.

Generate First Frame Only 

If selected, 3Delight for Maya will only render the shadow map on the first frame of animation. This is a good choice when the objects that cast shadows are not animated. It is recommended to avoid inserting a ‘#’ in the "Shadow Map Name" attribute (or to check the "Add Frame Ext" attribute of the light node when the "Shadow Map Name" is left empty) when this option is turned on. By default, this attribute is set to off.

  Generate With Motion Blur 

When this attribute is on, the shadow map will be rendered using the same shutter opening and closing times as the camera used for rendering the frame. This will produce motion-blurred objects in the shadow map, provided that at least one object has at least one of the transformation blur or deformation blur options turned on. Since depth shadow maps do not contain any transparency information, they are not recommended for creating proper motion blurred shadows. The motion blurred portions of the shadow map will produce grainy shadows; however it is possible to blur these grainy parts to some extent using the light source shader’s "shadow blur" or "shadow filter size" attributes. Deep shadow maps are a better choice when motion blurred shadows are needed; however a moving, motion blurred, self-shadowing object will only be properly shadowed if the deep shadow map is not motion blurred. Refer to Motion Blur and Quality: Motion Blur for details on the motion blur options.

Generate Cube Shadow Map

If this light attribute is attached to a point light, you may want to generate a shadow map for each direction (since point lights illuminate in every direction). Enabling this toggle will force 3Delight for Maya to generate an aggregated shadow map that contain six shadow maps. This option is off by default.

Shadow Camera

Specifies what camera will be used to render the shadow map. When no camera is specified, the light source attached to this attribute node will be used to position the camera used for the shadow map rendering; in this case the camera’s angle of view is defined by the light’s cone angle (if the light source is a spotlight). By default, no camera is selected.

Near Clipping Plane
Far Clipping Plane 

Specifies the near and far clipping planes for the shadow map rendering. The default values are ‘0.001’ and ‘10000.00’ respectively.

Pros and Cons of Depth vs Deep Shadow Maps

Standard (Depth) Shadow Maps

These are normal shadow maps that, historically, have been widely used in the industry. They 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 information is 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 value for the "Filter Size" attribute on the light shape, one can simulate penumbra effects. This attribute is located in the "Shadows > Depth Map Shadow Attributes" group. When a light has an associated RenderMan light shader, this is usually controlled by a "blur" attribute directly on that shader instead.
  • They provide fairly good results when used carefully.

Now, the drawbacks:

  • Self shadowing. This is the most common problem encountered when using shadow maps. It appears as dark artifacts in areas that should appear completely lit. This problem can be resolved by using an appropriate value for the light shape's shadow bias attribute, located in the "Shadows > Depth Map Shadow Attributes" group. When a light has an associated RenderMan light shader, the bias is set directly on that shader instead.
  • Nearly impossible to generate high quality area shadows. Even if tweaking with shadow blur can give a nice penumbra effect, it is impossible to generate a true area shadow.
  • Expensive to generate really sharp shadows. This is because high resolution shadow maps are needed which often leads to longer render times and memory/disk usage.
  • No motion blur in shadows. Moving geometry still casts shadows. It is wise to remove motion blur when rendering shadow maps.
  • No colored shadows. Translucent surfaces cast opaque shadows.
  • Only objects that are in the shadow map cast shadows. That is why shadow maps work so well with spot lights: they light only 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 that is used to render the shadow map. If objects are too far (small in shadow map view), precision problems may arise and high resolution shadow maps are needed. If objects are too close and parts of them are clipped, shadows might be missed. 3Delight supports the ‘midpoint’ algorithm for normal shadow maps. This should help to get rid of shadow bias problems in most cases. The 'midpoint' algorithm can be chosen for the Shadow Depth Filter attribute.

Deep Shadow Maps

Deep shadow maps retain many of the features found in normal shadow maps and provide some more goodies:

  • Translucent shadows. Translucent surfaces cast correct shadows.
  • Shadows in participating media. It is possible to render volumetric shadows using DSMs.
  • Supports mipmapping. DSMs are mipmapped, which means that they exhibit much less aliasing artifacts than normal shadow maps.
  • Needs lower resolution. Instead of generating large shadow maps to boost quality, one can generate a smaller DSM by using higher PixelSample values when creating the DSM.
  • Copes well with fine geometric details. Fine details such as hair and particles can be handled without increasing the shadow maps resolution too much.
  • Since DSMs are prefiltered, render time lookups are faster (in general) than with normal shadow maps since the signal reconstruction step is more efficient. In addition, DSMs are more texture cache friendly than shadow maps.
  • Easily included in a rendering pipeline that already uses shadow maps. No modifications are necessary in shaders when changing shadow map format (normal or deep). That is because light shaders are programmed using the shadow() instruction that works with both formats.

Before throwing DSMs into the production pipeline, consider the following facts:

  • More expensive to compute. Generating good DSMs is generally slower than shadow maps. This is often the case when many PixelSamples are used during the generation step.
  • Needs more disk space. DSMs can grow quite large, mainly for two reasons: 1) DSMs are mipmapped by default and 2) more data is stored per texel.
  • Using the "midpoint" option to produce deep shadow maps can lead to unpredictable results!
  • No labels