to improve onscreen graphics. They are versatile, doing important
tasks like making computer rendered aliens look realistic,
providing the ripples on a background lake or growing fur on the
latest Pixar monster. In the PC world, programmers are often
delighted to find that shaders are nothing more than a miniature
program that is optimized to run on the computers GPU. This
happiness fades when they start exploring the strange programming
model underlying shaders however. Because shaders are strung
together in an unusual fashion and run on a massive parallel
processer developers shouldn't use their traditional OO or
procedural approach to writing code. Writing effective shaders
requires a mind shift regarding how to craft a useful algorithm.
To top it off, shaders are written in a unfamiliar C-like
language. In the Microsoft DirectX world the dominant language is
High Level Shader Language or HLSL.
Silverlight and WPF support adding Pixel shaders to UI elements.
For common shader scenarios (like motion blur and color effects)
Microsoft includes a handful of prebuilt shaders in Expression
Blend. These free shaders are a nice addition but will not
satisfy every shader scenario. Luckily, .NET provides custom
shaders to fill the gap. To create a custom shader a developer
must learn and understand HLSL and how it fits into the XAML
world. This book explains how to work with WPF/Silverlight
shaders, from adding them to a project to placing them in the
visual tree. It also contains a complete tutorial showing the
facets of HLSL code that are important to the XAML developer.
Share This Book: