HLSL and Pixel Shaders for XAML Developers - Helion
ISBN: 978-14-493-2501-5
stron: 204, Format: ebook
Data wydania: 2012-07-03
Księgarnia: Helion
Cena książki: 50,91 zł (poprzednio: 59,89 zł)
Oszczędzasz: 15% (-8,98 zł)
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
Osoby które kupowały "HLSL and Pixel Shaders for XAML Developers", wybierały także:
- Zen Steve'a Jobsa 29,67 zł, (8,90 zł -70%)
- ASP.NET MVC. Kompletny przewodnik dla programistów interaktywnych aplikacji internetowych w Visual Studio 86,77 zł, (26,90 zł -69%)
- jQuery, jQuery UI oraz jQuery Mobile. Receptury 57,74 zł, (17,90 zł -69%)
- Scratch. Komiksowa przygoda z programowaniem 36,06 zł, (11,90 zł -67%)
- Baltie. Kurs video. Poziom pierwszy. Elementarz programowania w języku wizualnym 59,00 zł, (26,55 zł -55%)
Spis treści
HLSL and Pixel Shaders for XAML Developers eBook -- 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
- Setting Up Your Development Computer
- 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
- A Word About Pseudocode
- 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
- Creating a Custom ShaderEffect
- Summary
- Framework Effects
- 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
- Multi-Input Effects
- Transition Effects in Blend
- Create a State Group
- Add the States
- Set the Properties
- Adding a Transition Effect
- Summary
- Creating a Project
- 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
- Flow ControlBranching
- Built-in Functions
- Texture Functions
- Math Functions
- Useful Built-in Functions
- Clamp and saturate
- Lerp
- Summary
- Parallel Processing in Shaders
- 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
- Zen of Pixel Programming
- A. Resources
- Books
- Programming
- Premultiplied Alpha Blending
- Convolution
- Noise
- Tools
- B. Shazzam Settings
- About the Author
- SPECIAL OFFER: Upgrade this ebook with OReilly
- Copyright