将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
将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
设置如下
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