PixelShader

Red-Green-Blue shift shader

Red-Green-Blue shift shader

This is just a weird shader effect I came up with while I was testing something else. The idea is to distort the image by using the component values (R, G, B). The distortion is achieved by shifting the texture co-ordinate with the values stored in the R, G or B component. Once we have [...]

Don’t forget to pass the Input brush to the Shader

When writing ShaderEffects for WPF, it is always tempting to first test the shader with images. Testing with images instinctively seems easy but there are some caveats to remember. When the ShaderEffect is applied to an Image, the texture information is directly pushed to the sampler register s0. So there is no need to setup [...]

WarpEffect source code posted on FluidKit

WarpEffect source code posted on FluidKit

  In my previous post I described a pixel shader technique for distorting images and 2D textures. The source for this effect is now available on the FluidKit project. If there is enough interest I can do a quick tutorial on how the effect was created. Similar Posts: FluidKit with Outlook 2007 and Dynamics CRM [...]

Warp Effect using pure Pixel Shaders

Warp Effect using pure Pixel Shaders

I am totally blown away by the possibilities of Pixel Shaders and already finding a great variety of uses for it. To get started on Pixel Shaders I would recommend stopping by Greg Schecter’s blog and reading his series of articles on this subject. It was definitely a starting point for me. As an experiment, [...]

File encodings matter when writing Pixel Shaders

File encodings matter when writing Pixel Shaders

HLSL is the defacto language that you will be using when writing Pixel Shaders for WPF. But before you can use it, you will have to compile the HLSL to pixel shader byte code. The DirectX SDK ships with the FXC compiler that can do this job for you. However this compiler is very sensitive [...]