Home                  

Old News       

Book Info

Book II Info

Resources

Book Store

Forum

Links

Introduction to 3D Game Programming with DirectX 9.0


This page contains some general information about the book Introduction to 3D Game Programming with DirectX® 9.0, published by Wordware Publishing Inc, that will help you decide if this book if for you.  

Download Errata Here

Book Sample Code

 

Intended Audience

This book was designed with the following three audiences in mind.

1. Intermediate level C++ programmers who would like an introduction to 3D programming using the latest iteration of Direct3D – Direct3D 9.0.

2. Experienced 3D programmers, but with an API other than DirectX (e.g. OpenGL), who would like an introduction to Direct3D 9.0.

3. Experienced Direct3D programmers who would like an up to date book covering the latest version of Direct3D, including Vertex and Pixel shaders, the High Level Shading Language, and the Effects Framework.

Prerequisites

This book is designed to be an introductory level textbook, however, that does not imply that it is easy or for people with no programming experience.  Readers are expected to be comfortable with algebra, trigonometry, their development environment (e.g. Visual Studio), C++, and fundamental data structures such as arrays and lists.  Being familiar with Windows programming is also helpful but not imperative; refer to Appendix A for an introduction of Windows programming.

Table of Contents

Introduction

Part I Mathematical Prerequisites

            Vectors in 3-Space
           
Matrices
           
Basic Transformations
           
Planes (Optional)
           
Rays (Optional)
           
Summary 

Part II Direct3D Fundamentals

Chapter 1 Direct3D Initialization
            1.1 Direct3D Overview
           
1.2 COM
           
1.3 Some Preliminaries
           
1.4 Initializing Direct3D
           
1.5 Sample Application: Initializing Direct3D
           
1.6 Summary 

Chapter 2 The Rendering Pipeline
           
2.1 Model Representation
           
2.2 The Virtual Camera
           
2.3 The Rendering Pipeline
           
2.4 Summary 

Chapter 3 Drawing in Direct3D
            3.1 Vertex/Index Buffers
           
3.2 Render States
           
3.3 Drawing Preparations
           
3.4 Drawing with Vertex/Index Buffers
           
3.5 D3DX Geometric Objects
           
3.6 Sample Applications: Triangle, Cube, Teapot, D3DXCreate*
           
3.7 Summary 

Chapter 4 Color 
           
4.1 Color Representation
           
4.2 Vertex Colors
           
4.3 Shading
           
4.4 Sample Application: Colored Triangle
           
4.5 Summary 

Chapter 5 Lighting
           
5.1 Light Components
           
5.2 Materials
           
5.3 Vertex Normals
           
5.4 Light Sources
           
5.5 Sample Application: Lighting
           
5.6 Additional Samples
           
5.7 Summary 

Chapter 6 Texturing
           
6.1 Texture Coordinates
           
6.2 Creating and Enabling a Texture
           
6.3 Filters
           
6.4 Mipmaps
           
6.5 Address Modes
           
6.6 Sample Application: Textured Quad
           
6.7 Summary 

Chapter 7 Blending
           
7.1 The Blending Equation
           
7.2 Blend Factors
           
7.3 Transparency
           
7.4 Creating an Alpha Channel Using the DX Tex Tool
           
7.5 Sample Application: Transparency
           
7.6 Summary 

Chapter 8 Stenciling
           
8.1 Using the Stencil Buffer
           
8.2 Sample Application: Mirrors
           
8.3 Sample Application: Planar Shadows
           
8.4 Summary 

Part III Applied Direct3D 

Chapter 9 Fonts
           
9.1 ID3DXFont
           
9.2 CD3DFont
           
9.3 D3DXCreateText
           
9.4 Summary 

Chapter 10 Meshes Part I
           
10.1 Geometry Info
           
10.2 Subsets and the Attribute Buffer
           
10.3 Drawing
           
10.4 Optimizing
           
10.5 The Attribute Table
           
10.6 Adjacency Info
           
10.7 Cloning
           
10.8 Creating a Mesh (D3DXCreateMeshFVF)
           
10.9 Sample Application: Creating and Rendering a Mesh
           
10.10 Summary 

Chapter 11 Meshes Part II
           
11.1 ID3DXBuffer
           
11.2 XFiles 
           
11.3 Progressive Meshes
           
11.4 Bounding Volumes
           
11.5 Summary 

Chapter 12 Building a Flexible Camera Class
           
12.1 Camera Design
           
12.2 Implementation Details 
           
12.3 Camera Sample
           
12.4 Summary 

Chapter 13 Basic Terrain Rendering
           
13.1 Heightmaps
           
13.2 Generating the Terrain Geometry
           
13.3 Texturing
           
13.4 Lighting
           
13.5 “Walking” on the Terrain
           
13.6 Terrain Sample
           
13.7 Some Improvements
           
13.8 Summary 

Chapter 14 Particle Systems
           
14.1 Particles and Point Sprites
           
14.2 Particle System Components
           
14.3 Concrete Particle Systems: Snow, Firework, Particle Gun
           
14.4 Summary

Chapter 15 Picking
           
15.1 Screen to Projection Window Transformation
           
15.2 Computing the Picking Ray
           
15.3 Transforming Rays
           
15.4 Ray-Object Intersections
           
15.5 Picking Sample
           
15.6 Summary 

Part IV Shaders and Effects 

Chapter 16 Introduction to the High Level Shading Language
           
16.1 Writing a HLSL Shader
           
16.2 Compiling a HLSL Shader
           
16.3 Variable Types
           
16.4 Keywords, Statements, and Casting
           
16.5 Operators
           
16.6 User Defined Functions
           
16.7 Built in Functions
           
16.8 Summary 

Chapter 17 Introduction to Vertex Shaders
           
17.1 Vertex Declarations
           
17.2 Vertex Data Usages
           
17.3 Steps to Using a Vertex Shader
           
17.4 Sample 1: Diffuse Lighting
           
17.5 Sample 2: Cartoon Rendering
           
17.6 Summary 

Chapter 18 Introduction to Pixel Shaders
           
18.1 Multitexturing Overview
           
18.2 Pixel Shader Inputs and Outputs
           
18.3 Steps to Using a Pixel Shader
           
18.4 HLSL Sampler Objects
           
18.5 Sample Application: Multitexturing in a Pixel Shader
           
18.6 Summary 

Chapter 19 The Effects Framework
           
19.1 Techniques and Passes
           
19.2 More HLSL Intrinsic Objects
           
19.3 Device States in an Effect File
           
19.4 Creating an Effect
           
19.5 Setting Constants
           
19.6 Using an Effect
           
19.7 Sample 1: Lighting and Texturing in an Effect
           
19.8 Sample 2: Fog Effect
           
19.9 Sample 3: Cartoon Effect
           
19.10 EffectEdit
           
19.11 Summary 

Appendices

Appendix A An Introduction To Windows Programming
           
A.1 Overview
           
A.2 Hello World Windows Application
           
A.3 Explaining Hello World
           
A.4 A Better Message Loop
           
A.5 Summary

Chapter Descriptions

Mathematical PrerequisitesIn this prerequisite part we introduce the mathematical tools that will be used throughout this book.  The core of this chapter is the discussions on vectors, matrices, and transformations, which are used in just about every sample program of this book.  In addition to the math explanations, we show the D3DX math related classes used to model these mathematical objects and the functions used to execute a particular operation. 

Chapter 1 Direct3D Initialization: In this chapter we learn what Direct3D is about and how to initialize it in preparation for 3D drawing. 

Chapter 2 The Rendering Pipeline: The first theme of this chapter is to learn, mathematically, how to describe a 3D world and how to represent a virtual camera that describes the perspective from which the world is viewed.  The second theme of this chapter is to learn the steps necessary to take a 2D “picture” of the 3D world based on what the camera “sees”, these steps as a whole are referred to as the rendering pipeline.

Chapter 3 Drawing in Direct3D: This chapter shows how to draw 3D geometry in Direct3D.  We will learn how to store geometric data in a form that is usable by Direct3D and we will learn the Direct3D drawing commands.  In addition, we will learn how to configure the way Direct3D draws geometry using render states.

Chapter 4 Color: In this chapter, we learn how color is represented in Direct3D and how to apply color to solid 3D geometric primitives.  Finally, we describe two ways colors specified per vertex can be shaded across a primitive.

Chapter 5 Lighting: In this chapter, we learn how to create light sources and how to define the interaction between light and surfaces.  Lighting adds to the scene’s realism and helps depict the solid form and volume of objects. 

Chapter 6 Texturing: This chapter describes texture mapping.  Texture mapping is a technique used to increase the realism of the scene by mapping 2D image data onto a 3D primitive.  For example, using texture mapping we can model a brick wall by applying a 2D brick wall image onto a 3D rectangle.

Chapter 7 Blending: In this chapter we look at a technique called blending.  This technique allows us to implement a number of special effects, in particular, glass like transparency.

Chapter 8 Stenciling: This chapter describes the stencil buffer, which like a stencil, allows us to block pixels from being drawn.  To illustrate the ideas of this chapter we include thorough discussions on implementing reflections and planar shadows using the stencil buffer.

Chapter 9 Fonts: During a game we will often need to display textual information to the user.  This chapter discusses three ways we can generate and output text in Direct3D.

Chapter 10 Meshes Part I: This chapter thoroughly explains the data and methods of the D3DX mesh interface ID3DXMesh. 

Chapter 11 Meshes Part II: In this chapter we continue our study of the D3DX mesh related interfaces and functions.  We learn about .X files and how to load and render them.  In addition, we will examine the progressive mesh interface ID3DXPMesh.  Finally, the chapter concludes by showing how to compute the bounding box and bounding sphere of a mesh.

Chapter 12 Building a Flexible Camera Class: In this chapter we design and implement a flexible camera class that has six degrees of freedom.  This camera is suited for flight simulators and first person shooters.

Chapter 13 Basic Terrain Rendering: This chapter shows how to create, texture, light and render 3D terrains.  Furthermore, we show how to smoothly “walk” the camera over the terrain so that it looks like we are walking on the terrain.

Chapter 14 Particle Systems: In this chapter, we will learn how to model systems that consist of many small particles that all behave in a similar manner.  For example, particle systems can be used to model falling snow and rain, the sparks of an explosion, puffs of smoke, rocket trails, and even the bullets of a gun.

Chapter 15 Picking: This chapter shows how to determine the particular 3D object the user has selected with the mouse.  Picking is often a necessity in 3D games and applications were the user interacts with the 3D world with the mouse.

Chapter 16 Introduction to the High Level Shading Language: In this chapter we explore the High Level Shading Language (HLSL), which is the language we will use to write vertex and pixel shader programs in this book.

Chapter 17 Introduction to Vertex Shaders: This chapter explains what vertex shaders are, and how to create and use them in Direct3D.  The chapter illustrates vertex shaders by explaining the implementation to a cartoon styled shading technique.

Chapter 18 Introduction to Pixel Shaders: This chapter explains what pixel shaders are, and how to create and use them in Direct3D.  The chapter concludes by showing how to implement multitexturing using a pixel shader.

Chapter 19 The Effects Framework: In this chapter we discuss the Direct3D Effects Framework.  The chapter describes the purpose of the effects framework, the structure and syntax of effect files, how to create effect files, and how to use effect files in Direct3D applications.

Appendix A An Introduction To Windows Programming: This appendix serves as an introduction to programming Windows with the native Win32 API.  In particular, it explains the minimal amount of Windows code necessary to create Direct3D applications.

 




Email suggestions, comments or errors about this site to
Copyright © 2002-2004 Moon Labs Corp. All Rights Reserved.