Dave Eberly is the president of Geometric Tools, Inc. (geometrictools.com), a company that specializes in software development for computer graphics, image analysis, and numerical methods. Previously, he was the director of engineering at Numerical Design Ltd. (NDL), the company responsible for the real-time 3D game engine, NetImmerse. He also worked for NDL on Gamebryo, which was the next-generation engine after NetImmerse. His background includes a BA degree in mathematics from Bloomsburg University, MS and PhD degrees in mathematics from the University of Colorado at Boulder, and MS and PhD degrees in computer science from the University of North Carolina at ChapelHill. He is the author of 3D Game Engine Design, 2nd Edition (2006), 3D Game Engine Architecture (2005), Game Physics (2004), and coauthor with Philip Schneider of Geometric Tools for Computer Graphics (2003), all published by Morgan Kaufmann. As a mathematician, Dave did research in the mathematics of combustion, signal and image processing, and length-biased distributions in statistics. He was an associate professor at the University of Texas at San Antonio with an adjunct appointment in radiology at the U.T. Health Science Center at San Antonio. In 1991, he gave up his tenured position to re-train in computer science at the University of North Carolina. After graduating in 1994, he remained for one year as a research associate professor in computer science with a joint appointment in the Department of Neurosurgery, working in medical image analysis. His next stop was the SAS Institute, working for a year on SAS/Insight, a statistical graphics package. Finally, deciding that computer graphics and geometry were his real calling, Dave went to work for NDL (which is now Emergent Game Technologies), then to Magic Software, Inc., which later became Geometric Tools, Inc. Dave's participation in the newsgroup comp.graphics.algorit
The first edition of 3D Game Engine Design was an international bestseller that sold over 17,000 copies and became an industry standard. In the six years since that book was published, graphics hardware has evolved enormously. Hardware can now be directly controlled through techniques such as shader programming, which requires an entirely new thought process of a programmer. In a way that no other book can do, this new edition shows step by step how to make a shader-based graphics engine and how to tame this new technology. Much new material has been added, including more than twice the coverage of the essential techniques of scene graph management, as well as new methods for managing memory usage in the new generation of game consoles and portable game players. There are expanded discussions of collision detection, collision avoidance, and physics-all challenging subjects for developers. The mathematics coverage is now focused towards the end of the book to separate it from the general discussion.As with the first edition, one of the most valuable features of this book is the inclusion of Wild Magic, a commercial quality game engine in source code that illustrates how to build a real-time rendering system from the lowest-level details all the way to a working game. Wild Magic Version 4 consists of over 300,000 lines of code that allows the results of programming experiments to be seen immediately. This new version of the engine is fully shader-based, runs on Windows XP, Mac OS X, and Linux, and is only available with the purchase of the book.
Preface1 Introduction2 The Graphics System2.1 The Foundation2.1.1 Coordinate Systems2.1.2 Handedness and Cross Products2.1.3 Points and Vectors2.2 Transformations2.2.1 Linear Transformations2.2.2 Affine Transformations2.2.3 Projective Transformations2.2.4 Properties of Perspective Projection2.2.5 Homogeneous Points and Matrices2.3 Cameras2.3.1 The Perspective Camera Model2.3.2 Model or Object Space2.3.3 World Space2.3.4 View, Camera, or Eye Space2.3.5 Clip, Projection, or Homogeneous Space2.3.6 Window Space2.3.7 Putting Them All Together2.4 Culling and Clipping2.4.1 Object Culling2.4.2 Back Face Culling2.4.3 Clipping to the View Frustum2.5 Rasterizing2.5.1 Line Segments2.5.2 Circles2.5.3 Ellipses2.5.4 Triangles2.6 Vertex Attributes2.6.1 Colors2.6.2 Lighting and Materials2.6.3 Textures2.6.4 Transparency and Opacity2.6.5 Fog2.6.6 And Many More2.6.7 Rasterizing Attributes2.7 Issues of Software, Hardware, and APIs2.7.1 A General Discussion2.7.2 Portability versus Performance2.8 API Conventions2.8.1 Matrix Representation and Storage2.8.2 Matrix Composition2.8.3 View Matrices2.8.4 Projection Matrices2.8.5 Window Handedness2.8.6 Rotations2.8.7 Fast Computations using the Graphics API3 Renderers3.1 Software Rendering3.2 Hardware Rendering3.3 The Fixed-Function Pipeline3.4 Vertex and Pixel Shaders3.5 An Abstract Rendering API4 Special Effects Using Shaders4.1 Vertex Colors4.2 Lighting and Materials4.3 Textures4.4 Multitextures4.5 Bump Maps4.6 Gloss Maps4.7 Sphere Maps4.8 Cube Maps4.9 Refraction4.10 Planar Reflection4.11 Planar Shadows4.12 Projected Textures4.13 Shadow Maps4.14 Volumetric Fog4.15 Skinning4.16 Miscellaneous4.16.1 Iridescence4.16.2 Water Effects4.16.3 Volumetric Textures5 Scene Graphs5.1 The Need for High-Level Data Management5.2 The Need for Low-Level Data Structures5.3 Geometric State5.3.1 Vertices and Vertex Attributes5.3.2 Transformations5.3.3 Bounding Volumes5.4 Render State5.4.1 Global State5.4.2 Lights5.4.3 Effects5.5 The Update Pass5.5.1 Geometric State Updates5.5.2 Render State Updates5.6 The Culling Pass5.6.1 Hierarchical Culling5.6.2 Sorted Culling5.7 The Drawing Pass5.7.1 Single-Pass Drawing5.7.2 Single Effect, Multipass Drawing5.7.3 Multiple Effect, Multipass Drawing5.7.4 Caching Data on the Graphics Hardware5.7.5 Sorting to Reduce State Changes5.8 Scene Graph Design Issues5.8.1 Organization Based on Geometric State5.8.2 Organization Based on Render State5.8.3 Scene Graph Operations and Threading5.8.4 The Producer-Consumer Model6 Scene Graph Compilers6.1 The Need for Platform-Specific Optimization6.2 The Need for Reducing Memory Fragmentation6.3 A Scene Graph as a Dynamic Expression6.4 Compilation from High-Level to Low-Level Data6.5 Control of Compilation via Node Tags7 Memory Management7.1 Memory Budgets for Game Consoles7.2 General Concepts for Memory Management7.2.1 Allocation, Deallocation, and Fragmentation7.2.2 Sequential-Fit Methods7.2.3 Buddy-System Methods7.2.4 Segregated-Storage Methods7.3 Design Choices7.3.1 Memory Utilization7.3.2 Fast Allocation and Deallocation8 Controller-Based Animation8.1 Vertex Morphing8.2 Keyframe Animation8.3 Inverse Kinematics8.4 Skin and Bones8.5 Particle Systems9 Spatial Sorting9.1 Spatial Partitioning9.1.1 Quadtrees and Octrees9.1.2 BSP Trees9.1.3 User-Defined Maps9.2 Node-Based Sorting9.3 Portals9.4 Occlusion Culling10 Level of Detail10.1 Discrete Level of Detail10.1.1 Sprites and Billboards10.1.2 Model Switching10.2 Continuous Level of Detail10.2.1 General Concepts10.2.2 Application to Regular Meshes10.2.3 Application to General Meshes10.3 Infinite Level of Detail10.3.1 General Concepts10.3.2 Application to Parametric Curves10.3.3 Application to Parametric Surfaces11 Terrain11.1 Data Representations11.2 Level of Detail for Height Fields11.3 Terrain Pages and Memory Management12 Collision Detection12.1 Static Line-Object Intersections12.2 Static Object-Object Intersections12.3 Dynamic Line-Object Intersections12.3.1 Distance-Based Approach12.3.2 Intersection-Based Ap