Location of D3D effect file
#1 Members - Reputation: 145
Posted 29 March 2012 - 04:47 PM
#3 Members - Reputation: 145
Posted 29 March 2012 - 06:50 PM
Can this pre-compile step be done in the Visual Studio build process? Moreover, I wonder why does Microsoft insist to force developers to put effect code into HLSL file, instead of a C++ source file?You can pre-compile the effect to a binary file using fxc.exe or D3DCompile, and then you can load that binary file instead at runtime.
#4 Moderators - Reputation: 5643
Posted 29 March 2012 - 08:30 PM
Can this pre-compile step be done in the Visual Studio build process?
Sure. Just set up a new build type for shaders that invokes fxc.exe, and assign that to your effect files.
Moreover, I wonder why does Microsoft insist to force developers to put effect code into HLSL file, instead of a C++ source file?
I'm confused by what you mean by this. The shader compiler will happily compile any shader/effect regardless of where it comes from, as long as you point it to a file or give it the ASCII string data. You're free to put into whatever files or formats you want.
#5 Members - Reputation: 145
Posted 29 March 2012 - 08:57 PM
So you mean writing shader effects in a ASCII file brings the benefit of programming language independence.I'm confused by what you mean by this. The shader compiler will happily compile any shader/effect regardless of where it comes from, as long as you point it to a file or give it the ASCII string data. You're free to put into whatever files or formats you want.
#6 Members - Reputation: 102
Posted 30 March 2012 - 07:04 PM
EDIT: Ah-ha!... http://msdn.microsoft.com/en-us/library/windows/desktop/bb172770%28v=vs.85%29.aspx






