基本信息
源码名称:HLSL and Pixel Shaders for XAML Developers
源码大小:25.22M
文件格式:.pdf
开发语言:C/C++
更新时间:2022-03-19
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍

HLSL and Pixel Shaders for XAML Developers

shader相关书籍

Table of Contents
Preface ..................................................................... ix
Foreword ................................................................... xv
1. Shader 101 ............................................................. 1
Why Should XAML Developers Learn HLSL? 1
The Tale of the Shader 2
HLSL and DirectX 3
Understanding the Graphics Pipeline 5
XAML and Shaders 7
Summary 9
2. Getting Started ........................................................ 11
Setting Up Your Development Computer 11
Silverlight Development 11
WPF Development 12
Expression Blend 4 12
Choosing a Shader Compiler 12
DirectX Compiler 12
WPF Build Task 13
Shazzam Shader Editor 13
Other Tools to Consider 13
FX Composer 13
NShader 14
Visual Studio 2012 14
A First Shader Project 15
Using Prebuilt Effects 16
Adding Effects 19
Debrief 22
Custom Shader 22
Create a Shader Algorithm 23
iii
Compile the HLSL Code 24
Add to Visual Studio XAML Project 24
Create a .NET Wrapper Class 25
Compile the Project 26
Instantiate the Shader 27
Summary 28
3. Commonplace Pixel Shaders ............................................. 29
A Word About Pseudocode 30
Our Sample Image 30
Color Modification 30
Common Techniques 31
Black, White, and Gray 32
Color Replacement 34
Color Enhancement and Correction 34
Distinctive Effects 36
Distortion and Displacement 37
Magnify 38
Embossed 39
Testing Distortion Effects 40
Other Displacement Effects 42
Blurs 42
Motion Blur 43
Zoom Blur 43
Sharpening 43
Generative Effects 43
Multiple Inputs 44
Sampler Transition 44
Texture Map 46
Color Combination 47
Photoshop Blend Modes 49
Darken Modes 49
Lighten Modes 51
Contrast Modes 52
Comparative Modes 52
Other Modes 52
Blend Modes in HLSL 53
Practical Uses for Shader Effects 53
Motion Blur in Moving Parts 54
Blurs to Emphasize UI Focus 54
Desaturate for Emphasis 55
Summary 55
iv | Table of Contents
4. How WPF and Silverlight Use Shaders ..................................... 57
Framework Effects 57
BlurEffect 58
DropShadowEffect 59
Nested Effects 59
Multiple Effects on One Element 59
Expression Blend Effects 60
Using a Blend Effect 61
Custom Effects 63
Creating a Custom ShaderEffect 63
Working with Samplers 65
Multi-Input Shaders 72
Understanding Sampler Size 73
Creating Parameterized Effects 75
Padding 77
Effect Mapping 78
Summary 83
5. Using Expression Blend and Visual Studio with Shaders ...................... 85
Creating a Project 85
New Project 86
Adding Assets 87
Adding Effects 88
Setting Effect Properties 90
Visual Studio Editor 90
Using Custom Effects in Blend 92
Multi-Input Effects 94
Transition Effects in Blend 98
Create a State Group 98
Add the States 99
Set the Properties 99
Adding a Transition Effect 100
Summary 102
6. Using the Shazzam Shader Editor ........................................ 103
UI Tour 103
Create a Custom Shader 103
Exploring the HLSL Code Editor 105
Compiling and Testing the Shader 106
Editor Status Bar 109
Exploring the Generated Code 109
Changing Options 110
Working with HLSL Parameters 112
Table of Contents | v
Testing Parameters 113
Default Values for Parameters 114
Shazzam Tags 115
Input Parameter Types 117
Influencing the .NET Type 117
Multi-Input Shaders 119
Shader Loader 121
More Shazzam Tools 123
Copying the Files into a Visual Studio Project 123
Summary 124
7. HLSL in Detail ........................................................ 125
Parallel Processing in Shaders 125
Parallelism and the GPU 126
One-Pixel-at-a-Time Algorithm 126
The Relationship Between DirectX and the GPU 127
Understanding Registers 127
Basic Structure of an HLSL Program 128
User-Defined Functions 129
Semantics 130
Data Types 132
Type Casting 138
Local Variables 139
Shader Inputs 139
TEXCOORD Input 139
Global Variables 140
Global Inputs 140
Texture and Sampler Input 141
Sampler Declarations 142
Other Code Constructs 143
Flow Control—Branching 143
Flow Control—Loops 144
Operators 144
Built-in Functions 145
Texture Functions 146
Math Functions 146
Useful Built-in Functions 147
Summary 147
8. The Zen of Shader Programming ........................................ 149
Zen of Pixel Programming 149
Sampling a Pixel Color 149
Sampling a Color from Another Texture 150
vi | Table of Contents
Colors 151
Color Channel Manipulation 151
Conditional Colors 152
Replace a Color 153
Other Color Modifier Examples 154
Coordinates 158
Distortion and Displacement Effects 165
Random Values 170
Noise Textures 172
Perlin Noise in Shaders 175
Summary 179
A. Resources ........................................................... 181
B. Shazzam Settings ..................................................... 183