HLSL and Pixel Shaders for XAML Developers (e-book) Oświęcim

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, youll not only discover how to use existing shaders in your Windows Presentation Foundation (WPF) and …

od 46,74 zł Najbliżej: 48 km

Liczba ofert: 1

Oferta sklepu

Opis

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, youll not only discover how to use existing shaders in your Windows Presentation Foundation (WPF) and Silverlight applications, youll also learn how create your own effects with XAML and Microsofts HLSL shading language. In the process, youll 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 GPUs 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 Spis treści: HLSL and Pixel Shaders for XAML Developers SPECIAL OFFER: Upgrade this ebook with OReilly 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 1. Shader 101 Why Should XAML Developers Learn HLSL? The Tale of the Shader HLSL and DirectX Understanding the Graphics Pipeline XAML and Shaders Summary 2. Getting Started Setting Up Your Development Computer Silverlight Development WPF Development Expression Blend 4 Choosing a Shader Compiler DirectX Compiler WPF Build Task Shazzam Shader Editor Other Tools to Consider FX Composer NShader Visual Studio 2012 A First Shader Project Using Prebuilt Effects Adding Effects Debrief Custom Shader Create a Shader Algorithm Compile the HLSL Code Add to Visual Studio XAML Project Create a .NET Wrapper Class Compile the Project Instantiate the Shader Summary 3. Commonplace Pixel Shaders A Word About Pseudocode Our Sample Image Color Modification Common Techniques Black, White, and Gray Black-White Grayscale Color Replacement Color Enhancement and Correction Distinctive Effects Distortion and Displacement Magnify Embossed Testing Distortion Effects Other Displacement Effects Blurs Motion Blur Zoom Blur Sharpening Generative Effects Multiple Inputs Sampler Transition Texture Map Color Combination Photoshop Blend Modes Darken Modes Lighten Modes Contrast Modes Comparative Modes Other Modes Blend Modes in HLSL Practical Uses for Shader Effects Motion Blur in Moving Parts Blurs to Emphasize UI Focus Desaturate for Emphasis Summary 4. How WPF and Silverlight Use Shaders Framework Effects BlurEffect DropShadowEffect Nested Effects Multiple Effects on One Element Expression Blend Effects Using a Blend Effect Custom Effects Creating a Custom ShaderEffect Loading the .ps file Using the ShaderEffect Working with Samplers Implicit input from ShaderEffect Explicit input from ShaderEffect Pipeline trivia Explicit input revisited Multi-Input Shaders Understanding Sampler Size Creating Parameterized Effects UpdateShaderValue Property Types Padding Effect Mapping GeneralTransform class GeneralTransform and EffectMapping property Summary 5. Using Expression Blend and Visual Studio with Shaders Creating a Project New Project Adding Assets Adding Effects Setting Effect Properties Visual Studio Editor Using Custom Effects in Blend Multi-Input Effects Setting brushes with Property window Transition Effects in Blend Create a State Group Add the States Set the Properties Adding a Transition Effect Summary 6. Using the Shazzam Shader Editor UI Tour Create a Custom Shader Exploring the HLSL Code Editor Compiling and Testing the Shader Editor Status Bar Exploring the Generated Code Changing Options Working with HLSL Parameters Testing Parameters Default Values for Parameters Changing the test harness values Shazzam Tags Input Parameter Types Influencing the .NET Type Multi-Input Shaders Shader Loader Your Folder tab Sample Shaders tab The Tutorial tab More Shazzam Tools Fullscreen mode Take a screenshot Copying the Files into a Visual Studio Project Summary 7. HLSL in Detail Parallel Processing in Shaders Parallelism and the GPU One-Pixel-at-a-Time Algorithm The Relationship Between DirectX and the GPU Understanding Registers Basic Structure of an HLSL Program User-Defined Functions Semantics Data Types Scalar type Array type Vector type Initializing a vector Swizzling Matrix type Object type Custom type Type Casting Local Variables Shader Inputs TEXCOORD Input Global Variables Global Inputs Texture and Sampler Input Sampler Declarations Other texture declarations Other Code Constructs Flow ControlBranching The trouble with float Parallel programming and branches Flow ControlLoops Operators Built-in Functions Texture Functions Math Functions Useful Built-in Functions Clamp and saturate Lerp Summary 8. The Zen of Shader Programming Zen of Pixel Programming Sampling a Pixel Color Sampling a Color from Another Texture Colors Color Channel Manipulation Conditional Colors Preserving the alpha channel Replace a Color Other Color Modifier Examples Grayscale Cartoon shader Gloom shader The premultiplied alpha dilemma Coordinates Drawing a vertical line Pixelate Convolution kernels Defining a weighting matrix Building a convolution effect Distortion and Displacement Effects Random Values Noise Textures Creating static texture map Sampling the static map Perlin Noise in Shaders Noise lookup in a distortion shader Noise lookup in a lighting shader Summary A. Resources Books Programming Premultiplied Alpha Blending Convolution Noise Tools B. Shazzam Settings About the Author SPECIAL OFFER: Upgrade this ebook with OReilly Copyright

Specyfikacja

Podstawowe informacje

Autor
  • Walt Ritscher
Rok wydania
  • 2012
Format
  • MOBI
  • EPUB
Ilość stron
  • 204
Kategorie
  • Programowanie
Wydawnictwo
  • O'Reilly Media