CHAPTER 1 INTRODUCTION
CHAPTER 2 THE GRAPHICS SYSTEM
CHAPTER 3 RENDERERS
CHAPTER 4 SCNE GRAPHS
CHAPTER 5 CONTROLLER-BASED ANIMATION
CHAPTER 6 SPATAL SORTING
CHAPTER 7 LEVEL OF DETAIL
CHAPTER 8 COLLISION DETECTION
CHAPTER 9 PHYSICS
CHAPTER 10 STANDARD OBJECTS
CHAPTER 11 CURVES
CHAPTER 12 SURFACES
CHAPTER 13 CONTAINMENT METHODS
CHAPTER 14 DISTANCE METHODS
CHAPTER 15 INTERSECTION METHODS
CHAPTER 16 NUMERICAL METHODS
CHAPTER 17 ROTATIONS
CHAPTER 18 OBJECT-ORIENTED INFRASTRUCTURE
CHAPTER 19 MEMORY MANAGEMENT
CHAPTER 20 SPECIAL EFFECTS USING SHADERS
.APPENDIX CREATIONG A SHADER IN WILD MAGIC
The first edition of 3D Game Engine Design appeared in print over six yearsago (September 2000). At that time, shader programming did not exist onconsumer graphics hardware. All rendering was performed using the fixed-functionpipeline, which consisted of setting render states in order to control how the geometricdata was affected by the drawing pass. .
The first edition contained a CDROM with the source code for Wild Magic Version0.1, which included 1,015 source files and 17 sample applications, for a totalof 101,293 lines of code. The distribution contained support only for computersrunning the Microsoft Windows operating system; the renderer was built on top ofOpenGL; and project files were provided for Micrsoft Visual C++ 6. Over the years,the source code evolved to Wild Magic Version 3.9, which contained additional supportfor Linux and Macintosh platforms, had OpenGL and Direct3D renderers, andincluded some support for shader programming. However, the design of the enginewas still based on a fixed-function pipeline. The distribution also included supportfor multiple versions of Microsoft’s compilers, support for other compilers on thevarious platforms, and contained some tools such as importers and exporters for processingof art assets.
This is the second edition of 3D Game Engine Design. It is much enhanced, describingthe foundations for shader programming and how an engine can support it.The second edition is about twice the size of the first. The majority of the increase isdue to a more detailed description of all aspects of the graphics system, particularlyabout how shaders fit into the geometric pipeline. The material on scene graphs andtheir management is also greatly expanded. The second edition has more figures andless emphasis on the mathematical aspects of an engine.
The second edition contains a CDROM with the source code for Wild MagicVersion 4.0, which includes 1,587 source files and 105 sample applications, for atotal of 249,860 lines of code. The Windows, Linux, and Macintosh platforms arestill supported, using OpenGL renderers. TheWindows platform also has a Direct3Drenderer whose performance is comparable to that of the OpenGL renderer.Multipleversions of Microsoft’s C++ compilers are supported—versions 6, 7.0, 7.1, and 8.0(Professional and Express Editions). The MINGW compiler and MSYS environmentare also supported on the Windows platform. The Linux platform uses the g++ compiler, and the Macintosh platform uses Apple’s Xcode tools. ..
The graphics system ofWildMagic Version 4.0 is fully based on shader programmingand relies on NVIDIA’s Cg programming language. The precompiled shaderprograms were created using the arbvp1 and arbfp1 profiles for OpenGL and usingthe vs_2_0 and ps_2_0 profiles for Direct3D, so your graphics hardware mustsupport these in order to run the sample applications. If your graphics hardware supportsonly lesser profiles such as vs_1_1 and ps_1_1, you must recompile the shaderprograms with these profiles and use the outputs instead of what is shipped on theCDROM. The distribution also contains a fully featured, shader-based software rendererto illustrate all aspects of the geometric pipeline, not just the vertex and pixelshader components.
The replacement of the fixed-function approach by a shader-based approach hasmade Wild Magic Version 4 a much more powerful graphics engine for use in allgraphics applications, not just in games. Much effort went into making the engineeasier to use and to extend, and into improving the performance of the renderers. Ihope you enjoy this new manifestation ofWild Magic!
A book is never just the product of the author alone. Many people were involvedin making this book as good as it possibly can be. Thanks to the reviewers for providingvaluable and insightful feedback about the first edition regarding how to improveit for a second edition. A special thanks goes toMarc Olano (University ofMaryland,Baltimore County) for taking the time to provide me with detailed comments basedon his experience using the first edition as a textbook. Thanks to Elisabeth Beller, theproduction editor and project manager for all of my Morgan Kaufmann Publisherbooks, for assembling yet another fine group of people who have the superb abilityto take my unattractive book drafts and make them look really good. And, as always,thanks tomy editor TimCox for his patience and help in producing yet another bookfor Morgan Kaufmann Publishers. ...