|OpenGL SuperBible (Fourth Edition)|
|author||Richard S. Wright, Jr., Benjamin Lipchak, Nicholas Haemel|
|summary||A solid introduction to OpenGL programming that focuses on both the old-style fixed-function pipeline and new-style shaders.|
The OpenGL SuperBible, is split into three parts, appropriately called the old testament, the new testament, and the apocrypha. Arguably, appendix C, an OpenGL API reference with more than 350 pages, could be considered a fourth part even though it isn't listed as such in the table of contents.
The old testament provides an introduction to both OpenGL programming with the fixed-function pipeline and to the basics of 3D graphics programming. The new testament then moves on to describe how shaders, small programs that run on the GPU (Graphics Processing Unit), allow us to use the programmable features of today's powerful graphics cards. It also contains information on recent advancements of the OpenGL API, such as floating-point textures, pixel buffer objects and framebuffer objects. The apocrypha closes the book with a discussion of how to interface OpenGL with the underlying operating system.
The first part of the book — the old testament — consists of 14 chapters with around 500 pages total. The first chapter gives a general overview of 3D graphics and the various effects that the remaining chapters in this part of the book are going to show how to implement with OpenGL. The writing style is very casual and easy to follow. Especially in these first chapters, the book is very light on mathematics, but does explain some of the basics, such as coordinate systems, some simple vector algebra, and matrices. The second chapter introduces OpenGL and immediately presents a few simple sample programs to wet the reader's appetite. The programs are analyzed in detail with explanations to nearly all lines of code. It should be easy for a beginner to follow and understand the code.
The next few chapters gradually introduce more and more OpenGL API functions intermixed with new 3D graphics concepts, such as rendering points, lines, and polygons in various ways, how to use geometric transformations and projections, and how to use the fixed-function pipeline to render lit objects with simple projective shadows. Eventually, texture mapping is introduced with pretty much everything you need to know about the topic. In particular, multitexturing, the various filtering modes — even anisotropic filtering, texture compression, and using textures with point sprites are discussed. The book continues with an overview of curves and surfaces as supported by the OpenGL Utility library (GLU, for short). The book dates itself a bit here, since this is a software-only, and thus fairly low-performance feature that is rarely ever used in professional software. The same applies to the discussion of feedback and selection, which are not implemented on current graphics hardware and therefore not widely used. After this short excursion down the OpenGL memory lane the book moves on to the fairly recent addition of occlusion queries. Occlusion queries are used to detect complex, occluded objects in the rendered scene, so that they need not be rendered. Most modern-day graphics software that renders dense scenes with a lot of overdraw, such as video games, uses this feature. The old testament closes with a chapter on depth textures, which are prominently applied to render real-time shadow effects.
After laying a solid foundation for 3D graphics programming with OpenGL in the first part, the second part of the book — the new testament — deals with the new era of graphics programming that started a few years ago when the first programmable graphics card came into the market. This part consists of 4 chapters with about 100 pages. The first chapter provides an overview of the programmable pipeline and explains which features of the fixed-function were replaced by shaders. This introduction is followed by a sample program that gives a first glimpse of GLSL, the OpenGL shading language, in which shaders are written. The next chapter is all about vertex shaders and how to implement simple lighting models, fog, and vertex transformations using them. The third chapter is about fragment shading with some interesting post-processing and procedural texture mapping shaders. The final chapter of this part of the book discusses advanced buffers, such as floating-point textures and color buffers, and pixel buffer and framebuffer objects — all recent additions to OpenGL that allow to achieve various effects, such as rendering directly to a texture or creating vertex data on the GPU.
The final part of the book — the apocrypha — consists of 4 chapters explaining how to integrate OpenGL with the underlying operating system, in particular with Windows, Mac OS X, and Linux plus various other Unix flavors. The last chapter of this part of the book is about OpenGL ES, which is a version of OpenGL designed to be used especially on embedded system devices, in particular mobile phones and PDAs, to render real-time, interactive 3D graphics.
The book has a lot of images and diagrams throughout, though unfortunately not all of them are in color. There are however 32 color plates of the most interesting images in the middle of the book. The complete source code of the book, and even precompiled binaries for Windows and Mac OS X, can be downloaded from the book's webpage.
If you are new to both 3D graphics programming and OpenGL with a bit of C/C++ programming experience and you are eager to learn how to develop interactive programs with OpenGL, then this book is exactly right for you. The book is written in an easy to understand style without skimming the details. It is the most comprehensive introduction to OpenGL that doesn't require a lot of previous knowledge I have seen to date. If you already have experience with another graphics API or are well-versed in 3D graphics in general, but want to familiarize yourself with OpenGL, you might also want to consider the OpenGL Programming Guide, also known as the Red Book.
All in all, the OpenGL SuperBible succeeds fairly well in keeping its promise to be the best introduction to OpenGL and 3D graphics programming. Even after you're done working your way through the main parts of the book you will always come back to the handy OpenGL API reference in the appendix of the book.
I have been involved in real-time graphics programming for more than 10 years and work as a professional game developer for High Moon Studios in sunny California.
You can purchase OpenGL SuperBible Fourth Edition from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.