Real-Time 3D Rendering with DirectX® and HLSL: A Practical Guide to Graphics Programming

Book description

Get Started Quickly with DirectX 3D Programming: No 3D Experience Needed

This step-by-step text demystifies modern graphics programming so you can quickly start writing professional code with DirectX and HLSL. Expert graphics instructor Paul Varcholik starts with the basics: a tour of the Direct3D graphics pipeline, a 3D math primer, and an introduction to the best tools and support libraries.

Next, you’ll discover shader authoring with HLSL. You’ll implement basic lighting models, including ambient lighting, diffuse lighting, and specular highlighting. You’ll write shaders to support point lights, spotlights, environment mapping, fog, color blending, normal mapping, and more.
Then you’ll employ C++ and the Direct3D API to develop a robust, extensible rendering engine. You’ll learn about virtual cameras, loading and rendering 3D models, mouse and keyboard input, and you’ll create a flexible effect and material system to integrate your shaders.

Finally, you’ll extend your graphics knowledge with more advanced material, including post-processing techniques for color filtering, Gaussian blurring, bloom, and distortion mapping. You’ll develop shaders for casting shadows, work with geometry and tessellation shaders, and implement a complete skeletal animation system for importing and rendering animated models.

You don’t need any experience with 3D graphics or the associated math: Everything’s taught hands-on, and all graphics-specific code is fully explained.
Coverage includes

•    The Direct3D API and graphics pipeline
•    A 3D math primer: vectors, matrices, coordinate systems, transformations, and the DirectX Math library
•    Free and low-cost tools for authoring, debugging, and profiling shaders
•    Extensive treatment of HLSL shader authoring
•    Development of a C++ rendering engine
•    Cameras, 3D models, materials, and lighting
•    Post-processing effects
•    Device input, component-based architecture, and software services
•    Shadow mapping, depth maps, and projective texture mapping
•    Skeletal animation
•    Geometry and tessellation shaders
•    Survey of rendering optimization, global illumination, compute shaders, deferred shading, and data-driven engine architecture


Table of contents

  1. About This eBook
  2. Title Page
  3. Copyright Page
  4. Praise for Real-Time 3D Rendering with DirectX and HLSL
  5. Contents-at-a-Glance
  6. Contents
  7. Acknowledgments
  8. About the Author
  9. Introduction
    1. Intended Audience
    2. Why This Book?
    3. How This Book Is Organized
    4. Prerequisites
    5. Companion Website
    6. Conventions in This Book
  10. Part I: An Introduction to 3D Rendering
    1. Chapter 1. Introducing DirectX
      1. A Bit of History
      2. The Direct3D 11 Graphics Pipeline
      3. Summary
    2. Chapter 2. A 3D/Math Primer
      1. Vectors
      2. Matrices
      3. Transformations
      4. DirectXMath
      5. Summary
    3. Chapter 3. Tools of the Trade
      1. Microsoft Visual Studio
      2. NVIDIA FX Composer
      3. Visual Studio Graphics Debugger
      4. Graphics Debugging Alternatives
      5. Summary
      6. Exercises
  11. Part II: Shader Authoring with HLSL
    1. Chapter 4. Hello, Shaders!
      1. Your First Shader
      2. Hello, Structs!
      3. Summary
      4. Exercises
    2. Chapter 5. Texture Mapping
      1. An Introduction to Texture Mapping
      2. A Texture Mapping Effect
      3. Texture Filtering
      4. Texture Addressing Modes
      5. Summary
      6. Exercises
    3. Chapter 6. Lighting Models
      1. Ambient Lighting
      2. Diffuse Lighting
      3. Specular Highlights
      4. Summary
      5. Exercises
    4. Chapter 7. Additional Lighting Models
      1. Point Lights
      2. Spotlights
      3. Multiple Lights
      4. Summary
      5. Exercises
    5. Chapter 8. Gleaming the Cube
      1. Texture Cubes
      2. Skyboxes
      3. Environment Mapping
      4. Fog
      5. Color Blending
      6. Summary
      7. Exercises
    6. Chapter 9. Normal Mapping and Displacement Mapping
      1. Normal Mapping
      2. Displacement Mapping
      3. Summary
      4. Exercises
  12. Part III: Rendering with DirectX
    1. Chapter 10. Project Setup and Window Initialization
      1. A New Beginning
      2. Project Setup
      3. The Game Loop
      4. Window Initialization
      5. Summary
      6. Exercise
    2. Chapter 11. Direct3D Initialization
      1. Initializing Direct3D
      2. Putting It All Together
      3. Summary
      4. Exercise
    3. Chapter 12. Supporting Systems
      1. Game Components
      2. Device Input
      3. Software Services
      4. Summary
      5. Exercises
    4. Chapter 13. Cameras
      1. A Base Camera Component
      2. A First-Person Camera
      3. Summary
      4. Exercise
    5. Chapter 14. Hello, Rendering!
      1. Your First Full Rendering Application
      2. An Indexed Cube
      3. Summary
      4. Exercises
    6. Chapter 15. Models
      1. Motivation
      2. Model File Formats
      3. The Content Pipeline
      4. The Open Asset Import Library
      5. What’s in a Model?
      6. Meshes
      7. Model Materials
      8. Asset Loading
      9. A Model Rendering Demo
      10. Texture Mapping
      11. Summary
      12. Exercises
    7. Chapter 16. Materials
      1. Motivation
      2. The Effect Class
      3. The Technique Class
      4. The Pass Class
      5. The Variable Class
      6. The Material Class
      7. A Basic Effect Material
      8. A Skybox Material
      9. Summary
      10. Exercises
    8. Chapter 17. Lights
      1. Motivation
      2. Light Data Types
      3. A Diffuse Lighting Material
      4. A Diffuse Lighting Demo
      5. A Point Light Demo
      6. A Spotlight Demo
      7. Summary
      8. Exercises
  13. Part IV: Intermediate-Level Rendering Topics
    1. Chapter 18. Post-Processing
      1. Render Targets
      2. A Full-Screen Quad Component
      3. Color Filtering
      4. Gaussian Blurring
      5. Bloom
      6. Distortion Mapping
      7. Summary
      8. Exercises
    2. Chapter 19. Shadow Mapping
      1. Motivation
      2. Projective Texture Mapping
      3. Shadow Mapping
      4. Summary
      5. Exercises
    3. Chapter 20. Skeletal Animation
      1. Hierarchical Transformations
      2. Skinning
      3. Importing Animated Models
      4. Animation Rendering
      5. Summary
      6. Exercises
    4. Chapter 21. Geometry and Tessellation Shaders
      1. Motivation: Geometry Shaders
      2. Processing Primitives
      3. A Point Sprite Shader
      4. Primitive IDs
      5. Motivation: Tessellation Shaders
      6. The Hull Shader Stage
      7. The Tessellation Stage
      8. The Domain Shader Stage
      9. A Basic Tessellation Demo
      10. Displacing Tessellated Vertices
      11. Dynamic Levels of Detail
      12. Summary
      13. Exercises
    5. Chapter 22. Additional Topics in Modern Rendering
      1. Rendering Optimization
      2. Deferred Shading
      3. Global Illumination
      4. Compute Shaders
      5. Data-Driven Engine Architecture
      6. The End of the Beginning
      7. Exercises
  14. Index

Product information

  • Title: Real-Time 3D Rendering with DirectX® and HLSL: A Practical Guide to Graphics Programming
  • Author(s):
  • Release date: May 2014
  • Publisher(s): Addison-Wesley Professional
  • ISBN: 9780133570120