Detail Shadow Map Copy: dsm_copy 3.9

The detail shadow map copy utility for mental ray. It converts detail shadow map files generated by mental ray to regular image files for display and inspection purposes.

Usage

The detail shadow map copy utility is started similar to image copy:

dsm_copy [options] detailshadowmap outfile [outformat[outtype]]

It reads a detail shadow map file detailshadowmap created with mental ray and writes the converted image into outfile using the file format outformat and the data type outtype. If no output format is specified then the file name extension of outfile is used to determine the format. If no output type is given then the default data type of the file format will be taken.

The default mode generates an image where depth is encoded as gray-scale color and infinity, area without occluders, is shown in dark blue. Although detail shadow maps may store multiple depth samples per pixel this utility only considers the lowest depth sample for conversion.

Note The detail shadow maps store additional color or alpha values with depth. If shadows are colored then this color will be stored in the final image when using the color or layeroption.

Options

The following options are supported:

-c
Color mode: combine color and depth into color image with transparency.
This mode produces a color image, where color is taken directly from a color mode detail shadow map, or a gray-scale color is generated from a alpha mode map. The depth values are mapped into the [0 … 1] range so that pixels at the lowest depth, closest to the light, display as fully opaque, and pixels at the highest depth, furthest away from the light, as fully transparent.
-h
Print brief help text.
-l
Layer mode: put color and depth as color and alpha channels of the image.
This mode produces a color image similar to color mode. But, the depth values stay untouched for inspection in special tools like compositing packages. Since depth values typically exceed the [0 … 1] range the output format should be able to store floating point data. Common image viewers may not be able to display such images correctly.
-v
Print verbose detail shadow map information, progress messages, and version banner.
Example

Convert a detail shadow map to a LDR 8-bit color image for display. The depth is encoded as gray-scale color values, the color value of the shadow map pixel is not transferred. The output format and type is determined from the file extension .tif, resulting in a TIFF image with default data type 8-bit RGBA:

dsm_copy shadows.dsm shadows.tif

The will result in an image looking similar to this:

image1

Generate a LDR 8-bit color image in color mode that stores the color value of the shadow pixel together with the depth which is encoded as transparency.

dsm_copy -c shadows.dsm shadows.tif

The will result in an image looking similar to this. The left screenshot shows color display when blended onto a checkerboard background, the right shows the alpha channel.

image2 image3

Convert a detail shadow map to a HDR 32-bit color image file that keeps the shadow color and depth values intact, storing depth directly into the alpha channel for inspection. Enforce floating-point output data type.

dsm_copy -l shadows.dsm shadows.tif tif rgba_fp

Copyright © 1986, 2013 NVIDIA Corporation