Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Image

OpenGL Programming Guide 7th Edition 48

Martin Ecker writes "The Red Book, also known as the OpenGL Programming Guide published by Addison-Wesley Professional, returns in its seventh edition, now covering OpenGL up to and including version 3.1. The Red Book, so called because of its deep red cover, is the most-well known, authoritative introduction to the OpenGL graphics API. In this review I want to take you on a whirlwind tour through the pages of this book to see what it has to offer." Keep reading for the rest of Martin's review.
OpenGL Programming Guide (Seventh Edition) – The Official Guide to Learning OpenGL, Versions 3.0 and 3.1
author Dave Shreiner, The Khronos OpenGL ARB Working Group
pages 883
publisher Addison-Wesley Professional
rating 8/10
reviewer Martin Ecke
ISBN 0-321-55262-8
summary The Red Book remains the authoritative guide to OpenGL.
The Red Book is aimed at the beginning to intermediate graphics programmer that is not yet familiar with OpenGL. It assumes a basic background in computer graphics theory and working knowledge of the C programming language. Just as the previous edition of the book, the seventh edition is incredibly comprehensive and thorough. It contains explanations of pretty much every feature OpenGL has to offer, even the more obscure and rarely used ones. This is good in the sense that it's a fairly complete book, but it can also be somewhat overwhelming for a beginner when confronted with a book that weighs in at almost 900 pages. However, the good news is that the material is presented in a logical progression and even a novice will get up to speed with the basics of OpenGL after reading only the first few chapters of the book. Some of the early chapters in the book contain a few more advanced sections mostly explaining new features that got introduced with OpenGL 3.1. These sections are conveniently marked as advanced and can probably be skipped on a first read-through of the material.

The first chapter gives a brief introduction to the basic concepts of OpenGL and describes the rendering pipeline model used in the API. GLUT, a cross-platform library that allows easily creating OpenGL applications, is also shortly discussed together with a program that shows GLUT in action. The following chapters proceed to explain the basic geometric primitives, such as lines and polygons, supported by OpenGL and how to render them in different positions and from different viewpoints using the various OpenGL matrix stacks. Also the basics of using colors, lighting, framebuffer blending, and fog are discussed.

Chapter seven contains a description of display lists, a unique and with OpenGL 3.1 deprecated feature of OpenGL that allows to store OpenGL API calls for efficient multiple uses later on in a program. Chapter eight then moves on to discuss what an image is for OpenGL, and most notably covers pixel buffer objects, a somewhat recent addition to OpenGL. The discussion of images in chapter eight brings us straight to chapter nine on texture mapping, one of the largest and arguably most important chapters in the book. Everything you need to know about textures is discussed, from specifying texture images in uncompressed and compressed form to applying textures to triangles using the various kinds of supported texture filters. Also depth textures and their application in the form of shadow maps and – new in the seventh edition – floating-point textures and texture arrays added in OpenGL 3.0 are presented.

In chapter ten the authors discuss the buffers that make up the framebuffer, such as the color buffer, depth buffer, and stencil buffer. This chapter summarizes some of the things already presented in the earlier chapters and then describes the various framebuffer operations in more detail. Chapter eleven and twelve are on the tools provided by GLU, the GL utility library, in particular tesselators, quadrics, evaluators, and NURBs. GLU is nowadays rarely ever used in production code, so these chapters mostly demonstrate just how complete the Red Book is in its coverage of OpenGL. This also applies to chapter thirteen on selection and feedback, which are rarely used features, mostly because of the lack of hardware acceleration in today's GPUs.

Finally, chapter fourteen is a collection of topics that didn't fit into the other chapters, such as error handling and the OpenGL extension mechanism. Additionally, this chapter presents various higher level techniques and tricks, for example how to implement a simple fade effect, how to render antialiased text, and some examples of using the stencil buffer. The final chapter of the book is a discussion of the OpenGL Shading Language (GLSL, for short). In the seventh edition this chapter has been updated to version 1.30 and 1.40 of GLSL, as required by OpenGL 3.0 and 3.1, respectively. Even though the OpenGL API functions required to use GLSL are presented, this is only a rough overview of how programmable shaders are used in OpenGL. For a more detailed description of GLSL the reader is referred to the book "OpenGL Shading Language. Third Edition" also called the Orange Book.

The book closes with quite a few appendices on the order of operations in the OpenGL rendering pipeline, the state variables that can be queried, the interaction of OpenGL with the operating system-specific windowing systems, a brief discussion of homogeneous coordinates as used in OpenGL, and some programming tips. Also a reference of the built-in GLSL variables and functions is included.

The book contains a large number of images and diagrams, all of them in black and white except for 32 color plates in the middle of the book. The illustrations are of high quality and generally help make the explained concepts and techniques easier to understand. Most of the color plates depict spheres, teapots, and other simple geometric objects, so they aren't overly eye-catching but do serve their purpose of showing what can be achieved with OpenGL.

With OpenGL 3.1 deprecating many older API features of OpenGL in favor of more modern alternatives, the seventh edition of the Red Book seems to have a bit of a split personality at times. If you're only interested in functionality not deprecated in 3.1 you can skip entire chapters, such as the chapter on display lists or fixed-function lighting. Of course, the knowledge of matrix stacks and how to use transformations is still relevant, but the corresponding OpenGL functions have been deprecated in favor of doing all the transformation math in the vertex shader or, what most people have been doing anyway, using your own matrix structures/classes on the CPU. The situation is similar for many of the other deprecated features (such as fixed-function lighting, color index mode, immediate mode, ...) that are still described in the book. I think the time is right to combine the Red Book with the Orange Book, removing any discussion of deprecated features, to have a book that focuses solely on the modern approach to graphics programming, which is mostly based on shaders. I can only hope such an OpenGL 3.1-only focused book will see the light of day soon.

All in all, the Red Book remains the definitive guide to OpenGL. Apart from being a good introduction, it also contains many interesting tips and tricks that make the experienced OpenGL programmer come back to it often. If you've read through the Red Book and the Orange Book in their entirety you pretty much know everything there is to know about OpenGL.

The 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 Programming Guide 7th 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 Programming Guide 7th Edition

Comments Filter:
  • Another Viewpoint (Score:5, Informative)

    by eldavojohn ( 898314 ) * <eldavojohn@noSpAM.gmail.com> on Wednesday January 27, 2010 @03:18PM (#30922002) Journal
    From the Amazon link, I found several reviews giving the book a thrashing for continuing to include deprecated APIs [amazon.com] and not teaching the new paradigms [opengl.org] of the APIs after OpenGL 3.0. One review [amazon.com] was upset with the regurgitation and lack of new material. Another reviewer [amazon.com] was looking for a book that concisely covers OpenGL 3.1 and the new way of coding things since 3.0 instead of the backwards compatible context and forward compatible context intricacies.

    I was thinking of picking up a good OpenGL book but this one sounds like it'd be most useful to people who need to move old projects forward and have to deal with old APIs and transitioning the graphics up to 3.0. But if you're coding from scratch and want the latest OpenGL, this book might have a lot of material you shouldn't even pay attention to because it's deprecated. I guess for hobbyist meddling I'll stick to the wiki [opengl.org] as it's a difficult task for people to write documentation books on a changing spec. Probably a good one stop shop for all versions of OpenGL but I think sometimes the spec implementers just want you to move forward and aim to ask you to do that as infrequently as possible. I guess 3.0 appears to have addressed that.
  • by Creepy ( 93888 ) on Wednesday January 27, 2010 @04:01PM (#30923122) Journal

    First off, it's not a trilogy, unless you're Douglas Adams - their are at least FIVE books - Blue, Green, Orange, Red, and White. Possibly 6, but I don't remember if AGL ever came in hard copy (I've personally always used the online AGL and Cocoa reference).

    The red book is the only real essential one. Some may say the Orange book as well, but I personally found NeHe tutorials and samples from other sites like nVidia helped me much more than the Orange book.

    The blue is basically the man pages for all functions and pointless today (just go to Khronos and download the reference). I haven't opened my blue book since about 1996.

    The green and white books are also pointless IMO, unless you really can't find sample code for them, since they cover XWindows and Windows non-portable pieces, such as setting up graphical contexts and other parameters and settings. In fact, I actually don't like how they do it, preferring more flexible parameter lists.

  • by TheRaven64 ( 641858 ) on Wednesday January 27, 2010 @04:17PM (#30923528) Journal
    OpenGL ES is not a subset of OpenGL. There is a shared subset that is in both OpenGL and OpenGL ES, but both contain things that are not part of the other. Yes, I know the Wikipedia article that you cited says that it is, but if you read any of the sources that it links to then you'll find that it's wrong.
  • Re:Another Viewpoint (Score:5, Informative)

    by pnewhook ( 788591 ) on Wednesday January 27, 2010 @04:40PM (#30924050)

    The other problem is that the majority of available hardware and drivers don't support GL 3.x. No open-source driver does, and in fact most Intel, Radeon, and nVidia hardware already in use can only do GL 2.x.

    That's simply not true at all. Even my laptop supports OpenGL 3.x

  • by erwincoumans ( 865613 ) on Wednesday January 27, 2010 @04:54PM (#30924334)

    Khronos, the main authority of OpenGL ES, tells that it "consists of well-defined subsets of desktop OpenGL"

    http://www.khronos.org/opengles/ [khronos.org]

  • Re:Another Viewpoint (Score:3, Informative)

    by MostAwesomeDude ( 980382 ) on Wednesday January 27, 2010 @05:06PM (#30924560) Homepage

    $ glxinfo | grep OpenGL
    OpenGL vendor string: VMware, Inc.
    OpenGL renderer string: Gallium 0.3 on softpipe
    OpenGL version string: 2.1 Mesa 7.8-devel
    OpenGL shading language version string: 1.20
    OpenGL vendor string: X.Org R300 Project
    OpenGL renderer string: Gallium 0.3 on R580
    OpenGL version string: 2.1 Mesa 7.8-devel
    OpenGL shading language version string: 1.20

    Two GPUs. So fuck you. :3

"Experience has proved that some people indeed know everything." -- Russell Baker

Working...