Posted on 2010-10-20 22:40
魔のkyo 阅读(896)
评论(0) 编辑 收藏 引用
将Shader文件加入工程,在文件属性中找到Custom Build Step(自定义生成步骤)
设置如下
Vertex Shader
Command Line:"%DXSDK_DIR%\Utilities\Bin\x86\fxc.exe" /nologo /O1 /LD /Zpr /Tps_3_0 /Fo"$(OutDir)\$(InputName).wpu" "$(InputPath)"
Description:building vs shader...
Outputs:"$(InputName).wvu"
Pixel Shader
Command Line: "%DXSDK_DIR%\Utilities\Bin\x86\fxc.exe" /nologo /O1 /LD /Zpr /Tps_3_0 /Fo"$(OutDir)\$(InputName).wpu" "$(InputPath)"
Description: building pixel shader...
Outputs: "$(InputName).wpu"
便可在按下F5或F7 build project的时候自动编译Shader并生成到$(OutDir)下
FXC的详细参数参考DX SDK文档 Effect-Compiler Tool