Advanced 3D Game Programming with DirectX 10.0

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Advanced 3D Game Programming With Directx 10.0 Provides A Guide To Developing Cutting-Edge Games Using Directx 10.0. Beginning With The Foundations Of 3D Math And The Components Of Directx, Programmers New To Graphics And Game Programming Will Learn How To Implement Networking, Collision Detection, And Multithreading. Full Source Code Is Provided For The Examples And For The Client/Server Networked 3D First-Person Game That Brings Together Many Of The Techniques Discussed In The Book. Learn How To Acquire Input From The User Through The Keyboard And Mouse; Simulate Intelligence Using Steering Algorithms And Motivation Engines; Render Using HLSL Shaders; Use Advanced 3D Techniques Such As Forward And Inverse Kinematics, Subdivision Surfaces, And Radiosity Lighting; Manage Scenes Via Portal Rendering.

Author(s): Peter Walsh
Publisher: Wordware Publishing
Year: 2008

Language: English
Pages: 529

Contents
Acknowledgments
Introduction
Chapter 1 Windows
A Word about Windows
Notation Hungarian
General Windows Concepts
Message Handling in Windows
Processing Messages
World—Windows Style Hello
Explaining the Code
Registering the Application
Initializing the Window
WndProc—The Message Pump
Window Geometry Manipulating
Important Window Messages
Class Encapsulation
The Component Object Model COM:
Conclusion
Chapter 2 Getting Started with DirectX 10
What Is DirectX?
Installation
Setting Up VC++
What Happened to DirectDraw?
Direct3D
2D Graphics 101
Textures
Complex Textures
Describing Textures
The ID3D10Texture2D Interface
Texture Operations
Modifying the Contents of Textures
Creating Textures
Implementing Direct3D with cGraphicsLayer
Creating the Graphics Layer
Initializing Direct3D
Step 1: Creating a Device and Swap Chain
Step 2: Creating a Render Target View
Step 3: Putting It All Together
Shutting Down Direct3D
Application: Direct3D Sample Sample
Conclusion
Chapter 3 Input and Sound
DirectInput
Devices
Receiving Device States
Cooperative Levels
Application Focus and Devices
The DirectInput Object
Implementing DirectInput with cInputLayer
Additions to cApplication
Sound
The Essentials of Sound
DirectSound Concepts
DirectSound Buffers
Operations on Sound Buffers
WAV Files Loading
Implementing DirectSound with cSoundLayer
Creating the DirectSound Object
Setting the Cooperative Level
Grabbing the Primary Buffer
The cSound Class
Additions to cApplication
Application: DirectSound Sample
Conclusion
Chapter 4 3D Math Foundations
Points
The point3 Structure
Basic point3 Functions
Assign
Mag and MagSquared
Normalize
Dist
point3 Operators
Addition/Subtraction
Vector-Scalar Multiplication/Division
Vector Equality
Dot Product
Cross Product
Polygons
Triangles
Strips and Fans
Planes
Defining Locality with Relation to a Plane
Back-face Culling
Clipping Lines
Clipping Polygons
Object Representations
Transformations
Matrices
The matrix4 Structure
Translation
Basic Rotations
Axis-Angle Rotation
The LookAt Matrix
Perspective Projection Matrix
Inverse of a Matrix
Collision Detection with Bounding Spheres
Lighting
Representing Color
Lighting Models
Specular Reflection
Light Types
Parallel Lights (or Directional Lights)
Point Lights
Spotlights
Shading Models
Lambert
Gouraud
Phong
BSP Trees
BSP Tree Theory
BSP Tree Construction
BSP Tree Algorithms
Sorted Polygon Ordering
Testing Locality of a Point
Testing Line Segments
BSP Tree Code
Wrapping It Up
Chapter 5 Artificial Intelligence
Starting Point
Locomotion
Steering—Basic Algorithms
Chasing
Evading
Pattern-based AI
Steering—Algorithms Advanced
Potential Functions
The Good
The Bad
Application: potentialFunc
Path Following
Groundwork
Graph Theory
Using Graphs to Find Shortest Paths
Application: Path Planner
Motivation
Nondeterministic Finite Automata (NFAs)
Genetic Algorithms
Rule-Based AI
Neural Networks
A Basic Neuron
Simple Neural Networks
Training Neural Networks
Using Neural Networks in Games
Application: NeuralNet
the System Extending
Chapter 6 Multiplayer Internet Networking with UDP
Terminology
Endianness
Network Models
Protocols
Packets
1: MTUDP Implementation
Design Considerations
Things to Watch Out For
Mutexes
Threads, Monitor, and the Problem of the try/throw/catch Construction
MTUDP: The Early Years
MTUDP::Startup() and MTUDP::Cleanup()
MTUDP::MTUDP() and MTUDP::~MTUDP()
MTUDP::StartListening()
MTUDP::StartSending()
MTUDP::ThreadProc()
MTUDP::ProcessIncomingData()
MTUDP::GetReliableData()
Reliable Communications
cDataPacket
cQueueIn
cHost
MTUDP::ReliableSendTo()
cUnreliableQueueIn
cHost::AddACKMessage()/cHost::ProcessIncomingACKs()
cNetClock
Implementation 2: Smooth Network Play
Geographic and Temporal Independence
Timing Is Everything
Pick and Choose
Prediction and Extrapolation
Conclusion
Chapter 7 Direct3D Fundamentals
Introduction to D3D
Getting Started with Direct3D
Step 1: Creating the ID3D10Device and Swap Chain
Step 2: Creating a Depth/Stencil Buffer
Bringing It All Together
Step 3: Creating a Viewport
Step 4: Creating a Default Shader
Introduction to Shaders
Your First HLSL Shader
The Vertex Shader
The Pixel Shader
The Technique
Setting Up the Shader in Code
More about Depth Buffers
Stencil Buffers
Vertex Buffers
with Shaders Lighting
D3D View Application:
The .o3d Format
The cModel Class
Chapter 8 Advanced 3D Techniques
Animation Using Hierarchical Objects
Forward Kinematics
Inverse Kinematics
Application: InvKim
Parametric Curves and Surfaces
Bezier Curves and Surfaces
Bezier Concepts
The Math
Finding the Basis Matrix
Calculating Bezier Curves
Forward Differencing
The cFwdDiffIterator Class
Drawing Curves
Drawing Surfaces
Application: Teapot
B-Spline Curves
Application: BSpline
Subdivision Surfaces
Subdivision Essentials
Triangles vs. Quads
Interpolating vs. Approximating
Uniform vs. Non-Uniform
Stationary vs. Non-Stationary
Modified Butterfly Method Subdivision Scheme
Application: SubDiv
Progressive Meshes
Progressive Mesh Basics
Choosing Our Edges
An Edge Selection Algorithm
Quadric Error Metrics
Implementing a Progressive Mesh Renderer
Radiosity
Radiosity Foundations
Progressive Radiosity
The Form Factor
Application: Radiosity
Conclusion
Chapter 9 Advanced Direct3D
Alpha Blending
The Alpha Blending Equation
A Note on Depth Ordering
Enabling Alpha Blending
Using Alpha Blending from C++
Using Alpha Blending from Shaders
Mapping 101 Texture
Fundamentals
Affine vs. Perspective Mapping
Texture Addressing
Wrap
Mirror and Mirror Once
Clamp
Border Color
Texture Wrapping
Texture Aliasing
MIP Maps
Filtering
Point Sampling
Anisotropic Filtering
Textures in Direct3D
Texture Loading
DDS Format
The cTexture Class
Activating Textures
Creating a Shader View
Adding Textures to the Shader
Sending the Texture to the Shader
Texture Sampling
Texture Mapping 202
Texture Arrays
Effects Using Multiple Textures
Light Maps (a.k.a. Dark Maps)
Environment Maps
Spherical Environment Maps
Cubic Environment Maps
Specular Maps
Detail Maps
Application: Detail
Glow Maps
Gloss Maps
Other Effects
Application: MultiTex
Using the Stencil Buffer
Overdraw Counter
Dissolves and Wipes
Conclusion
Chapter 10 Scene Management
The Scene Management Problem and Solutions
Quadtrees/Octrees
Portal Rendering
Portal Rendering Concepts
Exact Portal Rendering
Approximative Portal Rendering
Portal Effects
Mirrors
Translocators and Non-Euclidean Movement
Portal Generation
Precalculated Portal Rendering (with PVS)
Advantages/Disadvantages
Implementation Details
Application: Mobots Attack!
Interobject Communication
Network Communication
Code Structure
Closing Thoughts
AppendixAn STL Primer
Index