Shader authoring/Compile Pipeline

From Valve Developer Community
Revision as of 18:09, 19 February 2009 by ChrysalisX (talk | contribs) (New page: {{shadertut}} The pipeline to actually go from .cpp and .fxc files to a working and compiling shader is quite complex and has a history of causing problems. This document will aim to desc...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The pipeline to actually go from .cpp and .fxc files to a working and compiling shader is quite complex and has a history of causing problems. This document will aim to describe all of the steps of the Valve shader compiling pipeline to assist user understanding, aid trouble shooting efforts, and serve as a quick reference guide.

The stages of the pipeline are listed in order, and each entry will describe the command line format and the purpose of the script. Command line arguments place [] around paths/user variable inputs and the placeholder names will include any file type extensions if they should be included.

buildsdkshaders.bat

Command Line : buildsdkshaders.bat [shaderproj] -game [moddir] -source [srcdir]

shaderproj : The name of a text file (with no extension) containing the names of the shader files to be compiled, one per line.

moddir : The mod directory located in <steamdir>/steamapps/sourcemods/

srcdir : The directory containing the source, Ex: C:\MyMod\src

Functions: 1.Checks for and creates the folders shaders\fxc, shaders\vsh, and shaders\psh. 2.Deletes the old filelist.txt and filestocopy.txt files. 3.Calls devtools/bin/updateshaders.pl to generate a makefile titled makefile.shaderproj where shaderproj is the same as the command line argument. 4.