Training
Certifications
Books
Special Offers
Community




 
Microsoft® DirectX® 9 Programmable Graphics Pipeline
Author Kris Gray
Pages 496
Disk 1 Companion CD(s)
Level All Levels
Published 06/18/2003
ISBN 9780735616530
Price $49.99
To see this book's discounted price, select a reseller below.
 

More Information

About the Book
Table of Contents
Sample Chapter
Index
Related Series
About the Author

Support: Book & CD

Rate this book
Barnes Noble Amazon Quantum Books

 

Index


Special Characters and Symbols
+ (addition operator), 151, 186, 352
<> (angle brackets), 231, 254
= (assignment operator), 150, 353
+= (assignment operator), 150, 353
-= (assignment operator), 150, 353
*= (assignment operator), 150, 353
/= (assignment operator), 150, 353
* (asterisk as multiplication operator), 151, 186, 352
&& (Boolean operator), 152, 352
|| (Boolean operator), 152, 352
?: (Boolean operator), 152
: (colon), 230
, (comma operator), 154, 353
!= (comparison operator), 150
{} (curly braces), 156, 263
/ (division operator), 151, 352
// (double slash), 27, 74
= (equal sign)
   as assignment operator, 150
   in comparison operators, 152-53
> (greater-than operator), 152-53, 352
>= (greater-than-or-equal-to operator), 152-53, 352
< (less-than operator), 152-53, 352
<= (less-than-or-equal-to operator), 152-53, 352
% (modulus operator), 151-52, 352
() (parentheses), 220, 239, 240, 261
. (period operator), 154
% (percent sign), 151-52
+ (plus operator), 151, 186, 352
- (postfix operator), 153, 351
++ (prefix operator), 153, 352
; (semicolon), 27, 74, 245
/ (slash), 27, 74, 151
/* (slash-asterisk), 27, 74
[] (square brackets), 155
- (subtraction operator), 151, 352
! (unary operator), 151
+ (unary operator), 151
- (unary operator), 151
| (vertical bar), 152

A
a0 input register, 29, 30
abs instruction, 34, 84, 305
abs intrinsic function, 169, 358-59
abs source modifier, 38
absneg source modifier, 38
acos intrinsic function, 169, 359
add instruction, 34, 83, 306
addition operator (+), 151, 186, 352
Address effect states, 427
address register (a0), 29, 30
affine transformations, 289-90
aL input register
   pixel shaders, 77, 78
   vertex shaders, 29, 30
all intrinsic function, 169, 359
alpha blending, 69, 103, 265-73
alpha testing, as step in pixel processing, 69, 72
AlphaArg effect state, 431
AlphaBlendEnable effect state, 423
AlphaFunc effect state, 423
AlphaOp effect state, 431
AlphaRef effect state, 424
AlphaTestEnable effect state, 424
ALU. See arithmetic logic unit (ALU)
ambient color, 187
Ambient effect state, 421
ambient light, 299, 300
AmbientMaterialSource effect state, 421
angle brackets (<>), 231, 254
animating vertices, 56, 62. See also vertex data, blending
annotations. See also effect parameters
   adding user information to effect parameters, 231-32
   attaching to functions, 167
   in examples, 175, 218, 263
   FUNCTION, 277
   HEIGHT, 277
   HLSL grammar, 403
   NAME, 277
   overview, 230-31
   role in effects, 413-14
   TARGET, 277
   in variables, 135
   WIDTH, 277
any intrinsic function, 169, 359
area lights, 278
arithmetic instructions
   pixel shader, 80, 81, 83-84
   vertex shader, 32, 34-35
arithmetic logic unit (ALU). See also instruction set, pixel shader; instruction set, vertex shader
   pixel shader virtual machine, 72, 73, 75, 80
   vertex shader virtual machine, 26, 32
arithmetic operators, 151-52
array operator, 155
arrays, samplers in, 147
asin intrinsic function, 169, 360
aspect ratio, 295-96
assembly language
   adding diffuse color to vertex shader example, 19-23
   basic effect example, 217-22
   basic pixel shader example, 95-101
   basic vertex shader example, 6-19
   environment-mapping effect example, 249-58
   fog example, 43-47
   instructions, pixel shader, 73, 74-75, 80-89, 305-45
   instructions, vertex shader, 26, 27-28, 32-37, 305-45
   pixel shader multilayered textures example, 101-6
   shader overview, 3, 27
   Vertex Blend SDK sample, 56-65
   Vertex Shader SDK sample, 47-56
assignment operators, 150-51
asterisk, in slash-asterisk (/*), 27, 74
atan intrinsic function, 169, 360
atan2 intrinsic function, 169, 360
attenuation, light, 302-3

B
b# input register, 29, 30
bar. See vertical bar (|), as Boolean math operator
Begin method, ID3DXEffect interface, 225, 226, 236
bem instruction, 306
bias source register modifier, 388
BIMG string, 277
binding variables to registers, 166-67
BINORMAL semantic, 355
binormal vector, 197
BLENDINDICES semantic, 355
blending
   frame-buffer, 72
   matrices, in Vertex Blend SDK sample, 59-60
   multitexture. See multitexture blending
   step in pixel processing, 69-72
   vertex data, 5-6, 56-65
BlendOp effect state, 424
BLENDWEIGHT semantic, 355
bool data type, 131
Boolean operators, 152, 352
BorderColor effect state, 427
braces. See curly braces ({})
brackets. See angle brackets (<>)
break instruction, 36, 88, 306-7
break_comp instruction, 36, 88, 307
break_pred instruction, 88, 308
buffer declarations, 8, 9
BumpEnvLOffset effect state, 432
BumpEnvMat effect states, 432
BumpEnvScale effect state, 432

C
c# constant registers
   pixel shader, 76, 77, 78
   vertex shader, 29, 30, 32
call instruction, 36, 88, 308
callnz instruction, 36, 88, 309
callnz_pred instruction, 36, 88, 309-10
camera, in view space, 187, 292-94
cast operators, 153
casting, 143
CD3DApplication base class, 62
ceil intrinsic function, 361
characters, in HLSL, 399-400
clamp intrinsic function, 361
clip intrinsic function, 361
clipping, as step in primitive processing, 68
Clipping effect state, 421
clipping planes, 295-96
ClipPlaneEnable effect state, 421
CloneMesh method, 209
cloning effect parameters, 230, 414
cmp instruction, 83, 310
CMyD3DApplication
   ConfirmDevices method, 30, 123, 179
   InitDeviceObjects method. See InitDeviceObjects method
   overview, 10
   Render method, 123, 210-11, 256
   RestoreDeviceObjects method. See RestoreDeviceObjects method
cnd instruction, 83, 310
code reuse, 23
co-issuing instructions, 91
col_major type modifier, 132, 133, 141-42
colon (:), 230
color
   ambient, 187
   calculating for spotlights, 302
   complementing, 118
   darkening images in HLSL pixel shader example, 118-19
   diffuse. See diffuse color
   masking out, in HLSL pixel shader example, 119-20
   role of lights and materials, 299-302
   specular, 197, 200, 259, 261, 262
color registers, pixel shader, 76, 77, 78-79
COLOR semantic, 355, 356, 357
ColorArg effect states, 432
ColorOp effect state, 432
ColorVertex effect state, 421
ColorWriteEnable effect state, 424
column vectors, 290-91
comma operator (,), 154, 353
comments
   in Asm examples, 27, 246
   in pixel shaders, 74-75
   in vertex shaders, 27-28
comparison operators, 152-53
compile statement, 225, 263
complement source register modifier, 388
complementing colors, 118
ConfirmDevices method, 30, 123, 179
const type modifier, 132-33
constant light attenuation factor, 302, 303
constant registers
   pixel shader, 73, 76, 77, 78
   vertex shader, 9, 10, 17-18, 26, 27, 28, 29, 30, 31, 32
   Vertex Shader SDK sample, 49
constants
   defining in pixel shaders, 75
   example, 27, 28
   overview, 28
   Vertex Blend SDK sample, 63
   Vertex Shader SDK sample, 49
constructors, 142-43, 412
coordinate spaces
   converting vertices, 287-97
   model vs. projection, 4, 5, 6
cos intrinsic function, 362
cosh intrinsic function, 362
cosine function, 47, 48, 50-51
.cpp files, 7
CreatePixelShader method, 98, 181, 203
CreateVertexBuffer method, 14
CreateVertexDeclaration method, 45, 52-53, 100
CreateVertexShader method, 14, 61, 100, 113, 127, 181, 189, 203
cross intrinsic function, 362
crs instruction, 35, 84, 311
cubic-environment maps. See environment maps
CullMode effect state, 421
curly braces ({}), 156, 263

D
D3DCAPS9 structure, 30
D3DCOLORtoUBYTE4 intrinsic function, 362-63
D3DSAMPLERSTATETYPE enumeration, 145
D3DTEXTUREADDRESS enumeration, 146
D3DTEXTUREFILTERTYPE enumeration, 145
D3DVERTEXELEMENT9 structure, 15, 45, 52, 100
D3DXAssembleShader function, 4, 13, 19, 45, 98, 100
D3DXAssembleShaderFromFile function, 19, 53-54, 61, 101
D3DXAssembleShaderFromResource function, 19
D3DXCompileShader function, 112, 113, 117, 120, 127, 179
D3DXCompileShaderFromFile function, 127
D3DXCompileShaderFromResource function, 117, 121-22, 127, 180, 181, 188, 204-5
D3DXComputeTangent function, 209-10
D3DXCreateEffect function, 249, 256
D3DXCreateEffectFromFile function, 232, 241, 263
D3DXCreateEffectPool function, 230, 233
D3DXCreateTextureFromFile function, 96
D3DXCreateVolumeTexture function, 204
D3DXFillVolumeTexture function, 205
D3DXMatrixMultiply function, 17
D3DXMatrixTranspose function, 17
data types, HLSL
   annotations, 135
   complex, 144-49
   constructors, 142-43
   converting, 347, 349-51
   floating-point, 144
   intrinsic, 347-48
   matrix, 138-42, 348, 410
   overview, 131, 347
   pixelshader, 148-49
   samplers, 144-47
   scalar, 131-32, 347
   semantics, 135
   storage class modifiers, 134-35
   strings, 148
   structures, 147-48
   texture, 149
   type modifiers, 132-33
   user-defined, 347, 348-49
   in variable declarations, 132
   vector, 136, 347-48, 410
   vertexshader, 148
dcl instruction, 75
dcl_samplerType instruction, 82, 311
dcl_textureType instruction, 33
dcl_usage instruction, 33, 82, 312
ddx intrinsic function, 363
ddy intrinsic function, 363
declarations, HLSL grammar, 400
declarations, in HLSL. See function declarations; register declarations; vertex declarations
def instruction, 28, 34, 75, 82, 312
defb instruction, 34, 83, 312-13
defi instruction, 34, 83, 313
#define directive, 180, 397, 398
degrees intrinsic function, 363
DeleteDeviceObjects method, 123
demotion casting, 143
depth buffers, 297
DEPTH semantic, 357
depth testing, as step in pixel processing, 69, 72
DepthBias effect state, 424
dest instruction, 315
DestBlend effect state, 424
destination register modifiers
   pixel shader, 90, 91, 92, 387, 390-91
   vertex shader, 37, 38
determinant intrinsic function, 364
diffuse color
   adding to Asm vertex shader example, 19-23
   adding to HLSL vertex shader example, 113-15
   Asm vertex shader with lighting effect example, 241
   calculating
      in glow example glow function, 186-87
      in glow example texture function, 177-78
      in sparkle example, 197, 200
   in HLSL effect example, 259, 261, 262
diffuse light, 237, 299, 300-301
diffuse output register, 31
DiffuseMaterialSource effect state, 421
directives, 397-98
distance intrinsic function, 364
DitherEnable effect state, 424
dithering, as step in pixel processing, 69
division operator (/), 151, 352
do statements, 158
dot intrinsic function, 364
double data type, 132
double slash (//), in comments, 27, 74
dp2add instruction, 83, 313
dp3 instruction, 34, 83, 314
dp4 instruction, 34, 83, 314
DrawIndexedPrimitive method, 56, 65
DrawPrimitive method, 18, 22, 100, 130, 258
DrawSubset method, 211, 242-43
dst instruction, 34
dsx instruction, 84, 315
dsy instruction, 84, 315
DWORD data type, 410

E
effect parameters
   adding user information to, 231-32
   defined, 229
   finding by using semantics, 230
   role of handles, 230-31
   role of semantics, 230
   sharing, 229-30
effect pool, 229-30, 233
effect states
   Address, 427
   AlphaArg, 431
   AlphaBlendEnable, 423
   AlphaFunc, 423
   AlphaOp, 431
   AlphaRef, 424
   AlphaTestEnable, 424
   Ambient, 421
   AmbientMaterialSource, 421
   BlendOp, 424
   BorderColor, 427
   BumpEnvLOffset, 432
   BumpEnvMat, 432
   BumpEnvScale, 432
   Clipping, 421
   ClipPlaneEnable, 421
   ColorArg, 432
   ColorOp, 432
   ColorVertex, 421
   ColorWriteEnable, 424
   CullMode, 421
   defined, 216, 225
   DepthBias, 424
   DestBlend, 424
   DiffuseMaterialSource, 421
   DitherEnable, 424
   EmissiveMaterialSource, 421
   in examples, 219-22, 239-40, 252, 254
   FillMode, 424
   FogColor, 421
   FogDensity, 422
   FogEnable, 422
   FogEnd, 422
   FogTableMode, 422
   FogVertexMode, 422
   IndexedVertexBlendEnable, 422
   LastPixel, 424
   light states, 419-20
   LightAmbient, 419
   LightAttenuation, 419
   LightDiffuse, 419
   LightDirection, 419
   LightEnable, 419
   LightFalloff, 419
   Lighting, 422
   LightPbi, 419
   LightPosition, 419
   LightRange, 419
   LightSpecular, 420
   LightTheta, 420
   LightType, 420
   lists, 226, 418-33
   LocalViewer, 422
   MagFilter, 427
   material states, 420
   MaterialAmbient, 420
   MaterialDiffuse, 420
   MaterialEmissive, 420
   MaterialPower, 420
   MaterialSpecular, 420
   MaxAnisotropy, 427
   MaxMipLevel, 427
   MipFilter, 427
   MipMapLoadBias, 428
   MultiSampleAntialias, 422
   MultiSampleMask, 422
   NormalizeNormals, 422
   PixelShader, 428
   PixelShaderConstant, 429, 430
   PointFogEnable, 422
   PointScale, 423
   PointScaleEnable, 422
   PointSize, 423
   PointSize_Max, 423
   PointSize_Min, 423
   PointSpriteEnable, 423
   ProjectionTransform, 433
   RangeFogEnable, 423
   render states, 421-26
   ResultArg, 432
   Sampler, 426
   sampler stage states, 216, 226, 426-28
   sampler states, 144, 216, 226, 426
   saving and restoring, 216, 226
   ShadeMode, 424
   shader constant states, 429-30
   shader states, 428-29
   SpecularEnable, 423
   SpecularMaterialSource, 423
   SrcBlend, 424
   SRGBTexture, 428
   StencilEnable, 424
   StencilFail, 424
   StencilFunc, 424
   StencilMask, 426
   StencilPass, 424
   StencilRef, 425
   StencilWriteMask, 425
   StencilZFail, 425
   TexCoordIndex, 432
   Texture, 431
   texture stage states, 216, 226, 431-32
   texture states, 216, 226, 431
   TextureFactor, 425
   TextureTransform, 433
   TextureTransformFlag, 432
   transform states, 433
   TweenFactor, 423
   types of states, 226, 418
   VertexBlend, 423
   VertexShader, 252, 428
   VertexShaderConstant, 429, 430
   ViewTransform, 433
   WorldTransform, 433
   Wrap, 425
   ZEnable, 425
   ZFunc, 426
   ZVisible, 426
   ZWriteEnable, 426
EffectEdit SDK sample
   code pane, 274, 278
   compile results pane, 275-76
   HLSL hemispheric lighting effect example, 278-86
   overview, 273-74
   recognized annotations, 277
   recognized semantics, 276-77
   recognized strings, 277
   render pane, 275
   rendering options pane, 275, 283
   running effects in, 276-77, 284-86
   running HLSL examples in, 211-12
effects
   annotations, role of, 413-14
   Asm examples, 217-22, 237-58
   characteristics, 225-32
   cloning parameters, 230, 414
   creating, 232-34
   defined, 3-4, 215
   expressions, role of, 411-13
   format overview, 409-18
   handles, role of, 415-16
   HLSL examples, 222-25, 259-86
   IDs, role of, 416
   list of features, 216
   literals, role of, 417
   overview, 215-16, 237, 259
   passes, 236, 411
   rendering, 234-36
   saving and restoring state, 216, 226
   semantics, role of, 416
   sharing parameters, 229-30, 414-15
   techniques, 411
   usages, role of, 417
   validating, 234
   validation, 418
   variables, 409-10
#elif directive, 397
#else directive, 397
else instruction, 36, 88, 316
emissive light, 299, 302
EmissiveMaterialSource effect state, 421
End method, ID3DXEffect interface, 225-26, 236
#endif directive, 397
endif instruction, 36, 88, 316
endloop instruction, 36, 88, 316-17
endrep instruction, 36, 88, 317
environment maps
   Asm effect, 249-58
   sparkle example, 200, 205-6
equal sign (=), as assignment operator, 150, 353
#error directive, 397
examples
   2-D image processing pixel shader, basic, 96, 97, 98-99
   adding diffuse color to vertex shader 19-23
   comments, in Asm examples, 27, 246
   constants, 27, 28
   darkening images in HLSL pixel shader, 118-19
   effect, basic, 217-22
   environment-mapping effect, 249-58
   fog, 43-47
   glow, 173-92,211-12
   hemispheric lighting effect, 278-86
   HLSL hemispheric lighting effect, 278-86
   masking out, in HLSL pixel shader, 119-20
   multiple-pass rendering with alpha blending effect, 265-73
   per-pixel lighting effect, 259-65
   pixel shader, basic, 95-101
   pixel shader multilayered textures, 101-6
   running HLSL in EffectEdit SDK sample, 211-12
   simple transformation, 7, 9-10
   sparkle, 192-212
   texturing, in Asm vertex and pixel shader, 243-49
   vertex shader, basic, 6-19
exclamation point (!), as unary operator, 151, 352
exp instruction, 34, 84, 317-18
exp intrinsic function, 365
exp2 intrinsic function, 365
expp instruction, 34, 318
expressions
   effect, 411-13
   HLSL grammar, 405-7
   literals in, 149
   operators in, 149-55
   overview, 149-50
   variables in, 149
extern variable, 134

F
face registers, 79, 80
faceforward intrinsic function, 365
falloff. See fog-falloff equations
FillMode effect state, 424
filtering colors, 119
fixed-function pipeline
   block diagrams, 4, 67, 215, 287
   effects overview, 215-16
   pixel processing overview, 67-72
   vs. programmable shaders, 70, 71-72, 216
   steps in primitive processing, 68, 215-16
   vertex processing overview, 4-6, 287-304
float data type, 132, 410
floating-point data types, 144, 398-99
floor intrinsic function, 366
flow-control instructions
   pixel shader, 80, 81, 87-88
   vertex shader, 32, 36-37
flow-control registers, 73
flow-control statements
   do statements, 158
   for statements, 158-59
   if statements, 157-58
   overview, 157
   while statements, 159
fmod intrinsic function, 366
fog effects. See vertex fog
fog output register, 31
FOG semantic, 356
FogColor effect state, 421
FogDensity effect state, 422
FogEnable effect state, 422
FogEnd effect state, 422
fog-falloff equations, 47, 297-98
fogging, as step in pixel processing, 69
FogTableMode effect state, 422
FogVertexMode effect state, 422
for statements, 158-59
frac intrinsic function, 366
frame-buffer blending, 72
FrameMove method
   basic pixel shader example, 100
   defined, 123
   Vertex Blend SDK sample, 62, 63, 64
   Vertex Shader SDK sample, 55-56
   view matrix, 16
frc instruction, 34, 84, 318-19
frexp intrinsic function, 367
frustrum, 294-95
FUNCTION annotation, 277
function declarations
   argument lists, 161-62
   explicit register binding, 166
   overview, 160, 353
   pixel shader semantics, 164-66
   return types, 160-61
   vertex shader semantics, 162-64
functions
   argument lists, 161-62
   attaching annotations, 167
   body, 167-68
   declaration, 160-67
   identifiers (names), 161
   intrinsic, 168-69
   overview, 160
   return types, 160-61, 168
   syntax, 402-3
   user-defined, 353-55
fwidth intrinsic function, 367
.fx files, 237

G
gamma correction, as step in pixel processing, 69
GetAnnotation method, 232
GetAnnotationByName method, 232
GetNumFaces method, 258
GetNumVertices method, 258
GetParameter method, 231
global variables, effect. See also effect parameters
   Asm examples, 218-19, 220, 222, 245, 251, 254
   declaring, 409-10
   defined, 216
   HLSL example, 259-61
   techniques or passes, 220
glow example
   adding glow to tiger model, 183-92
   adding texture to tiger model, 173-83
   calculating diffuse color, 177-78, 186-87
   compiling glow vertex shader, 188
   EffectEdit SDK sample, 211-12
   glow function defined, 184-88
   overview, 171-73
   render code, 189-91
   summary, 191-92
Glow.fx file, 181, 211
grammar, HLSL, 400-408
greater-than operator (>), 152-53, 352
greater-than-or-equal-to-operator (>=), 152-53, 352

H
half data type, 132
half vector, 196, 197
handles, role in effects, 230-31, 415-16
hardware, testing, 59
HEIGHT annotation, 277
Hello World analog
   Asm vertex shader example, 6-19
   HLSL vertex shader example, 110-15
hemispheric lighting effect example, 278-86
high-level shader language (HLSL)
   adding diffuse color to vertex shader example, 113-15
   annotations, 402
   vs. Asm shaders, 3
   basic effect example, 222-25
   basic pixel shader example, 115-20
   basic procedural shader example, 120-22
   basic vertex shader example, 110-15
   character types, 399-400
   data types in, 131-49, 401-2
   declarations, 400
   directives in, 397-98
   effects examples, 222-25, 259-86
   expressions, 149-55, 405-7
   floating-point numbers, 398-99
   functions, 159-69, 402-3
   glow example, 171-92
   grammar, 400-408
   hemispheric lighting effect example, 278-86
   identifiers, 400
   initializers, 403
   integer numbers, 399
   keywords, 396-97
   lexical conventions, 398-99
   multiple-pass rendering with alpha blending effect example, 265-73
   overview, 109
   per-pixel lighting effect example, 259-65
   pixel shader 1_x considerations, 386-95
   program construct, 400
   sparkle example, 192-212
   statements, 155-59, 404-5
   strings, 400
   structures, 402
   techniques, 404
   tokens, 407-8
   usages, 401
   variables, 402-3
   white space, 398
HLSL. See high-level shader language (HLSL)
hyphen (-), as subtraction operator, 151, 352

I
i# input register, 29, 30
ID3DXBuffer interface, 181
ID3DXCreateEffectPool interface, 230
ID3DXEffect interface, 225-26, 230, 232, 234, 236, 252
   keywords, 417
ID3DXEffectCompiler interface, 230, 417
identifiers, in HLSL, 400
identity matrices, 62
idexp intrinsic function, 368
IDirect3DDevice9 interface
   CreatePixelShader method, 98, 181, 203
   CreateVertexBuffer method, 14
   CreateVertexDeclaration method, 45, 52-53, 100
   CreateVertexShader method, 14, 61, 100, 113, 127, 181, 189, 203
   DrawIndexedPrimitive method, 56, 65
   DrawPrimitive method, 18, 22, 100, 130, 258
   SetIndices method, 65
   SetRenderState method, 46, 65
   SetStreamSource method, 18, 64, 258
   SetTexture method, 309
   SetTransform method, 65
   SetVertexDeclaration method, 56, 258
IDirect3DTexture9 interface, 182
IDirect3DVertexShader9 interface, 181
IDs, role in effects, 416
#if directive, 397
if instruction, 36, 88, 319
if statements, 157-58
if_comp instruction, 37, 88, 319-20
#ifdef directive, 397
#ifndef directive, 397
if_pred instruction, 37, 88, 320
illumination equation, 299-300
in keyword, HLSL, 115
#include directive, 397
indexed vertices, 56
IndexedVertexBlendEnable effect state, 422
InitDeviceObjects method
   defined, 122
   examples, 120, 206-10, 256
   Vertex Blend SDK sample, 58
   Vertex Shader SDK sample, 51-52
initializers, HLSL grammar, 403
inline shaders, 221-22, 224, 227-28
inout keyword, HLSL, 115
input registers, pixel shader
   declaring, 75
   defined, 73
   initializing, 75
   role in pixel shader, 75
   by shader version, 76-80
   vFace, 79, 80
   vPos, 79
input registers, vertex shader
   example, 27, 28
   overview, 9, 26, 28
   restrictions and limitations, 30-31
   types, 29-31
   vertex shader fog example, 44
instruction modifiers
   pixel shader, 90, 92, 389-90
   vertex shader, 37, 38
instruction set, pixel shader
   function, 80-82, 89
   modifiers, 89-92, 389-90
   overview, 73, 74-75, 89
instruction set, vertex shader, 26, 37-39
instructions, pixel shader
   arithmetic, 80, 81, 83-84
   basic pixel shader example, 96
   co-issuing, 91
   flow-control, 80, 81, 87-88
   macro-op, 80, 81, 84-85
   maximum number by shader version, 81-82
   order in shader, 74-75
   setup, 74, 75, 80, 81, 82-83
   texture, 80, 81, 85-87
   types, 80-89
instructions, vertex shader
   arithmetic, 28, 32, 34-35
   flow-control, 28, 32, 36-37
   macro-op, 28, 32, 35
   maximum number by shader version, 32-33
   order in shader, 7, 27-28
   setup, 32, 33-34
   texture, 28, 32, 36
   types, 28
int data type, 131, 144
integer numbers, 144, 399
intrinsic data types, 347-48
intrinsic functions
   defined, 111
   list, 358-86
   mul, 111-12
   overview, 168-69, 357-58
isfinite intrinsic function, 367
isinf intrinsic function, 368
isnan intrinsic function, 368

L
label instruction, 37, 88, 320-21
LastPixel effect state, 424
left-to-right order, 290-91
length intrinsic function, 368-69
lerp intrinsic function, 369
less-than operator (<), 152-53, 352
less-than-or-equal-to operator (<=), 152-53, 352
light
   ambient, 299, 300
   attenuation, 302-3
   diffuse, 237, 299, 300-301
   direction, 175, 178, 239, 261
   emissive, 299, 302
   intensity, 261
   per-pixel, in HLSL effect example, 259-65
   reflected, 249, 278, 299
   role in creating vertex colors, 6, 299-302
   specular, 299, 301-2
   spotlight cone, 303-4
   types, 299-302
light color, 237, 241
light states, 226, 419-20
LightAmbient effect state, 419
LightAttenuation effect state, 419
LightDiffuse effect state, 419
LightDirection effect state, 419
LightEnable effect state, 419
LightFalloff effect state, 419
Lighting effect state, 422
LightPbi effect state, 419
LightPosition effect state, 419
LightRange effect state, 419
LightSpecular effect state, 420
LightTheta effect state, 420
LightType effect state, 420
#line directive, 397
linear light attenuation factor, 302, 303
lit instruction, 34, 321-22
lit intrinsic function, 369
literals, role in effects, 417
LocalViewer effect state, 422
log instruction, 35, 84
log intrinsic function, 370
log2 intrinsic function, 370
log10 intrinsic function, 370
logp instruction, 35, 322
loop counter register (aL), pixel shader, 77, 78
loop counter register (aL), vertex shaders, 29, 30
loop instruction, 37, 88, 323
lrp instruction, 35, 85, 323

M
m3x2 instruction, 35, 85, 324
m3x3 instruction, 35, 85, 324
m3x4 instruction, 35, 85, 324-25
m4x3 instruction, 35, 85, 325
m4x4 instruction, 35, 85, 325-26
macro-op instructions
   pixel shader, 80, 81, 84-85
   vertex shader, 32, 35
mad instruction, 34, 84, 326
MagFilter effect state, 427
masking out, in HLSL pixel shader example, 119-20
material colors, 6, 299
material states, 226, 420
MaterialAmbient effect state, 420
MaterialDiffuse effect state, 420
MaterialEmissive effect state, 420
MaterialPower effect state, 420
MaterialSpecular effect state, 420
matrices
   array accessing, 140-41
   blending, in Vertex Blend SDK sample, 59-60
   data types, 138-42
   defined, 289
   examples, 7, 9-10, 239, 261
   initializing, 12, 16
   left-to-right order, 290-91
   packing order, 141-42
   projection-type, 16, 17
   role of affine transformations, 289-90
   row-major vs. column-major order, 64, 133, 141-42
   simple transformation example, 7, 9-10
   transposing, 17, 56, 64
matrix data type, 138-42, 348, 410
matrix multiplies, 9, 56, 111, 112, 177-78
matrix types
   array accessing, 140-41
   component access, 138-39
   component swizzling, 139-40
   overview, 138
max instruction, 34, 85, 326-27
max intrinsic function, 371
MaxAnisotropy effect state, 427
MaxMipLevel effect state, 427
mesh
   environment map example, 256
   sparkle example, 206-10, 211
   Vertex Blend SDK sample, 58-60, 65
metallic flakes example. See sparkle example
Metallicflakes.fx file, 202, 211
methods
   Begin, ID3DXEffect interface, 225, 226, 236
   CloneMesh, 209
   ConfirmDevices, 30, 123, 179
   CreatePixelShader, 98, 181, 203
   CreateVertexBuffer, 14
   CreateVertexDeclaration, 45, 52-53, 100
   CreateVertexShader, 14, 61, 100, 113, 127, 181, 189, 203
   DeleteDeviceObjects, 123
   DrawIndexedPrimitive, 56, 65
   DrawPrimitive, 18, 22, 100, 130, 258
   DrawSubset, 211, 242-43
   End, ID3DXEffect interface, 225-26, 236
   FrameMove
      basic pixel shader example, 100
      defined, 123
      Vertex Blend SDK sample, 62, 63, 64
      Vertex Shader SDK sample, 55-56
      view matrix, 16
   GetAnnotation, 232
   GetAnnotationByName, 232
   GetNumFaces, 258
   GetNumVertices, 258
   GetParameter, 231
   InitDeviceObjects
      defined, 122
      examples, 120, 206-10, 256
      Vertex Blend SDK sample, 58
      Vertex Shader SDK sample, 51-52
   OneTimeSceneInit, 122, 129
   Pass, 225, 236, 252
   Render, 123, 210-11, 256
   RestoreDeviceObjects
      Asm sample code, 10-12
      basic 2-D image processing pixel shader example, 96, 97, 98-99
      effect creation code, 232
      HLSL sample code, 123-26
      overview, 12, 123
      Vertex Blend SDK sample, 61, 62
      Vertex Shader SDK sample, 54-55
      vertex shader tutorial, 12, 16
   SetIndices, 65
   SetMatrix, 183, 235
   SetPixelShader, 100
   SetPixelShaderConstant, 75
   SetRenderState, 46, 65
   SetStreamSource, 18, 64, 258
   SetTechnique, 235-36
   SetTexture, 96, 309
   SetTransform, 65
   SetVertexDeclaration, 18, 56, 258
   SetVertexShader, 18, 19, 56, 64, 65
   ValidateTechnique, 234
Microsoft Visual C++ projects, 180
Microsoft Visual Studio, 117, 181
min instruction, 34, 85, 327
min intrinsic function, 371
minus sign (-), as subtraction operator, 151, 352
MipFilter effect states, 427
MipMapLoadBias effect state, 428
model space
   converting data to projection space
      glow example, 176-77
      simple program example, 6-19
   defined, 5, 288
   steps in converting data to projection space, 5-6, 287, 288
modf intrinsic function, 371
modulus operator (%), 151-52, 352
mov instruction, 28, 34, 84, 327-28
mova instruction, 34, 328
mul instruction, 34, 84, 111-12, 328
mul intrinsic function
   glow example, 186
   HLSL vertex shader effect example, 225
   overview, 372-73
multiplication operator (*), 151, 186, 352
MultiSampleAntialias effect state, 422
MultiSampleMask effect state, 422
multisampling, 80
multitexture blending
   fixed-function pipeline, 70
   glow example, 190-91
   overview, 70, 71, 101
   pixel shader example, 101-6
   programmable pixel shader, 70-71
   sparkle example, 309
   vertex shader examples, 239-40, 241, 254, 255

N
NAME annotation, 277
negate modifier, 38, 90, 389
noise functions, 120
noise intrinsic function, 198, 373
nop instruction, 34, 84, 329
NORMAL semantic, 355
normal vector, 261
normalize intrinsic function, 178, 186, 373
NormalizeNormals effect state, 422
normals, 241
nrm instruction, 35, 85, 329

O
objects, as resources, 123
OneTimeSceneInit method, 122, 129
OpenGL, 290-91
operators
   additive, 151-52, 352
   arithmetic, 151-52, 352
   array, 155
   assignment, 150-51, 353
   Boolean, 152
   cast, 153
   comma, 154, 353
   comparison, 152-53
   multiplicative, 151-52, 352
   overview, 150
   postfix, 153, 351
   precedence, 155
   prefix, 153, 352
   structure, 154
   unary, 151
out keyword, HLSL, 115
output registers
   pixel shader, 73
   by pixel shader version, 77, 79
   role in pixel shader, 75
   vertex shaders, 9, 10, 26, 31-32

P
p0 input register
   pixel shader, 77, 78
   vertex shaders, 29, 30
parentheses, 220, 239, 240, 261
Pass method, 225, 236, 252
passes, effect
   Asm vs. HLSL shaders, 227-28
   multiple, 226, 227-29, 265-73
   multiple-pass rendering with alpha blending effect example, 265-73
   overview, 227-28, 229, 411
percent sign (%), as modulus operator, 151-52, 352
period (.), as structure operator, 154
periodic functions, in Vertex Blend SDK sample, 62
perspective, 294, 295, 296-97
per-vertex data, 8, 9, 68
phase instruction, 75, 83, 329-30
pipeline, 3-D
   block diagrams, 4, 67, 215, 287
   effects overview, 215-16
   pixel processing, 67-72
   vs. programmable shaders, 70, 71-72, 216
   steps in primitive processing, 68, 215-16
   vertex processing, 4-6, 287-304
pipeline states
   in Asm effects example, 239
   defined, 216
   initializing, 16
   list of effect states, 421-26
pixel colors, 73, 201, 259
pixel pipe render states, 226
pixel processing
   basic 2-D image example, 95-101
   block diagrams, 4, 67, 69, 70, 71, 72, 215
   defined, 68
   role in 3-D pipeline, 67-68
pixel shader constant states, 226, 429
pixel shaders
   adding to vertex shader, 115-22
   Asm effects example, 243-49
   Asm instructions, 305-45
   basic 2-D image processing example, 95-101
   block diagram, 74
   defined, 67, 73
   HLSL effect example, 259-65
   inputs and outputs, 73
   instruction order, 74-75
   layout example, 74-75
   maximum number of instructions by shader version, 81-82
   multitexture blending, 70, 71, 101-6
   object as data type, 148-49
   objects, 123
   output, 73, 75, 77, 79
   overview, 67
   programmable, 69, 70-71, 101-6
   ps_1_x considerations, 386-95
   ps_1_x limitations, 387-88
   resources, 123
   sparkle example, 199-203
   version differences, 92-93
pixelshader data type, 148-49, 410
PixelShader effect state, 428
PixelShaderConstant effect states, 429, 430
plus operator (+), 151, 186, 352
point size output register, 31
PointFogEnable effect state, 422
PointScale effect states, 423
PointScaleEnable effect state, 422
PointSize effect state, 423
PointSize_Max effect state, 423
PointSize_Min effect state, 423
PointSpriteEnable effect state, 423
pools, 414-15
position registers, 31, 79, 80
POSITION semantic, 355, 356
position vector, 261
postfix operators, 153, 351
pow instruction, 35, 85, 330
pow intrinsic function, 374
#pragma directive, 397
predicate register (p0)
   pixel shader, 77, 78
   vertex shader, 29, 30
prefix operators, 153, 352
primitives
   defined, 4
   DrawPrimitive method, 18, 22, 100, 130, 258
   processing, 3-D pipeline block diagram, 68, 215-16
procedural shaders, 198-99, 200, 204-5. See also procedural textures
procedural textures, 120-22, 198, 200, 204-5
ProcessVertices function, 28
programmable shaders
   vs. fixed-function pipeline, 69, 70-71, 216
   multilayered textures example, 101-6
   overview, 69, 70-71
programs, HLSL grammar, 400
projection matrix, 16, 17
PROJECTION semantic, 276
projection space
   converting data from model space
      glow example, 176-77
      simple program example, 6-19
   defined, 5
   vs. model space, 4, 5, 6
   scaling to screen space, 68, 288
   steps in converting data from model space to, 5-6, 287, 288
   vertex processing, 288
projection transform, 6, 288, 294-97
ProjectionTransform effect state, 433
promotion casting, 143
ps instruction, 83, 330-31
ps_1_x
   HLSL considerations, 386-95
   input registers, 76-77
   limitations, 387-88
   maximum number of instruction slots, 81
   modifiers, 388-91
   output registers, 77
   texture reads, 391-96
ps_2_x and later
   input registers, 77-80
   maximum number of instruction slots, 81, 82
   output registers, 79
ps_3_x
   maximum number of instruction slots, 81, 82
   types of registers, 79-80
PSIZE semantic, 355, 356

Q-R
quads, rendering, 95
r# register
   pixel shader, 76, 78
   vertex shader, 29, 30
radians intrinsic function, 374
RangeFogEnable effect state, 423
rcp instruction, 34, 84, 331
reflect intrinsic function, 374
reflected light, 249, 278, 299
reflection vector, 197, 261
refract intrinsic function, 375
register declarations
   role of registers, 8, 9
   simple example, 7, 8-9
   types of registers, 9
   Vertex Blend SDK sample, 58
   Vertex Shader SDK sample, 49-50
registers, pixel shader
   color, 76, 77, 78
   constant, 73, 76
   input, 73, 75, 76-80
   modifiers, 89-92, 388-91
   overview, 75-76
   by pixel shader version, 76-80
   temporary, 73, 76
   texture, 76-77, 78, 92-93
   types, 73, 75-80
registers, vertex shader
   constant, 9, 10, 17-18, 26, 27, 28, 29, 30, 31
   explicit binding, 166-67
   input, 9, 10, 26, 29-31
   modifiers, 37, 38-39
   output, 9, 10, 26, 31-32
   overview, 26
   temporary, 9, 26, 29, 30, 31
   types, 26, 28-32
render code
   Asm examples, 45-46, 100, 106, 241-43, 248-49, 256
   defined, 129-30
   HLSL examples, 210-11, 264-65, 272-73
   role of techniques and passes, 227-29
   Vertex Blend SDK sample, 64-65
   vertex shader tutorial, 16-19, 23
   with and without effects, 210-11, 234-36
Render method, 123, 210-11, 256
render states
   overview, 226, 421-26
   setting up, 12, 16, 129
   in vertex shader fog example, 46
rendering. See render code
rep instruction, 37, 88, 331-32
resources
   adding files to Microsoft Visual C++ projects, 180
   creating, 123-29
   defined, 123
   examples, 117, 180
   overview, 123
   re-creating, in Vertex Blend SDK sample, 62
RestoreDeviceObjects method
   Asm sample code, 10-12
   basic 2-D image processing pixel shader example, 96, 97, 98-99
   effect creation code, 232
   HLSL sample code, 123-26
   overview, 12, 123
   Vertex Blend SDK sample, 61, 62
   Vertex Shader SDK sample, 54-55
   vertex shader tutorial, 12, 16
ResultArg effect state, 432
ret instruction, 37, 88, 332
return statement, 156-57
reusing code, 23
rotation, 288, 289, 290, 292
round intrinsic function, 375
row vectors, 290, 291
row-column order, 290, 291
row_major type modifier, 132, 133, 141-42
rsq instruction, 35, 84, 332-33
rsqrt intrinsic function, 376

S
s# input register
   pixel shader, 78
   vertex shader, 29, 30
sample framework, 122-23
sampler data types, 144-47, 410
Sampler effect state, 426
sampler register
   pixel shader, 70, 71, 73, 78
   vertex shader, 29, 30
sampler stage states, 216, 226, 426-28
sampler states, 144, 216, 226, 426
samplers, defined, 78
Sample_VS_Asm.fx file, 237
sampling textures
   examples, 101-6, 116-17, 245, 262-63
   overview, 69, 70, 71, 73
   sampler data types, 144-47
   step in pixel processing, 69, 70, 71, 73
saturate instruction modifier, 389-90
saturate intrinsic function, 376
saturate modifier (_sat), 38, 90
scalar data types, 131-32, 347
scale by 2 source register modifier, 389
scaling, 68, 288, 289, 290, 292
screen space, 68, 288
semantics
   examples, 111, 115, 175-76, 196, 197, 261-62
   overview, 75, 111, 135, 162-66
   pixel shader, 164-66, 356-57
   role in effects, 230, 417
   vertex shader, 162-64, 355-56
semicolon (;), 27, 74, 245
SetIndices method, 65
SetMatrix method, 183, 235
setp instruction, 37, 88, 333
SetPixelShader method, 100
SetPixelShaderConstant method, 75
SetRenderState method, 46, 65
SetStreamSource method, 18, 64, 258
SetTechnique method, 235-36
SetTexture method, 96, 309
SetTransform method, 65
setup instructions
   pixel shader, 74, 75, 80, 81, 82-83
   vertex shader, 32, 33-34
SetVertexDeclaration method, 18, 56, 258
SetVertexShader method, 18, 19, 56, 64, 65
sge instruction, 35, 334
sgn instruction, 35, 334
ShadeMode effect state, 424
shader constant states, 226, 254, 429-30
shader constants, 9, 10, 17-18, 282-83
shader file names, 53
shader objects. See also vertex shaders
   creating, 12, 13-14
   examples, 181, 189, 247, 248
   role of effects, 203, 233-34, 264
shader states
   Asm effects examples, 239, 240, 245, 251-52
   overview, 216, 226, 428
shaders, 3-4, 27. See also pixel shaders; programmable shaders; vertex shaders
shared variable, 135
sharing effect parameters, 229-30, 414-15
sign intrinsic function, 376
signed-scale source register modifier, 390
Simple_VS_and_PS_Asm.fx file, 246, 247
Simple_VS_Asm.fx file, 218
sin intrinsic function, 377
sincos instruction, 35, 85, 335
sincos intrinsic function, 377
sine function, 47, 48, 50-51, 56
sinh intrinsic function, 377
skew, 288-89, 290
skinning. See vertex data, blending
slash (/), 27, 74
slt instruction, 35, 335
smoothstep intrinsic function, 378
source register modifiers
   pixel shader, 90, 91, 92, 388-90
   vertex shader, 37, 38-39
sparkle example
   complete shader code, 192-95
   EffectEdit SDK sample, 211-12
   environmental map, creating, 205-6
   mesh, creating, 206-10
   overview, 192-95
   pixel shader code, 199-201
   procedural texture, creating, 204-5
   render code, 210-11
   rendering color combinations, 201-2
   texture shader code, 198-99
   vertex and pixel shaders, creating, 202-3
   vertex shader code, 195-98
specular color, 197, 200, 259, 261, 262
specular light, 299, 301-2
specular output register, 31
SpecularEnable effect state, 423
SpecularMaterialSource effect state, 423
spotlight cone, 303-4
sqrt intrinsic function, 378
square brackets ([]), 155
squared light attenuation factor, 302, 303
SrcBlend effect state, 424
SRGBTexture effect state, 428
statements
   blocks, 156
   compile statement, 225, 263
   do statements, 158
   flow-control statements
      do statements, 158
      for statements, 158-59
      if statements, 157-58
      overview, 157
      while statements, 159
      for statements, 158-59
      HLSL grammar, 404-5
      if statements, 157-58
   overview, 155-56
   return statement, 156-57
   while statements, 159
states. See effect states
static variable, 134
stencil testing, as step in pixel processing, 69, 72
StencilEnable effect state, 424
StencilFail effect state, 424
StencilFunc effect state, 424
StencilMask effect state, 426
StencilPass effect state, 424
StencilRef effect state, 425
StencilWriteMask effect state, 425
StencilZFail effect state, 425
step intrinsic function, 378
storage class modifiers, HLSL
   extern keyword, 134
   overview, 134
   shared keyword, 135
   static keyword, 134
   uniform keyword, 135
strings, in HLSL, 148, 400
string-safe functions, 53
structure operators, 154
structures
   HLSL grammar, 402
   overview, 147-48
sub instruction, 84, 335-36
subtraction operator (-), 151, 352
surface skinning, 56. See also vertex data, blending
swizzling
   matrix components, 139-40
   pixel shader, 90
   vector components, 136-37
   vertex shader, 38-39

T
t# texture registers, 76-77, 78
tan intrinsic function, 378-79
TANGENT semantic, 355
tanh intrinsic function, 379
TARGET annotation, 277
teapot model, 4, 5
techniques, effect
   Asm vs. HLSL shaders, 227-28
   HLSL grammar, 404
   multiple, 228-29, 265-73
   multiple-pass rendering with alpha blending effect example, 265-73
   overview, 216, 228-29, 411
   rendering, 226, 235-36
   SetTechnique method, 235-36
   TGlowAndTexture technique, 269-71
   TGlowOnly technique, 271-72
   THemisphere technique, 283
   TVertexShaderOnly_Asm technique, 239
   validating, 234
temporary registers
   pixel shader, 73, 76, 78
   vertex shader, 9, 26, 29, 30, 31
TESSFACTOR semantic, 355
testing hardware, 59
tex instruction, 85, 336
tex1D intrinsic function, 379-80
tex1Dbias intrinsic function, 380
tex1Dproj intrinsic function, 380-81
tex2D intrinsic function, 381-82
tex2Dbias intrinsic function, 382
tex2Dproj intrinsic function, 382
tex3D intrinsic function, 383
tex3Dbias intrinsic function, 383-84
tex3Dproj intrinsic function, 384
tex3x3spec instruction, 393-94
tex3x3vspec instruction, 394-95
texbem instruction, 85, 336
texbeml instruction, 85, 337
texcoord instruction, 85, 337
TEXCOORD semantic, 355, 356, 357
TexCoordIndex effect state, 432
texcrd instruction, 86, 337
texCUBE intrinsic function, 384-85
texCUBEbias intrinsic function, 385
texCUBEproj intrinsic function, 385-86
texdepth instruction, 86, 338
texdp3 instruction, 86, 338
texdp3tex instruction, 86, 338
texkill instruction, 86, 338-39
texld instruction, 86, 339
texldb instruction, 86, 339-40
texldd instruction, 86, 340
texldl instruction, 36, 86, 340-41
texldp instruction, 86, 341
texm3x2 instruction, 392-93
texm3x2depth instruction, 86, 341
texm3x2pad instruction, 86, 341-42
texm3x2tex instruction, 86, 342
texm3x3 instruction, 86, 342, 393
texm3x3pad instruction, 86, 342
texm3x3spec instruction, 87, 342-43
texm3x3tex instruction, 87, 343
texm3x3vspec instruction, 343
texreg2ar instruction, 87, 343, 395-96
texreg2gb instruction, 87, 344, 396
texreg2rgb instruction, 87, 344, 395
texture coordinate register, 31, 78
texture coordinates, 73, 78
texture data type, 149, 410
Texture effect state, 431
texture filtering, 70
texture instructions
   pixel shader, 80, 81, 85-87
   vertex shader, 32, 36
texture maps, 95-101
texture reads, 391-96
texture registers, 76-77, 78, 92-93
texture sampling, 69, 70, 71, 73, 78, 101, 246
texture shaders, 123, 198-99. See also procedural textures
texture stage states, 70, 190-91, 216, 226, 431-32
texture stages, defined, 70
texture states, 216, 226, 431
TextureFactor effect state, 425
textures. See multitexture blending; sampling textures
TextureTransform effect state, 433
TextureTransformFlag effect state, 432
texturing, in Asm vertex and pixel shader example, 243-49
times operator (*), 151, 186, 352
tokens, HLSL grammar, 407-8
transform states, 226, 433
translation, 288-89, 290, 292
transpose intrinsic function, 386
transposing matrices, 17, 56, 64
TweenFactor effect state, 423
tweening, 6
type casts, 347, 349-51
type modifiers, 132-33
typedef keyword, 348-49
types, HLSL grammar, 401-2. See also data types, HLSL

U
unary operators, 151
#undef directive, 397
uniform shader constants, 282-83
uniform variable, 135
usages
   HLSL grammar, 401
   role in effects, 417
user-defined data types, 347, 348-49
user-defined functions, 353-55

V
v# registers
   pixel shader, 76, 77, 78-79
   vertex shader, 29, 30
ValidateTechnique method, 234
validation, effect, 234, 418
variables
   declaring, 132, 409-10
   HLSL grammar, 402-3
vector data type, 136, 347-48, 410
vector math, 117-18, 137
vector types
   component access, 136
   component swizzling, 136-37
   overview, 135-36
version declarations, 7-8
version instructions
   pixel shader, 74
   vertex shader, 27
versions, pixel shader
   differences, 92-93
   input registers, 76-80
   maximum number of instructions, 81-82
   output registers, 77, 79
   registers, 76-80
versions, vertex shader
   choosing, 39-41
   maximum number of instructions, 32-33
Vertex Blend SDK sample, 56-65
vertex buffer, 12, 14, 15, 28, 128, 208-10
vertex color, 6, 297, 299-302
vertex data
   adding diffuse color examples, 19-23, 113-15
   blending, 5-6, 56-65
   block diagram, 26
   converting, 287-97
   declaring, 12, 14
   transformations, 287-97
   tweening, 6
vertex declarations, 12, 15-16, 21-23, 117, 128-29
vertex fog, 6, 43-47, 69, 297-99
vertex pipe render states, 226
vertex processing
   3-D graphics pipeline, 287
   3-D pipeline block diagram, 215-16
   defined, 5
   overview, 4, 287
   role of lights and materials, 6, 299-302
   steps in converting data from model space to projection space, 5-6, 287, 288
vertex shader constant states, 226, 429
Vertex Shader SDK sample, 47-56
vertex shaders. See also virtual machine, pixel shader; virtual machine, vertex shader
   Asm examples, 43-65
   Asm instructions, 305-45
   basic pixel shader example, 95, 100
   blending example, 56-65
   block diagram, 25, 26
   comments, 27-28
   creating shader objects, 12, 13-14
   defined, 4
   Hello World analog, 6-19, 110-15
   layout example, 27-28
   maximum number of instructions by version, 32-33
   objects, 123
   processing overview, 4-6
   resources, 123
   sample matrix transformation, 7, 9-10
   sample register declaration, 7, 8-9
   sample version declaration, 7-8
   SDK sample, 47-56
   simple example, 6-19
   version differences, 7-8, 39-41
vertex tweening, 6
VertexBlend effect state, 423
vertexshader data type, 148, 410
VertexShader effect state, 252, 428
VertexShaderConstant effect states, 429, 430
vertical bar (|), as Boolean math operator, 152, 352
vertices
   animating, 56, 62
   converting
   model space to projection space in simple program example, 6-19
model space to world space, 291-92
world space into view space, 292-94
   defined, 4
vFace input register, 79, 80
view matrix, 16, 292-94
VIEW semantic, 276
view space, 6, 187, 288, 292-94
view transform, 6, 288, 292-94
viewing frustrum. See frustrum
viewport scaling, 68, 288
VIEWPROJECTION semantic, 276
ViewTransform effect state, 433
virtual machine, pixel shader
   block diagram, 68, 72-73
   defined, 67
virtual machine, vertex shader
   block diagram, 25-26
   defined, 25
   implementing registers, 29-32
   modifiers, 37-39
Visual C++ projects, 180
Visual Studio, 117, 181
vPos input register, 79, 80
vs instruction, 33, 344-45
VS vertex shader function, 195, 196-98, 224-25, 281
vs_1_1
   maximum number of instruction slots, 33
   overview, 40
vs_2_x
   maximum number of instruction slots, 33
   overview, 40
   Vertex Blend SDK sample, 58
vs_3_x
   maximum number of instruction slots, 33
   overview, 41
VSGlow function, 183-88
.vsh files, 53, 61
VSTexture function, 171, 173, 176-78, 179

W
while statements, 159
WIDTH annotation, 277
world matrix, 16
WORLD semantic, 276
world space, 5, 288, 291-92
world transform, 5, 288, 291-92
WorldTransform effect state, 433
WORLDVIEW semantic, 276
WORLDVIEWPROJ semantic, 230, 231
WORLDVIEWPROJECTION semantic, 276, 277
Wrap effect states, 425
write masks
   pixel shader, 90, 91-92
   vertex shaders, 38

X-Z
XFile string, 277, 281
ZEnable effect state, 425
ZFunc effect state, 426
ZVisible effect state, 426
ZWriteEnable effect state, 426



Last Updated: May 29, 2003
Top of Page