views:

1227

answers:

3

How to create simple Gaussian Blur filter with HLSL (for Silverlight)?
Why - I want to create some complex filter for Silverlight and I do not want to apply blur filter and mine separately.

What do I need?

I need HLSL filter source.

A: 

This might help you. You can compile and use in Silverlight.Windows Presentation Foundation Pixel Shader Effects Library

Paully
No thare is no Gaussian Blur filter inside that lib=(
Blender
Yes, not a final anaswer but they have other examples but try finding some HLSL code for Gaussian Blur and use the WPF Pixel Shader Effects as a guide to compile your own into an effect. Good Luck.
Paully
+1  A: 

If you scroll down here you'll find a sample- poster says it's not for the shy...

Dave Swersky
ok for now...not for the shy...)
Blender
A: 

The WPF pixel shader architecture (and HLSL shaders in general) are not capable of doing generalized gaussian blur. The problem: the size of the filter kernel in an HLSL shader is strictly limited by the number of operations permitted in an HLSL shader, and a gaussian blur filter requires an arbitrarily large filter kernel.

It's not clear that you would want to do it this way anyway. The right way to do gaussian blur is with convolutions, via 2D Fourier transforms. WPF shaders don't permit this. However, those who are enormously brave could try doing it via a WriteableBitmap.

Robin Davies