ShaderMap CL Arguments

Types of Arguments
There are two types of arguments in ShaderMap CL commands, those with parameters and those without.
-arg1 (param,param,param) // With parameters
-arg2 // Without parameters
It should be remembered that any argument parameter can be replaced with a * character. This will tell ShaderMap CL to use a default value for the parameter value.


Universal Arguments
A universal argument can be used with every ShaderMap CL command. There is only one such command -v. -v (verbose) instructs ShaderMap CL to output progress to the console window. It has no parameters. An example usage:
cdiff "source.jpg" -disp (*,*,*,*) -v

CDIFF, CDISP, and CNORM Shared Arguments
There are a number of arguments that the conversion commands share. Each has to do with the type of map to be created from the source image. They are listed with their parameter names below.
-disp ([smooth],[level],[postblur],[wrap]) // Create displacement

  • [smooth] is a value between 0 - 100.
  • [level] is a value between -100 - 100.
  • [postblur] is a value between 0-100.
  • [wrap] is one of the following values: 0 = no wrap, x = wrap horizontally, y = wrap vertically, xy = wrap both directions.

-norm ([level],[intensity],[wrap],[invert]) // Create normal

  • [level] is a value between -100 - 100.
  • [intensity] is a value between 0 - 500.
  • [wrap] is one of the following values: 0 = no wrap, x = wrap horizontally, y = wrap vertically, xy = wrap both directions.
  • [invert] is one of the following values: 0 = no inversion, x = invert x component, y = invert y component, xy = invert both x and y.

-ambo ([pixelbase],[samples],[heightbias],[shadowintensity],[postblur],[normalize],[wrap]) // Create ambient occlusion

  • [pixelbase] is a number from 0 - 100 and is the starting brightness of each pixel.
  • [samples] is a number greater than 0 and is the number of surrounding pixels sampled divided by 8.
  • [heightbias] is a number between 0 - 100 where 0 is all height displacements are used and 100 is no height displacements are used.
  • [shadowintensity] is a value between 0 - 100.
  • [postblur] is a value between 0 - 100.
  • [normalize] is either 0 or 1.
  • [wrap] is one of the following values: 0 = no wrap, x = wrap horizontally, y = wrap vertically, xy = wrap both directions.

-spec ([level],[brightness],[contrast],[wrap]) // Create specular

  • [level] is a value between -100 - 100.
  • [brightness] is a value between -100 - 100.
  • [contrast] is a value between 0 - 100.
  • [wrap] is one of the following values: 0 = no wrap, x = wrap horizontally, y = wrap vertically, xy = wrap both directions.

-dudv ([level],[wrap]) // Create dudv

  • [level] is a value between -100 - 100.
  • [wrap] is one of the following values: 0 = no wrap, x = wrap horizontally, y = wrap vertically, xy = wrap both directions.

-pv ([bounding_box_size]) // Create fast preview maps

  • [bounding_box_size] is a positive number which represents a bounding box (n x n) in pixels. This bounding box defines the maximum preview image size.

-od ([output_directory]) // Set output directory for maps.

  • [output_directory] is a string with the path to the output directory.

CNORM Specific Arguments
There are two arguments that are specific to the cnorm command. They are arguments without parameters and used to control the conversion of the normal map to a displacement map.
-i[x][y][xy] // -ix, -iy, or -ixy
-m[1][2] // -m1 or -m2
The -i [] argument tells ShaderMap CL to pre invert the normals before conversion to displacement. It is sometimes necessary to use this argument if the normal map was created with either the x or y values inverted.

The -m [] argument controlls the conversion method used to convert the normals to displacement.

  • -m1: Method 1 of converting norm to disp. This is the preferred method and is the default when no method argument is set.
  • -m2: An experimental method for converting "hard-to-convert" normal maps. The displacement map will not be exact but can still be useful.

Here's an example conversion from normal to displacement using method 1 and a preflip on the x axis:
cnorm "c:/norm.tga" -disp (*,*,*,*) -m1 -ix

FPROP Specific Arguments
The fprop command can have the following arguments. Each argument sets the file type and file suffix for a map that ShaderMap CL generates.
-disp ([filetype],[suffix]) // Displacement output
-norm ([filetype],[suffix]) // Normal output
-ambo ([filetype],[suffix]) // Ambient Occlusion output
-spec ([filetype],[suffix]) // Specular output
-dudv ([filetype],[suffix]) // Dudv output
For more on the fprop command, and to see a list of filetypes, read Output Settings. Remember that any filetype or suffix can be reset to default by placing the * character for its corresponding property value.


PCHAN Specific Arguments
pchan can have up to four -src arguments. The -src argument controls what image the color channels are taken from, which channels are taken, and where channels are placed in the destination image. The -src argument is shown below:
-src ([source filepath],[source channels],[destination channels],[is_delete])
The source filepath is a string (ex. "C:\source.bmp"). The source channels are any combination of the letters r g b or a (ex. abg). The destination channels are again any combination of the letters r g b or a (ex. arb). Take a look at the following command:
pchan "output.bmp" -src ("input.bmp",bga,rgb,*)
Here the blue channel is being copied to the red channel of the output.bmp. The green is copied to the green channel and the alpha channel to the blue channel. The number of channels must be the same in source and destination properties.

The [is_delete] parameter can be set to 1 to delete the source image after packing the channels. Set [is_delete] to 0 or * to leave source image on the disk after packing.