robburke.NET
© 2009 Robert Burke
All Rights Reserved.

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.

Download it here.

WPF Pixel Shader Effect

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 :)

Download sample solution.

[14 May 08 Update: Greg has posted an end-to-end shader sample with 3 sample shaders!]

Possibly Related Articles

  1. WPF Shader Effect to simulate Colour Vision Deficiencies
  2. WPF 3.5 SP1 Shader Demo Source
  3. Make your own WPF Custom BitmapEffects

One Response to “End-to-End Custom WPF Shader Example”

  1. Martin 27th Jul 2008 @ 12:55 pm

    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.

Trackback URI | Comments RSS

Leave a Comment