Pixel shaders are some of the more powerful graphic tools available for XAML programmers, but shader development bears little resemblance to traditional .NET programming. With this hands-on book, you’ll not only discover how to use existing shaders in your Windows Presentation Foundation (WPF) and Silverlight applications, you’ll also learn how create your own effects with XAML and Microsoft’s HLSL shading language.
In the process, you’ll write, compile, and test custom XAML shaders with the Shazzam Shader Editor, a free utility developed by author Walt Ritscher. The book includes XAML and C# sample code, and Shazzam contains all of the sample shaders discussed.
* Learn how shaders help you extend the GPU’s rendering capabilities
* Explore prevailing shader types, such as color modification, blurring, and spatial transformation
* Get a quick tour of the shader features, and use pre-built effects on image elements in your application
* Examine the XAML ShaderEffect class to understand how WPF and Silverlight use shaders
* Learn about the shader-specific tools available in Visual Studio and Expression Blend
* Get up to speed on HLSL basics and learn how to create a variety of graphics effects
Inhaltsverzeichnis
Preface;
Who This Book Is For;
What You Need to Use This Book;
Contents of This Book;
Conventions Used in This Book;
Using Code Examples;
Safari® Books Online;
How to Contact Us;
Acknowledgments;
Foreword;
Chapter 1: Shader 101;
1. 1 Why Should XAML Developers Learn HLSL? ;
1. 2 The Tale of the Shader;
1. 3 HLSL and DirectX;
1. 4 Understanding the Graphics Pipeline;
1. 5 XAML and Shaders;
1. 6 Summary;
Chapter 2: Getting Started;
2. 1 Setting Up Your Development Computer;
2. 2 Choosing a Shader Compiler;
2. 3 Other Tools to Consider;
2. 4 A First Shader Project;
2. 5 Custom Shader;
2. 6 Summary;
Chapter 3: Commonplace Pixel Shaders;
3. 1 A Word About Pseudocode;
3. 2 Color Modification;
3. 3 Distortion and Displacement;
3. 4 Blurs;
3. 5 Generative Effects;
3. 6 Multiple Inputs;
3. 7 Sampler Transition;
3. 8 Texture Map;
3. 9 Color Combination;
3. 10 Practical Uses for Shader Effects;
3. 11 Summary;
Chapter 4: How WPF and Silverlight Use Shaders;
4. 1 Framework Effects;
4. 2 Nested Effects;
4. 3 Expression Blend Effects;
4. 4 Custom Effects;
4. 5 Summary;
Chapter 5: Using Expression Blend and Visual Studio with Shaders;
5. 1 Creating a Project;
5. 2 Visual Studio Editor;
5. 3 Using Custom Effects in Blend;
5. 4 Transition Effects in Blend;
5. 5 Summary;
Chapter 6: Using the Shazzam Shader Editor;
6. 1 UI Tour;
6. 2 Create a Custom Shader;
6. 3 Summary;
Chapter 7: HLSL in Detail;
7. 1 Parallel Processing in Shaders;
7. 2 The Relationship Between DirectX and the GPU;
7. 3 Understanding Registers;
7. 4 Basic Structure of an HLSL Program;
7. 5 Type Casting;
7. 6 Shader Inputs;
7. 7 Other Code Constructs;
7. 8 Built-in Functions;
7. 9 Summary;
Chapter 8: The Zen of Shader Programming;
8. 1 Zen of Pixel Programming;
8. 2 Colors;
8. 3 Summary;
Resources;
Books;
Programming;
Premultiplied Alpha Blending;
Convolution;
Noise;
Tools;
Shazzam Settings;