Game Development Community

dev|Pro Game Development Curriculum

Compile HLSL shaders in Visual Studio IDE

by Kevin Johnson · 07/09/2005 (12:08 pm) · 2 comments

Create a folder in your TSE project named something useful like HLSL. From there i create subfolders for each target. Add your hlsl to this folder (rightclick->add existing)

www.intersticesthegame.com/~lagalot/images/solution.JPG
Rightclick on your newly added file and go to properties

www.intersticesthegame.com/~lagalot/images/properties.JPG
A window similar to the one below should appear

www.intersticesthegame.com/~lagalot/images/build%20prop.JPG
Drill down to Custom Build Step->General
and fill in the fxc.exe command line ( with arguments ) like this:
Command Line: "C:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Utilities\fxc.exe" /Tvs_2_0 $(InputPath)
Outputs: $(InputName)

This would compile the file with profile vs_2_0, and should give you output a little like this:

www.intersticesthegame.com/~lagalot/images/compile.JPG
I think the coolest thing about all this is you can now rightclick->compile your HLSL shaders, right from the project..

good luck

#1
07/09/2005 (6:07 pm)
Very cool... thanks for the tip!
#2
07/09/2005 (8:05 pm)
Very nifty, thanks for sharing! :)