I encourage you to download a copy of the library and give it a try. Fun stuff.
Plus, keep your eyes open for more WPF Pixel shader news. Later this week there will be a new shader test harness released. One that makes it simple to test any DirectX shader snippet.
WPF and DirectX
It’s probably not a surprise to you that WPF uses the DirextX rendering engine. Building WPF on DirectX has many advantages for the framework. Ease of animation, rich color support and 3D support are just a few of the benefits that come to mind.
Microsoft is not sitting on it’s backside watching their competitors in the graphics field pass them by. Not at all. Microsoft is constantly improving the DirectX libraries. WPF, in turn, can use the new features of DirectX.
A few years ago Microsoft add Shader support to DirectX. Shaders permit more flexibility in programming advanced GPU features. No longer is the graphic/game developer stuck with a few hard wired graphics algorithms encoded in the GPU. Instead you write a shader, have the GPU load the shader code and the GPU plugs your custom shader into the graphics pipeline.
Shaders come in a couple of flavors, pixel shaders which allow the manipulation of pixel data and vertex shaders with allow the manipulation of vertex data. Shaders are extremely fast, therefore modifying pixel data with a pixel shader is light years faster than prior methods.
WPF and ShaderEffects
Some of us were disappointed to find the the first release of WPF did not allow creation of shader or vertex effects. It took a couple of years, but Microsoft finally delivered on their promise to fix this oversight.
A DirectX shader can be written in assembly but in recent years shaders are more likely to be must be written in a C dialect known as HLSL (High-Level Shading Language). Note that there are other dialects for other graphic platforms (GLSL for OpenGL for instance). .NET 3.5 SP1 has magnificent support for shaders but first you must create the HLSL code. To use the shader in WPF you have to create a class that derives from System.Windows.Media.Effects.ShaderEffect.
Pixel Shader Effect Library
I’ve been working with the beta of the Pixel Shader Effect Library for a couple weeks now. There are some very nice effect included. I encourage you to download the effect library and give it a try.