Greg is in the middle of writing a great explanation of how to build custom WPF 3.5 SP1 pixel shader effects on his blog. He helped me re-create his sample ColorComplementEffect, so I thought I’d offer a sample solution containing an end-to-end custom WPF Pixel Shader Effect using the .NET 3.5 SP1 Beta bits.
![]()
Some notes:
- This solution requires that you have Visual Studio 2008 and the .NET 3.5 SP1 Beta installed.
- This also requires that you have the DXSDK installed on your PC (I am out-of-date and using the August 2007 flavor)
- In my .sln, a Pre-build Event Command invokes fxc.exe to compile ColorComplementShader.fx into ColorComplementShader.ps. The Pre-build command requires you to have the DXSDK_DIR environment variable set (see previous note – installing the DXSDK should set this automatically for you)
- The picshure is from teh awesum icanhascheezburger.com
Next step… databound shader parameters :)
[14 May 08 Update: Greg has posted an end-to-end shader sample with 3 sample shaders!]
WPF Line-Of-Business App Links →← WPF Commanding – When do Commands re-evaluate their CanExecute method?
Martin says
You wrote on Gregs blog, that you wanted to create a rgb->hsl->rgb shader. I created a rgb->hsV->rgb shader, and with some optimizations i got around the 64 operations limitation. Give me a mail if you’re interested in the code.
July 27, 2008Richard Fencel says
I downloaded your project and it did not build until I added more quotes in the pre-build command. The new command should be:
“%DXSDK_DIR%\Utilities\Bin\x86\fxc.exe” /T ps_2_0 /E main /Fo”$(SolutionDir)ColorComplementShader.ps” “$(SolutionDir)ColorComplementShader.fx”
I haven’t tested the rest yet, I just thought I would report this now.
March 14, 2010