ShaderMap CL Commands

ShaderMap CL Commands are made up of 3 parts:
Command, [Filepath], and Arguments with parameters.

Command keywords are usually followed by the Filepath (but not always) which either represents the load or the save path depending on the command. Filepaths are encased in double quotes (ex. "c:\image.bmp").

After the Filepath comes any number of Arguments. Arguments begin with a dash (ex. -disp). Most arguments (not all) have parameters associated with them. There must be a single space between an argument and its parameters. Argument parameters are encased in parenthesis and separated by commas (no spaces).

An example command with arguments and parameters is shown below:
cnorm "c:\wave_normal.tga" -dudv (-100,xy) -spec (-100,22,-15,xy)

Convert Diffuse Command ( cdiff )
cdiff converts a diffuse map into displacement, normal, ambient occlusion, specular, and dudv maps. It does this by first converting the diffuse texture to displacement then creating the other maps from the displacement. If a displacement argument (-disp) does not follow the command it will still create the dependency displacement map before rendering the other maps and will do so using the -disp default parameters. It is a good idea to use the -disp argument when converting diffuse maps as it will allow a greater control over other maps (ex. Decreasing the post blur of the displacement will result in sharper normal maps).
cdiff [filepath] -[map argument] ([parameters])
The cdiff [filepath] part is the diffuse source image path.



Convert Displacement Command ( cdisp )
cdisp converts a displacement map into normal, ambient occlusion, specular, and dudv maps. It cannot create another displacement map from the source displacement map at the moment. cdisp uses the source displacement map to create the other maps and does not need to pre-render any dependency maps as cdiff does and is therefore much faster than cdiff.
cdisp [filepath] -[map argument] ([parameters])
The cdisp [filepath] part is the displacement source image path.



Convert Normal Command ( cnorm )
cnorm creates a modified normal map and from the source normal map. It also converts the source normals into displacement, ambient occlusion, specular, and dudv maps. It does this by first converting the normal map to displacement then creating all other maps from the displacement. As with cdiff, including the displacement (-disp) argument will give you greater control over the conversion process. As said, cnorm will allow you to create a modified normal map from the source normals. It can modify the direction of the x and y values as well as adjust the intensity of each normal.
cnorm [filepath] -[map argument] ([parameters])
The cnorm [filepath] part is the normal source image path.



Set Output File Properties Command ( fprop )
fprop sets the output file format and file suffix for each map type created by ShaderMap CL. This command has no [filepath] part as no files need to be saved or loaded. fprop saves file output settings in a file called "fprop.smdat" in the ShaderMap CL program directory. Once settings are changed they will stay active for all maps created until they are changed using fprop again. Arguments for the fprop command are discussed in ShaderMap CL Arguments.
fprop -[map argument] ([filetype],[suffix])
File types are defined in Output Settings.


Pack Channels Command ( pchan )
The pchan or pack channel command allows you to create a new image from existing channel data stored in images. It is also useful to rearrange channels (ex. RGBA -> ABGR). This is helpful when adding an 8 bit map into the alpha channel of a 24 bit map (ex. specular in normal map).

The pchan [filepath] part is a save path for the final image. The save image must support 32 bits/pixel (ex. TGA) if the alpha channel is to be used.
pchan [filepath] -src ([parameters])
Any combination of rgba can be used for channels (ex. r, ga, bga, bag, are all valid). There can be up to four -src arguments following the [filepath]. Each -src argument defines a source image path, the source channels, and the destination channels. Below is an example that stores an ambient occlusion map inside a normal map
pchan "c:\norm_final.tga" -src ("c:\norm.tga",rgb,rgb,*) -src ("c:\ambo.jpg",r,a,*)