2 minute read

WPF ShaderEffect Generator

I just added a new project over at CodePlex, the [WPF ShaderEffect Generator].  With it you’ll be able to have your HLSL files in your WPF or Silverlight project automatically compiled and included as a resource along with the code-behind for the ShaderEffect class generated to match the registers on your shader.

I’m working on a project to serve as the basis for an article on doing heat maps in WPF using shaders.  One of the first things I ran into was how much different the experience was with WPF using shaders compared to XNA.  I figured it would be just as painless to use them in my project but that turned out not to be the case.  It was actually a real pain to manually build up the wrapper class and make sure the shader was compiled and included into the project as a resource.

So I went looking for a project to make it less of a pain.  There were a couple of projects that I looked at hoping to solve this problem for me.  The [Shader Effect BuildTask] and [Shazzam] both solved 50% of the problem so I figured I would create a new project to do the compiling and code generation and host it inside of Visual Studio.  This was my first integration with Visual Studio and I’m pretty happy with the results, I’ll definitely consider it more in the future when creating a new tool.

As far as documentation goes, MSDN has a bunch here [Visual Studio SDK].  The SDK comes with a bunch of example projects which really helped me get started.  However I kept running into weird undocumented issues and it was really hard to find examples of real Visual Studio integrations.  So I figured I would host it over at CodePlex in case anyone wants to see how it all works.  I also have the code up there for the installer which uses [NSIS] which I thought might be helpful as well.

I made the icon myself :D  (by butchering the XAML icon)