Martin Ecker writes "Until now, if you were looking for an introduction to the OpenGL graphics API, the "OpenGL Programming Guide" (also known as the Red Book) was your best bet. Now Addison Wesley Publishing provides a new alternative that is easier to digest than the all-encompassing Red Book with its more than 800 pages. Paul Martz's "OpenGL Distilled" concentrates on discussing only the important fundamentals you need to program 3D graphics using OpenGL 2.0 and provides a concise introduction to the most important cross-platform graphics API currently available." Read the rest of Martin's review.
|summary||A concise introduction to the OpenGL graphics API|
Before going into more detail and reviewing the chapters of the book I have to disclose that I was a technical reviewer of the book before it was published.
"OpenGL Distilled" is aimed at people interested in learning the basics of OpenGL. The reader should already be familiar with programming in C++ and have a basic grasp of linear algebra, in particular vector and matrix algebra. Familiarity with other 3D graphics APIs, such as Direct3D, is an advantage, but not a necessity. The book does a good job of presenting only the fundamental aspects of OpenGL and 3D graphics programming in general and never overwhelms the reader with too much unnecessary detail. The author draws a good line between what to discuss and what is beyond the scope of the book. More advanced features of the API are only mentioned shortly with appropriate references to more in-depth literature. Some deprecated features, such as the feedback buffer, that are no longer commonly used are left out as well. In my opinion an unfortunate omission, is shader programming with the OpenGL Shading Language, which is only briefly mentioned in an appendix. A full chapter introducing the basics would be a nice addition to the book. Until then the reader is referred to the Orange Book, which discusses shader programming in OpenGL in detail.
One thing I highly appreciate about "OpenGL Distilled" is the introductory section of each chapter, which contains a "What You'll Learn" and a "What You Won't Learn" bullet list. This makes it clear what the chapter is about and - more importantly - what it is not about. Especially the latter is mostly missing in other books.
The book has a total of 8 chapters and 4 appendices. The first chapter explains what OpenGL is, talks a bit about setting up a development environment on the most common operating systems to actually develop OpenGL programs, and immediately gets your feet wet with a first simple example program. The chapter is concluded by a whirlwind tour through the almost 15-year history of OpenGL and its predecessors.
Chapter two focuses on drawing primitives, such as lines and triangles, and the various ways supported by OpenGL to specify vertex data. In particular, vertex arrays and vertex buffer objects (VBOs), a fairly recent addition to OpenGL to allow high-performance rendering, are the focus of this chapter. Additionally, a first overview of the OpenGL pipeline that a primitive passes through until it finally ends up in the framebuffer is presented. A more detailed discussion of this pipeline, in particular with regard to coordinate transformations, follows in chapter three. The various coordinate systems used in OpenGL programming, such as object, world, eye, and clip coordinates, are presented and discussed in detail in this chapter.
Now that we can render primitives we need to light them to make them look more interesting. Chapter four sheds some light on this by discussing the lighting and material model used in OpenGL's fixed-function pipeline. The best part of this chapter is the section titled "Debugging Lights", which gives some insights and helpful advice on how to debug OpenGL programs that use lighting. Many other books only describe the features of OpenGL lighting but do not explain common debugging techniques that can be applied when all you get is a black window instead of a nicely lit scene.
Chapter five is about pixel rectangles, in particular how to read from and write to the framebuffer. Some performance considerations are also discussed, which is a good thing since reading from the framebuffer is a costly operation. Again, this chapter concludes with a nice section on debugging techniques. The explanation of the raster position in this section is probably the easiest to understand that I have read to date.
Chapter six is a comprehensive chapter on 2-dimensional texture mapping that also discusses some more advanced applications of the technique, such as light maps and depth maps. Also using cube maps as environment maps is introduced. 1-dimensional and 3-dimensional texture mapping was omitted from the discussion.
Chapter seven deals with detecting the feature set of the OpenGL implementation, in particular, determining the version of the OpenGL specification the implementation adheres to and the available extensions. This chapter also discusses how to retrieve and use entry points for available extensions.
Finally, chapter eight deals with the platform-specific interfaces required to hook up an OpenGL program with the underlying operation system. These platform-specific interfaces are called GLX for Unix, WGL for Windows, and AGL for Mac.
The book has four appendices, which deal with a quick overview of advanced features, best practices, performance-related issues and debugging tips and tricks. Especially the latter two appendices on performance and debugging contain a lot of insights invaluable to programmers just starting out with OpenGL.
The book is printed in black and white throughout. Having some color plates in the book itself would have been a welcome addition considering that the topic is computer graphics. However, you can download some color plates from the books website at where you will also find the source code to the example programs in the book.
In conclusion, "OpenGL Distilled" is an excellent introduction to OpenGL, not only for someone new to 3D graphics programming but also for those that have worked with other 3D graphics APIs in the past that wish to get up to speed with OpenGL quickly. The book omits advanced and deprecated features that would unnecessarily overwhelm a beginner with OpenGL and is a good companion on the way to becoming an experienced OpenGL programmer.
The review author has been involved in real-time graphics programming for more than 10 years and works as a games developer for arcade games. In his rare spare time he works on a graphics-related open source project called XEngine http://xengine.sourceforge.net./
You can purchase OpenGL Distilled from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.