Foreword | p. xvi |
Acknowledgments | p. xvii |
Introduction to Shader Programming | |
Fundamentals of Vertex Shaders | p. 4 |
What You Need to Know/Equipment | p. 5 |
Vertex Shaders in the Pipeline | p. 5 |
Why Use Vertex Shaders? | p. 7 |
Vertex Shader Tools | p. 8 |
Vertex Shader Architecture | p. 16 |
High-Level View of Vertex Shader Programming | p. 18 |
What Happens Next? | p. 35 |
Programming Vertex Shaders | p. 38 |
RacorX | p. 38 |
RacorX2 | p. 49 |
RacorX3 | p. 53 |
RacorX4 | p. 59 |
RacorX5 | p. 66 |
What Happens Next? | p. 70 |
Fundamentals of Pixel Shaders | p. 72 |
Why Use Pixel Shaders? | p. 72 |
Pixel Shaders in the Pipeline | p. 74 |
Pixel Shader Tools | p. 79 |
Pixel Shader Architecture | p. 81 |
High-Level View of Pixel Shader Programming | p. 84 |
Summary | p. 121 |
What Happens Next? | p. 122 |
Programming Pixel Shaders | p. 125 |
RacorX6 | p. 125 |
RacorX7 | p. 137 |
RacorX8 | p. 140 |
RacorX9 | p. 144 |
Further Reading | p. 147 |
Basic Shader Development with Shader Studio | p. 149 |
Introduction | p. 149 |
What You Should Know | p. 149 |
Create a Vertex Shader | p. 152 |
Create a Pixel Shader | p. 159 |
Shaders Reference | p. 160 |
Assets | p. 169 |
Further Info | p. 169 |
Vertex Shader Tricks | |
Vertex Decompression in a Shader | p. 172 |
Introduction | p. 172 |
Vertex Compression Overview | p. 172 |
Vertex Shader Data Types | p. 173 |
Compressed Vertex Stream Declaration Example | p. 174 |
Basic Compression | p. 174 |
Advanced Compression | p. 180 |
Conclusion | p. 187 |
Shadow Volume Extrusion Using a Vertex Shader | p. 188 |
Introduction | p. 188 |
Creating Shadow Volumes | p. 189 |
Effect File Code | p. 191 |
Using Shadow Volumes with Character Animation | p. 192 |
Character Animation with Direct3D Vertex Shaders | p. 195 |
Introduction | p. 195 |
Tweening | p. 195 |
Skinning | p. 197 |
Animating Tangent Space for Per-Pixel Lighting | p. 202 |
Summary | p. 208 |
Lighting a Single-Surface Object | p. 209 |
Vertex Shader Code | p. 211 |
Enhanced Lighting for Thin Objects | p. 213 |
About the Demo | p. 214 |
Optimizing Software Vertex Shaders | p. 215 |
Introduction to Pentium 4 Processor Architecture | p. 216 |
Introduction to the Streaming SIMD Extensions | p. 217 |
Optimal Data Arrangement for SSE Instruction Usage | p. 218 |
How the Vertex Shader Compiler Works | p. 220 |
A Detailed Example | p. 224 |
Compendium of Vertex Shader Tricks | p. 228 |
Introduction | p. 228 |
Periodic Time | p. 228 |
One-Shot Effect | p. 229 |
Random Numbers | p. 229 |
Flow Control | p. 230 |
Cross Products | p. 230 |
Examples | p. 230 |
Summary | p. 231 |
Perlin Noise and Returning Results from Shader Programs | p. 232 |
Limitations of Shaders | p. 232 |
Perlin Noise and Fractional Brownian Motion | p. 234 |
Final Thoughts | p. 251 |
Pixel Shader Tricks | |
Blending Textures for Terrain | p. 256 |
Image Processing with 1.4 Pixel Shaders in Direct3D | p. 258 |
Introduction | p. 258 |
Simple Transfer Functions | p. 259 |
Filter Kernels | p. 261 |
Edge Detection | p. 262 |
Mathematical Morphology | p. 265 |
Conclusion | p. 268 |
Hardware Support | p. 269 |
Sample Application | p. 269 |
Hallo World--Font Smoothing with Pixel Shaders | p. 270 |
Emulating Geometry with Shaders--Imposters | p. 273 |
Smooth Lighting with ps.1.4 | p. 277 |
Per-Pixel Fresnel Term | p. 281 |
Introduction | p. 281 |
Fresnel Effects | p. 281 |
Effect Code | p. 283 |
Diffuse Cube Mapping | p. 287 |
Introduction | p. 287 |
Using Diffuse Cube Maps | p. 287 |
Generating Dynamic Diffuse Cube Maps | p. 288 |
Accurate Reflections and Refractions by Adjusting for Object Distance | p. 290 |
Introduction | p. 290 |
The Artifacts of Environment Mapping | p. 290 |
UV Flipping Technique to Avoid Repetition | p. 295 |
Photorealistic Faces with Vertex and Pixel Shaders | p. 296 |
Introduction | p. 296 |
Software | p. 296 |
Resources | p. 297 |
3D Model | p. 297 |
A Word About Optimizations | p. 302 |
Full Head Mapping | p. 309 |
What's Next? | p. 312 |
Environment Mapping for Eyes | p. 315 |
Facial Animation | p. 317 |
Conclusion | p. 317 |
Non-Photorealistic Rendering with Pixel and Vertex Shaders | p. 319 |
Introduction | p. 319 |
Rendering Outlines | p. 319 |
Cartoon Lighting Model | p. 322 |
Hatching | p. 324 |
Gooch Lighting | p. 326 |
Image Space Techniques | p. 328 |
Conclusion | p. 333 |
Animated Grass with Pixel and Vertex Shaders | p. 334 |
Introduction | p. 334 |
Waving the Grass | p. 334 |
Lighting the Grass | p. 334 |
Texture Perturbation Effects | p. 337 |
Introduction | p. 337 |
Wispy Clouds | p. 337 |
Perturbation-Based Fire | p. 342 |
Plasma Glass | p. 344 |
Summary | p. 346 |
Rendering Ocean Water | p. 347 |
Introduction | p. 347 |
Sinusoidal Perturbation in a Vertex Shader | p. 348 |
CMEMBM Pixel Shader with Fresnel Term | p. 350 |
Ocean Water Shader Source Code | p. 352 |
Sample Applications | p. 356 |
Rippling Reflective and Refractive Water | p. 357 |
Introduction | p. 357 |
Generating Reflection and Refraction Maps | p. 358 |
Vertex Shader | p. 358 |
Pixel Shader | p. 360 |
Conclusion | p. 362 |
Crystal/Candy Shader | p. 363 |
Introduction | p. 363 |
Setup | p. 363 |
Vertex Shader | p. 364 |
Pixel Shader | p. 365 |
Summary | p. 368 |
Bubble Shader | p. 369 |
Introduction | p. 369 |
Setup | p. 369 |
Vertex Shader | p. 370 |
Pixel Shader | p. 372 |
Summary | p. 375 |
Per-Pixel Strand-Based Anisotropic Lighting | p. 376 |
Introduction | p. 376 |
Strand-Based Illumination | p. 376 |
Per-Pixel Strand-Based Illumination | p. 378 |
Summary | p. 382 |
A Non-Integer Power Function on the Pixel Shader | p. 383 |
Overview | p. 383 |
Traditional Techniques | p. 384 |
Mathematical Details | p. 387 |
Power Function on the Pixel Shader | p. 391 |
Applications | p. 396 |
Summary | p. 402 |
Bump Mapped BRDF Rendering | p. 405 |
Introduction | p. 405 |
Bidirectional Reflectance Distribution Functions | p. 406 |
Decomposing the Function | p. 407 |
Reconstruction | p. 407 |
Adding the Bumps | p. 410 |
Conclusion | p. 412 |
Real-Time Simulation and Rendering of Particle Flows | p. 414 |
Motivation | p. 414 |
Ingredients | p. 415 |
How Does a Single Particle Move? | p. 416 |
Basic Texture Advection: How Do a Bunch of Particles Move? | p. 417 |
Inflow: Where are the Particles Born? | p. 421 |
How Can Particles Drop Out? | p. 423 |
Implementation | p. 423 |
Summary | p. 425 |
Using 3D Textures with Shaders | |
3D Textures and Pixel Shaders | p. 428 |
Introduction | p. 428 |
3D Textures | p. 428 |
Application | p. 435 |
Truly Volumetric Effects | p. 438 |
The Role of Volume Visualization | p. 438 |
Basic Volume Graphics | p. 439 |
Animation of Volume Graphics | p. 441 |
High-Quality but Fast Volume Rendering | p. 444 |
Where to Go from Here | p. 446 |
Acknowledgments | p. 447 |
Engine Design with Shaders | |
First Thoughts on Designing a Shader-Driven Game Engine | p. 450 |
Bump Mapping | p. 450 |
Real-time Lighting | p. 450 |
Use Detail Textures | p. 451 |
Use Anisotropic Filtering | p. 451 |
Split Up Rendering into Independent Passes | p. 451 |
Use_x2 | p. 452 |
Visualization with the Krass Game Engine | p. 453 |
Introduction | p. 453 |
General Structure of the Krass Engine | p. 453 |
Developmental History of the Rendering Component | p. 454 |
Previous Drawbacks of Hardware Development | p. 455 |
Current Drawbacks | p. 455 |
Ordering Effects in the Krass Engine | p. 456 |
Application of the IMG Concept for Terrain Rendering | p. 457 |
Particle Rendering to Exemplify a Specialized Effect Shader | p. 460 |
Summary | p. 461 |
Designing a Vertex Shader-Driven 3D Engine for the Quake III Format | p. 463 |
Quake III Arena Shaders | p. 463 |
Vertex Program Setup in the Viewer | p. 464 |
Vertex Shader Effects | p. 467 |
Rendering Process | p. 471 |
Summary | p. 472 |
Glossary | p. 474 |
About the Authors | p. 481 |
Index | p. 487 |
Table of Contents provided by Syndetics. All Rights Reserved. |
The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.
The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.