Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?
Books Book Reviews

OpenGL SuperBible 5th ed. 98

asgard4 writes "OpenGL SuperBible in its fifth edition is almost a complete rewrite. The authors threw out the discussion of old-style, fixed-function programming and replaced it with an introduction to OpenGL that is exclusively focused on using shaders from the very beginning. All the things that got deprecated with the advent of OpenGL 3 got removed, making it a more relevant and up-to-date book than the previous editions. The OpenGL SuperBible still strives to be the 'world's best introduction to OpenGL' according to the authors. Let's see if it can keep that promise." Read on for the rest of Martin's review.
OpenGL SuperBible (Fifth Edition)
author Richard S. Wright, Jr., Nicholas Haemel, Graham Sellers, Benjamin Lipchak
pages 969
publisher Addison-Wesley Publishing http://www.awl.com
rating 9/10
reviewer Martin Ecker
ISBN 0-32-171261-7
summary : Quite possibly the best introduction to OpenGL 3.3 programming that focuses exclusively on graphics programming using shaders
With the removal of the fixed-function pipeline, the OpenGL SuperBible is no longer quite the heavy-weight it used to be. It shrunk from more than 1200 to about 970 pages, which is not necessarily a bad thing. The book starts out with a basic introduction to 3D graphics, coordinate systems, and some basic math concepts, followed by short rundown of the history of OpenGL and a first little example program that renders a triangle. The authors even provide instructions on how to setup the C/C++ projects to build the example on Windows and MacOS. The writing is to the point but still verbose enough to easily follow the text. The authors analyze the example program in detail making it easy for a beginner to follow and understand the code. Overall, I really like the writing style and the flow of the book.

The next few chapters gradually introduce more and more OpenGL API functionality intermixed with new 3D graphics concepts, such as rendering points, lines, and polygons in various ways, alpha blending, how to use geometric transformations and projections, and how to move objects and the camera. Eventually, basic texture mapping is introduced with most of the basic things you need to know about the topic. In particular, specifying textures coordinates, sampling textures in the fragment shader, the various filtering modes (even anisotropic filtering), and texture compression are discussed. In a later chapter the authors do another deep dive into the topic of textures, in particular rectangle textures, cube maps, multitexturing, point sprites, and using texture arrays

Until this point the authors used haven't really talked much about shader programming yet. Most of the examples use simple pre-made shaders that don't really do much. This changes with chapter six titled "Nonstock Shaders" where we get a first glimpse of how to write our own shaders in GLSL, the OpenGL Shading Language. In particular, a fragment shader that uses a simple lighting model to light objects is developed.

After these introductory chapters presenting the basics of OpenGL programming, the next part of the book focuses on more advanced topics, beginning with buffer objects and how to use them to make your OpenGL programs run much more efficiently on modern hardware. Some of the examples presented in this part of the book include using render-to-texture to do reflections, tone mapping, and bloom. This part of the book closes with two fairly long chapters on advanced usage of the shader pipeline, in particular the transform feedback and the geometry shader stages. There is also some discussion on more advanced effects achievable with fragment shaders, in particular applying filters to images, such as a Gaussian blur or a Sobel filter. Finally, rendering geometry efficiently with vertex buffer objects and rendering many objects via geometry instancing is presented.

The final part of the book 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 24 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 (or even more advanced topics). It is the most comprehensive introduction to OpenGL that doesn't require a lot of previous knowledge I have seen to date. The decision to completely drop any discussion of the fixed-function pipeline turned out to be an excellent choice. Finally there is a book that no longer wastes the reader's time with the parts of OpenGL that nobody who does serious graphics development uses and instead presents up-to-date information on how to do 3D graphics on modern graphics hardware.

All in all, the OpenGL SuperBible in its fifth edition succeeds very 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.

The review author has been involved in real-time graphics programming for more than 10 years and works as a professional game developer for High Moon Studios in sunny California.

You can purchase OpenGL SuperBible (Fifth 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.


This discussion has been archived. No new comments can be posted.

OpenGL SuperBible 5th ed.

Comments Filter:
  • Referral Link (Score:1, Insightful)

    by Anonymous Coward on Monday October 25, 2010 @02:19PM (#34016244)
    Smooth move getting a referral link on the front page of slashdot.
  • by Daniel Phillips ( 238627 ) on Monday October 25, 2010 @02:35PM (#34016438)

    Also, ES like 3.0+ does all everything with vertex arrays and not immediate mode. (Immediate mode is still available in 3.0+, though deprecated, however it was completely removed from ES.) The biggest difference between ES and mainstream OGL is the central role of 16:16 fixed point, which to be honest is not very much different from FP, you just need to pay more attention to expression precision.

  • by pnewhook ( 788591 ) on Monday October 25, 2010 @04:56PM (#34018364)

    This is mostly due to the extra debugging and analysis support that they have in the DirectX SDK.

    Not available if you want cross platform. There are a lot of OpenGL debug tools as well.

    OpenGL can be fast for getting something together pretty quick, but then figuring out why it doesn't work the same way on other systems can be very troublesome.

    Well DirectX has solved this one by not having any other systems. It's Windows or nothing.

    In my experience, I have also seen people who use OpenGL redoing things that DirectX has done for you in the past, such as reference counting.

    Why should a graphics system handle a programmers reference counting? This gets into your coding strategy. Handle it the same way you handle access to any other shared resource like a memory or device handle.

  • by Barefoot Monkey ( 1657313 ) on Monday October 25, 2010 @05:43PM (#34018938)

    Fixed point has its limits with precision. It's not a brilliant scheme to be working with when it comes to 3d graphics. Most vendors have realised this, and any mobile GPU from since a few years before the iphone was introduced will have full floating point support, shaders and modern concepts available.

    Actually, floating point has limits to its precision too. A 32-bit floating point number has a 23-digit significand, whereas 16:16 fixed point has a 32-digit significand, so fixed point is 128 times as precise as floating point. The main benefit of fixed point, however, is reliability; unlike floating point, your numbers don't become less accurate as you move away from the origin. The drawback of fixed point is range; unlike floating point, fixed point cannot sacrifice accuracy to allow for larger numbers, so the biggest number you can store is slightly less than 32768. That is enough to represent a 320x320 kilometer area with an consistant accuracy of ~1.5 millimeters, which makes fixed point attractive format for data representation. On the other hand, floating point would been fine near the middle, but have been accurate to only 0.8 meters near the edge, and you'd probably end up having to shrink the area to down to 4x4 kilometers to avoid problems.

    I agree with you that a device with only floating point and integer support is far superior to one with only fixed and integer, but fixed point is indeed very good to have in 3D graphics for those situations where it is more appropriate.

  • by TrancePhreak ( 576593 ) on Monday October 25, 2010 @08:55PM (#34020460)
    So you say there's no left hand coordinate system, then say D3D uses one... Then you post a link that says it can be either.

We cannot command nature except by obeying her. -- Sir Francis Bacon