Top positive review
Excellent and approachable 3D engine tutorial
on May 12, 2004
In his latest book, "Tricks of the 3D Game Programming Gurus," André LaMothe develops a 3D software engine by adding new functionally sequentially through each successive chapter. The book is a little over 1600 pages, comes with a companion CD and retails for $59.99.
Writing a graphics engine in software may not seem all that sophisticated, but it is an excellent way to approach computer graphics. By having to write specific functions that are typically abstracted by a platform specific API (i.e. DirectX), LaMothe focuses on the underlying theory and provides the reader a conceptual framework that is easily adapted to various targets as need arises.
While this book is the second volume in the Tricks series, having read the first book is not essential. To handle the 2D graphics, audio, and input, LaMothe starts off with the engine developed from the first book with DirectX 7 - and builds the 3D software engine on top of it (through the course of the subsequent chapters).
The first section introduces DirectX, the basic game structure, and the previous library's functional interface. In order to maximize time (and pages) building the new 3D engine, LaMothe abstracts the DirectX and Win32 code by encapsulating the computer interface to a set of three libraries to handle window construction, input, and audio. The book adequately describes the basic foundations necessary to use DirectX and Win32 without dwelling on many of the specifics. The main objective is getting to the 3D portion of the book and a "black box" approach is best for the platform specific wrapper code.
The second section begins with linear algebra and trigonometry. The math section spans over one hundred pages and forms the basis of the math library described in the subsequent chapter. Having most of the fundamental groundwork in place, LaMothe begins to develop the pipeline for the 3D engine. From the local to world transform to projection, the sub-steps necessary for rasterization are well detailed and described. In order to read external model data, several functions are developed to parse the output of the modeling tools included on the companion CD. By the end of the section, the engine is able to render in wire-frame.
After having the basic engine in place, the book really takes off. LaMothe starts the third section of the book adding critical enhancements: lighting, texture mapping, clipping, and a depth buffer. Starting with the mathematical background, each topic is thoroughly explored then the functional changes to the engine API are presented. LaMothe writes in a clear and sometimes too familiar fashion. The book reads as though LaMothe is speaking directly to you while transcribing his thoughts to the page.
In the final section of the book, LaMothe tackles several advanced graphics topics: perspective texture mapping, spatial partitioning, shadows, and animation. The visibility chapter is particularly strong with an in-depth look at Binary Space Partitions (BSP trees) and various other portal techniques. The engine code and examples are well commented and makes it easy to jump back and forth from the book to the source code.
The companion CD is as robust as the book. It contains a bevy of additional resources - nearly 600 MB including all the source code covered in the text (with pre-compiled executables), the book's appendices, twenty five articles from various authors on everything from Artificial Intelligence to Pentium optimization, source code to Quake, and trial versions of some helpful game development tools, like Sound Forge and Paint Shop Pro, and the DirectX 9 SDK. The modeling tools are a very nice touch and add to the completeness of the overall text.
Simply put, this is a thoroughly satisfying book. While LaMothe's approach in developing the engine is sound, understand that he makes design choices throughout the book to specifically make a fast software engine (i.e. no shaders, no complex light models, lookup tables, etc.). The theory behind his choice in approach is the valuable part of the book and the engine is just a practical demonstration. A reader looking to develop their own engine or understand the details behind the scenes when using an API like DirectX will truly appreciate the effort LaMothe has undertaken.