Reuse depth maps

If you use depth map shadows, by default Maya calculates at least one depth map for each depth-map enabled light source and for each frame of the animation during rendering.

In some cases, you can reduce rendering times by saving and reusing a light’s depth map. See the following table to determine if reusing a depth map is advantageous for your particular circumstance.

Maya saves depth map files in the renderData/depth directory of the current project, by default.

If you are... Do this...

Rendering a single frame several times, each time making adjustments to object or light properties, but not moving lights or objects.

(The depth map does not change and can be reused.)

  1. Select the light.
  2. In the Attribute Editor, set Disk Based Dmaps to Reuse Existing Dmap(s).

    Maya calculates and saves the depth map the first time you render, then reads the depth map from disk on each subsequent render.

Rendering an animation in which the light or the objects it illuminates do not move (for example, a camera fly-through).

(The depth map does not change from frame to frame and can be reused.)

  1. Set Disk Based Dmaps to Reuse Existing Dmap(s).
  2. Turn off Add Frame Ext.

    Maya calculates and saves the depth map when it renders the first frame. During each subsequent frame render, Maya reads the depth map from disk.

Rendering an animation in which lights, the objects they illuminate, or both do move, the depth map changes from frame to frame.

If you are rendering the entire animation several times, each time making adjustments to object or light properties, but not changing the way lights or objects move, the depth maps for each frame is the same as in the initial render and can be reused.

  1. Set Disk Based Dmaps to Reuse Existing Dmap(s).
  2. Turn on Add Frame Ext.

    Maya calculates and saves the depth maps for each frame the first time you render, and reads them from disk during subsequent renders.

Rendering a single frame or an animation, have previously saved depth maps to disk, and have moved lights and, or the objects it illuminates.

The depth maps are now different, and you cannot reuse the depth masks on disk.

  1. Set Disk Based Dmaps to Overwrite Existing Dmap(s).
  2. Render the frame or animation once.

    Maya calculates and saves the depth map(s), overwriting any that already exist.

  3. (Optional) If you plan to continue adjusting object or light properties, but not move lights or objects, you can set Disk Based Dmaps back to Reuse Existing Dmap(s).
Important: If you no longer want to use the depth maps saved to disk, set Disk Based Dmaps to Off so that Maya starts to calculate the depth maps again, every time you render. (When Disk Based Dmaps is Off, Maya does not read or write depth maps to disk.)

Related topics