Pixel Shader .ps file in WPF Shader Effect Generator

Dec 23, 2010 at 9:10 AM

I create a new effect in WPF Shader Effect Generator in Visual Studio 2010.

The File creates a main and a new .cs codebehind file and a compiled .ps file that is embedded in the .fx file.

So Effect1.fx contains the HLSL code for the effect inside a pixel shader called main.

Then the Effect1 ShaderEffect-derived class is contained in the code behind with the Effect1.ps in its PixelShader property.  As the Uri to the PixelShader file.

Is it possible to assign the .fx file without compiling it to .ps as a binary pixel shader to the effect.

I have another effect called particle.fx, which I wrote earlier.

I either want to generate the .ps or .vs pixel shader file or vertex shader binary file.  This I can generate from the fxc.exe command line tool.

Or does the WPF ShaderEffect Generator automatically generate the pixel code from the HLSL within the compiler.

I.e. Is the fxc compiler accessible from the Project Item Template inside Visual Studio 2010.

Without resorting to the command-line utility available on either the DirectX SDK or obtaining the compiled .ps or .fxo from NVidia's FX Composer 2.5?


Dec 23, 2010 at 3:41 PM

Not that I know of, WPF expects the pixel shader URI to point to an already compiled pixel shader.  The WPF ShaderEffect Generator will compile the effect file when you compile your C# code, so that you don't have to run external utilities to recompile it.