Home ShaderMap Legacy

Useful CL Scripts

I took these scripts from the old forums. They were originally created by Z-O-M-B-I-E and musikai

Script for converting of directories, instead of on one file.
REM Convert diffuse map (cdiff) to displacement, normal, and specular
REM * parameters are default -v is verbose
START /WAIT D:\Programs\ShaderMap\shadermap.exe fprop -norm (TGA32,_NORM)
for %%I in (C:\Z-O-M-B-I-E\compile\stalker\crete\*.tga) do D:\Programs\ShaderMap\shadermap.exe  cdiff %%I -norm (*,50,*,*) -v -od "C:\Z-O-M-B-I-E\compile\stalker\crete"

--

Here is a script to convert all JPG files in a folder to normal maps:
CD "C:\Program Files (x86)\ShaderMap Pro 1.3.1"
for %%I in ("C:\Test Folder\*.jpg") do START /WAIT shadermap.exe cdiff "%%I" -norm (*,50,*,*) -v -od "C:\Test Folder"

The first line changes the directory to where the ShaderMap.exe is installed, it is sometimes at C:\Program Files\ShaderMap Pro 1.3.1 on 32 bit systems. It will be unique to your system.

The second line takes all files with .jpg extension in folder C:\Test Folder and converts them to normal maps. It uses the -od parameter to tell ShaderMap.exe where to save the final files.

--

here's a batchfile.bat that allows drag'n drop of multiple files.
it saves to d:\sm\out.
displace, normal, spec, ao:
START /WAIT "" "C:\Program Files (x86)\ShaderMap CL 1.2.2\shadermap.exe" fprop -norm (TGA32,_NORM)
for %%A in (%*) do "C:\Program Files (x86)\ShaderMap CL 1.2.2\shadermap.exe" cdiff %%A -disp (*,*,*,xy) -ambo (*,*,*,*,*,0,xy) -norm (*,50,xy,*) -spec (*,10,*,xy) -v -od "d:\sm\out"

Delete the -od "d:\sm\out" at the end to use the same folder as target folder. You can also create a desktop shortcut and drag the files on it. Or make a shortcut in your SendTo directory (C:\Users\yourname\AppData\Roaming\Microsoft\Windows\SendTo).

(Ah yes, never use () in your filenames like grass(22).jpg)

--

Heres is a drag and drop batch with choices.
After draggin images on it you can press number 1,2 or 3
@echo off
 title shadermap choice

 echo 1. norm
 echo 2. disp-norm-spec
 echo 3. disp-norm-spec-ao


choice /n /c 1234 /t 99 /d 4 /m Pick:

SET choicenum=%ERRORLEVEL%
 IF %choicenum% EQU 1 goto 1
 IF %choicenum% EQU 2 goto 2
 IF %choicenum% EQU 3 goto 3
 IF %choicenum% EQU 4 goto end


 :1
 cls
 echo creating norm
START /WAIT "" "C:\Program Files (x86)\ShaderMap CL 1.2.2\shadermap.exe" fprop -norm (TGA32,_NORM)
for %%A in (%*) do "C:\Program Files (x86)\ShaderMap CL 1.2.2\shadermap.exe" cdiff %%A -norm (*,50,xy,*) -v 
Goto End

 :2
 cls
 echo creating disp-norm-spec
 START /WAIT "" "C:\Program Files (x86)\ShaderMap CL 1.2.2\shadermap.exe" fprop -norm (TGA32,_NORM)
for %%A in (%*) do "C:\Program Files (x86)\ShaderMap CL 1.2.2\shadermap.exe" cdiff %%A -disp (*,*,*,xy) -norm (*,50,xy,*) -spec (*,10,*,xy) -v 
Goto End

 :3
 cls
 echo creating disp-norm-spec-ao
 START /WAIT "" "C:\Program Files (x86)\ShaderMap CL 1.2.2\shadermap.exe" fprop -norm (TGA32,_NORM)
for %%A in (%*) do "C:\Program Files (x86)\ShaderMap CL 1.2.2\shadermap.exe" cdiff %%A -disp (*,*,*,xy) -ambo (*,*,*,*,*,0,xy) -norm (*,50,xy,*) -spec (*,10,*,xy) -v 

:End
Sign In or Register to comment.