Quote:Original post by samv
Quote:Original post by andur
You include all common elements/functions from shared seperate files, so, changing the lighting falloff only necessitates recompiling the shaders that use that particular lighting model. Easy to parse fx files for the #includes.
Is this only possible in a makefile-style build system? I would like to do this in the Visual Studio dependency checking system (where .fx files are processed according to a custom build rule) but can't figure how to do it.
I don't think that there's any way of doing it with Visual Studio's dependency checking system, at least, not without installing/creating some 3rd party plugin.
What I did, was, I wrote a little ShaderCompiler tool that runs as a pre-build step in my project and scans through the .fx files, and seeing which need to be recompiled and what depends on those files. Then it fires up a bunch of fxc processes and compiles them in parallel. It was only about a 100 lines of C# code to write such an app (I can't share it with you, as I wrote it at work). Typically, takes only a few seconds to make the necessary changes, and virtually no time if you didn't change any .fx files.
Oh, and as a little tip, if you do this, redirect the stdout of the fxc processes that you spawn, so that they show up in Visual Studio's output window. Then you can see what its doing, and any build errors will show up in the error list and be clickable to jump to the problematic lines/files.