I’ve been writing this book off and on for a number of years. I started with version 8.0 of Direct3D, the first version to introduce shaders. I don’t write books for a living. This is the first book I have ever attempted to write. I work on it in my “copious spare time”, as they say. My intention was never to make money, but to help other people.
To that end, I have made the current draft available for free as PDF chapters that you can download. Chapters 1-9 reflect the Direct3D 9.0 API. Chapters 10-24 reflect the Direct3D 8.1 API. What you have here is approximately 500 pages of printed material, resulting in quite a thick book. Silly me, I picked a gigantic scope for my first book. I wrote the book that I wished I had when I started learning Direct3D. I hope it helps you.
|
|
Front Matter & Table of Contents |
|
|
|
Part I: Preliminaries |
|
1. Introduction |
|
1.1 Overview 1.2 Display Technology 1.3 Gamma Correction 1.4 Color 1.5 Basic Mathematics 1.6 Homogeneous Coordinates 1.7 Vectors 1.8 Coordinate Systems |
1.9 Matrices 1.10 Aliasing 1.11 Style Conventions 1.12 COM Objects 1.13 Code Techniques 1.14 Previous Versions of Direct3D 1.15 Further Reading |
2. Direct3D |
|
2.1 Overview 2.2 A Minimal Direct3D Application 2.3 Direct3D Architecture 2.4 Direct3D HRESULTs 2.5 Windowed and Exclusive Mode 2.6 Device Types 2.7 Resources 2.8 IDirect3D9 |
2.9 Selecting a Device 2.10 Determining Available Resource Memory 2.11 Device Capabilities 2.12 Identifying a Particular Device 2.13 Creating the Device 2.14 Multiple Monitors 2.15 Adapter Group Devices |
3. Direct3D Devices |
|
3.1 Overview 3.2 IDirect3DDevice9 3.3 Capabilities 3.4 Resources 3.5 IDirect3DResource9 3.6 Destroying a Device |
3.7 Miscellaneous Properties 3.8 Device Queries 3.9 Device States 3.10 Device State Blocks 3.11 Pure Devices |
4. 2D Applications |
|
4.1 Overview 4.2 Pixel Surfaces 4.3 Accessing Surface Pixel Data 4.4 Using GDI On A Surface 4.5 Swap Chains 4.6 Presentation |
4.7 Lost Devices and Reset 4.8 Video Scan Out 4.9 2D Pixel Copies 4.10 Filling Rectangles 4.11 Window Messages 4.12 rt_2DApp Sample Application |
|
|
Part II: Geometry Processing |
|
5. Modeling |
|
5.1 Overview 5.2 Modeling Scenes 5.3 Visibility 5.4 Render Targets 5.5 Primitive Types 5.6 Vertex Data 5.7 Flexible Vertex Formats 5.8 Vertex Declarations 5.9 Vertex Buffers |
5.10 Indexed Primitives 5.11 The Vertex Shader 5.12 Drawing Primitives 5.13 Vertex Data Streams 5.14 Capabilities for Vertex Assembly 5.15 Enhanced Primitives 5.16 Higher Order Surfaces 5.17 Object Approximations 5.18 Further Reading |
6. Vertex Transformations |
|
6.1 Overview 6.2 Vertex Processing 6.3 Transformation Matrices 6.4 Order of Transformations 6.5 World Transformation 6.6 Transformation Hierarchy 6.7 Vertex Blending |
6.8 Vertex Fog 6.9 Face Culling 6.10 Clipping 6.11 Screen Space and the Viewport 6.12 rt_VertexBlend Sample Application 6.13 Further Reading |
7. Viewing and Projection |
|
7.1 Overview 7.2 Viewing Through a Virtual Camera 7.3 Planar Geometric Projections |
7.4 Projection Transformation 7.5 Further Reading 7.6 rt_Views Sample Application |
8. Lighting and Materials |
|
8.1 Overview 8.2 Transformed Vertices 8.3 Lighting Calculations 8.4 Surface Material Properties |
8.5 Light Sources 8.6 The Illumination Model 8.7 rt_Lighting Sample Application |
9. Vertex Shaders |
|
9.1 Overview 9.2 Vertex Shader Architecture 9.3 Vertex Shader 1.1 Architecture 9.4 Vertex Shader 2.0 Architecture 9.5 Vertex Shader 2.x Architecture 9.6 Vertex Shader 3.0 Architecture 9.7 Shader Instruction Syntax 9.8 Execution Model 9.9 Software Vertex Processing 9.10 Vertex Shader 1.1 Instructions 9.11 Vertex Shader 2.0 Instructions |
9.12 Vertex Shader 2.x Instructions 9.13 Vertex Shader 3.0 Instructions 9.14 Manipulating Shaders 9.15 Drawing Multiple Instances 9.16 Shader Design 9.17 Common Computations 9.18 Fixed-Function Processing 9.19 Beyond Fixed-Function Processing 9.20 rt_VertexShader Sample Application 9.21 Vertex Shader SDK Samples |
|
|
Part III: Pixel Processing |
|
10. Rasterization and Shading |
|
10.1 Overview 10.2 Shading and Filling 10.3 Scanline Rendering |
10.4 Source Pixel Generation 10.5 Source Pixel Data 10.6 rt_Rasterize Sample Application |
11. Basic Texturing |
|
11.1 Overview 11.2 Direct3D Multitexture Architecture 11.3 Texture Resources 11.4 Texture Formats 11.5 Texture Coordinate Processing 11.6 Texture Sampling |
11.7 Texture Stage Processing 11.8 Examples 11.9 Specular Addition 11.10 Textured Primitives 11.11 Further Reading 11.12 Sample Applications |
12. Advanced Texturing (not available) |
|
12.1 Overview 12.2 Multiple Texture Stages 12.3 Environment Mapping |
12.4 Bump Mapping Techniques 12.5 Texturing Sample Applications |
13. Pixel Shaders |
|
13.1 Overview 13.2 Pixel Shader Architecture 13.3 Pixel Shader Architecture Versions 13.4 Instruction Set 13.5 PS 2.0 Instructions 13.6 PS 2.x Instructions |
13.7 PS 3.0 Instructions 13.8 Manipulating Pixel Shaders 13.9 Texture Stage States 13.10 Examples 13.11 Debugging a Pixel Shader |
14. The Frame Buffer |
|
14.1 Overview 14.2 Fog Blending 14.3 Alpha Test 14.4 The Z Buffer and Visibility 14.5 Stencil Test |
14.6 Alpha Blending 14.7 Dithering 14.8 Multisampling 14.9 Writing to the Render Target 14.10 rt_FrameBuffer Sample Application |
|
|
Part IV: The D3DX Library |
|
15. The D3DX Utility Library |
|
15.1 Overview 15.2 Headers and Libraries 15.3 Data Types 15.4 Helper Objects 15.5 Meshes 15.6 Resources 15.7 Resource Image Information 15.8 Resource Requirements 15.9 Format Conversion 15.10 Creating Texture Resources 15.11 Loading Resources |
15.12 Saving Resources 15.13 Filling Textures 15.14 Filtering Textures 15.15 Creating Normal Maps 15.16 Miscellaneous 15.17 Error Handling 15.18 ID3DXBuffer 15.19 Vertex Declarations 15.20 Intersection Testing 15.21 Shader Assembly 15.22 Further Reading |
16. D3DX Concrete Types |
|
16.1 Overview 16.2 Colors 16.3 Vectors |
16.4 Matrices 16.5 Planes 16.6 Quaternions |
17. D3DX Helper Objects |
|
17.1 Overview 17.2 Matrix Stacks 17.3 Fonts |
17.4 Sprites 17.5 Surface Rendering 17.6 Environment Map Rendering |
18. High Level Shaders and Effects (not available) |
|
18.1 Overview 18.2 Visual Effects |
18.3 Sample Applications |
19. D3DX Mesh Objects |
|
19.1 Overview 19.2 Use of const Qualifiers 19.3 Triangle Adjacencies 19.4 Vertex and Triangle Remapping 19.5 Base Mesh 19.6 Mesh |
19.7 Progressive Mesh 19.8 Simplification Mesh 19.9 Skin Mesh 19.10 rt_D3DXSphere Sample Application 19.11 SDK Samples 19.12 Further Reading |
20. D3DX Animation Objects (not available) |
|
20.1 Overview | |
|
|
Part V: The Application |
|
21. X Files |
|
21.1 Overview 21.1 X File Structure 21.3 Text Encoding 21.4 Binary Encoding 21.5 Predefined Templates 21.6 Headers, Libraries and Interfaces 21.7 IDirectXFile 21.8 IDirectXFileEnumObject 21.9 IDirectXFileObject |
21.10 IDirectXFileData 21.11 IDirectXFileBinary 21.12 IDirectXFileDataReference 21.13 IDirectXFileSaveObject 21.14 Reading Scene Data 21.15 Writing Scene Data 21.16 Exporting and Conversion 21.17 Example X Files 21.18 rt_MakeScene Sample Program |
22. Debugging |
|
22.1 Overview 22.2 Version Control Systems 22.3 C++ Debugging 22.4 Debugging Windows Applications 22.5 Debugging With Visual C++ 6 |
22.6 Debugging With Direct3D 22.7 DirectX Diagnostic Tool 22.8 DirectX Control Panel Applet 22.9 Getting Help 22.10 Filing Bug Reports |
23. Performance (not available) |
|
23.1 Overview 23.2 Pipeline Bottlenecks 23.3 Optimization Techniques 23.4 Strategies 23.5 Image Compositing 23.6 Vertex Buffers 23.7 Texture Map Size |
23.8 Scalable Shading 23.9 Model Simplification 23.10 Alpha Test 23.11 Stencil Test 23.12 Z Buffer Test 23.13 Guard Band Clip |
24. Installation and Setup |
|
24.1 Overview 24.2 Determining the DirectX Version 24.3 DirectSetup 24.4 Windows Installer |
24.5 Logo Requirements 24.6 AutoRun Enabled Installations 24.7 Testing Installation Programs 24.8 Sample Program |
|
24-August-2009 at 3:28 pm
I’ve been reading the first couple of chapters. I like the format you are using, it looks like it’s ready to print. Did you write this in Word or is there some professional book-writing software?
LikeLike
24-August-2009 at 3:44 pm
The entire book is written in LaTeX, using the MiKTeX distribution which you can download for free.
I chose LaTeX because I knew I was going to have lots of formulas in the text and TeX/LaTeX excels at typsetting formulas. I also knew I wanted a format for the book that was a text source file for diffing, grepping and using a code editor like Visual Studio for modifying.
Word uses a binary format. Word is terrible at formulas, even though its much better now than it used to be. Word is not text editor/diff friendly.
LikeLike
24-September-2009 at 3:54 am
it’s awesome buddy thanks for this material.
LikeLike
12-January-2010 at 11:04 am
Really enjoying reading this. Any news on the availability of chapter 12?
LikeLike
11-June-2010 at 12:18 pm
I really like this book.
LikeLike
17-June-2010 at 11:31 am
I like this… is there a full document with all the chapters? Even better if it was in some iBook format… Converting from PDF is a drag!
LikeLike
17-June-2010 at 11:43 am
Sorry, just indiividual chapters as PDF for now.
LikeLike
20-June-2010 at 9:49 pm
Great job!
I really like it!
And I really want to know when release chapter 12 & 23?
It’s important to me.
LikeLike
21-June-2010 at 10:35 pm
I feel that advanced texturing and performance are better addressed by other books than the single chapter I had planned in my initial book outline.
Advanced texturing is now the topic of not just one book, but whole series of books, such as GPU Gems 3 and ShaderX7: Advanced Rendering Techniques, to name just two.
Specific performance suggestions are ephemeral by their very nature. General guidelines and algorithms can be found in Real-Time Rendering, Third Edition along with an extensive bibliography into the existing literature. The authors have really done an excellent job in keeping up with the state-of-the-art in real-time rendering; much better than I could do in a single chapter.
Performance guidelines specific to Direct3D can be found in Microsoft’s GameFest presentations.
LikeLike
3-November-2010 at 4:07 pm
Thanks for sharing your book! It has some pretty good information in a very easy to understand format that complements the SDK documentation.
LikeLike
5-October-2011 at 10:20 am
Started reading the book.
What an awesome book. Written in so simple language.
Please release chapter 23 ASAP…
Thanks for all your effort
LikeLike
1-November-2011 at 5:14 pm
I’m afraid what you see is what you get and I’m unlikely to ever write more chapters for this book.
LikeLike
2-September-2012 at 9:31 am
Your book seems to no longer be available? It looks perfect for what I’m trying to do. Is there somewhere else it is available?
LikeLike
2-September-2012 at 8:11 pm
The hosting site had a temporary outage; it should be available now.
LikeLike
18-November-2012 at 11:49 am
[…] material: Direct 3D Gfx pipeline from the “Legalize Adulthood” […]
LikeLike
10-March-2014 at 5:30 pm
[…] “The Direct3D Graphics Pipeline” […]
LikeLike