Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
O'Reilly Media, Inc. 4/5/2012 A First Shader Project Traditionally the first application in most programming books is the ubiquitous "hello world" application. Boring! I'll have none of that dreary code in this book. The cynical reader will point out that writing text to the screen with a shader is nearly impossible but let's not go there. I need a graphical demo that shows a shader in action, but also is graphical in nature. With that in mind I decided to make the first project an image transition application. I want to say a couple words about terminology before going any further. The terms shader and effect are pervasive and often used interchangeably. On the .NET side of the aisle, the common term is effect. Examine the UIElement class and you'll see that it has an Effect dependency property. Tour the class libraries and you'll discover the prebuilt DropShadowEffect and BlurEffect classes tucked amidst the other familiar XAML types. In addition, there is the ShaderEffect base class, which is used when creating your own custom effects. On the HLSL side of the house the word effect has special meaning; in this realm you can think of an effect as a shader package containing multiples shaders targeting different hardware. The shader is the actual algorithm run on the GPU. To summarize, when you write a custom effect you create a .NET effect class and an HLSL shader. Using prebuilt effects