Preface
Pixel Shaders are one of the more powerful graphic tools available for XAML programmers. I first encountered them in the Windows Presentation Foundation 3.5 SP1 release and was completely smitten. It didn’t take long to learn that I could create custom shaders, commonly called Effects in WPF, and add them to my projects. Excited by the prospect, I started my research and soon learned that shaders are written in a language called High Level Shader Language (HLSL). I like programming challenges and learning new technologies, so I set off to learn more about custom shaders. I downloaded the DirectX SDK, opened the documentation, and started digging through the pages.
It was at this point that I ran into the wall of uncertainty.
Shader development is very different from working in XAML element trees, and bears little resemblance to traditional .NET programming. The overall mindset is different: the language looks similar to C but uses a quaint semantic syntax and the documentation is sparse and confusing. I found myself writing shader code and hesitantly testing the output, never quite sure what would show up onscreen.
I learned later that I’m not alone in feeling unsure when writing HLSL algorithms. I talked to countless Silverlight developers who echoed my feelings of doubt when faced with the prospect of writing custom shaders. I was reassured to learn, while attending a daylong game workshop, that many game development shops have dedicated shader developers who specialize in ...