Stories
Slash Boxes
Comments

News for nerds, stuff that matters

OpenGL Programming Guide 6th Ed.

Posted by samzenpus on Wed Sep 19, 2007 01:54 PM
from the write-it-again dept.
Martin Ecker writes "The Red Book, also known as the OpenGL Programming Guide published by Addison-Wesley Professional, returns in its sixth edition with additions covering OpenGL 2.1. The Red Book, so called because of its nice, red cover, is probably the most-well known, standard introduction to the OpenGL graphics API. Let me take you on a tour through the pages of this book to see what it has to offer." Read on for the rest of Martin's review.
OpenGL Programming Guide (Sixth Edition) - The Official Guide to Learning OpenGL, Version 2.1
author Dave Shreiner, Mason Woo, Jackie Neider, Tom Davis
pages 862
publisher Addison-Wesley Professional
rating 8/10
reviewer Martin Ecker
ISBN 0-321-48100-3
summary The Red Book is the authoritative guide to OpenGL.
Just as the previous, fifth edition of the book, the sixth edition is incredibly complete and thorough. It contains explanations of pretty much every feature of OpenGL, even the rarely used ones. You want to know about the fairly new occlusion query support of OpenGL? It's in this book. You want to know about the accumulation buffer and its uses? It's in this book. You want to know about the (mostly deprecated) use of indexed color buffers? It's in this book. The sixth edition also covers vertex and fragment shaders and recent additions to the GLSL, the OpenGL Shading Language, such as the preprocessor. Even though the coverage was expanded, the authoritative guide to shader programming in OpenGL still remains the Orange Book aka The OpenGL Shading Language (see my previous Slashdot review).

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. The book consists of 15 chapters and 9 appendices that together span approximately 860 pages.

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, fixed-function lighting, framebuffer blending, and fog are discussed.

Chapter seven contains a description of display lists, a unique 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. Most notably this chapter now covers pixel buffer objects, a fairly recent addition to OpenGL, which the fifth edition of the book did not mention. The discussion of images in chapter eight bring us straight to chapter nine on texture mapping, one of the largest chapters in the book. This chapter discusses everything you need to know about textures, 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 sixth edition — sRGB format textures added in OpenGL 2.1 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. Also the accumulation buffer and its uses, such as motion blur and depth of field effects, are discussed. 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 (Graphics Processing Units).

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 sixth edition this chapter has been updated to version 1.20 of GLSL as required by OpenGL 2.1. 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 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.

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.

Martin 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 (Sixth Edition) - The Official Guide to Learning OpenGL, Version 2.1 from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

Related Stories

[+] OpenGL Shading Language 96 comments
Martin Ecker writes "A few months ago, the OpenGL Shading Language -- OpenGL's own high-level shading language for programming Graphics Processing Units (GPUs) -- was ratified by the Architectural Review Board (ARB) responsible for the development and extension of the OpenGL graphics API. The first real-world implementations are just becoming available in the latest graphics drivers of the big graphics hardware vendors. Now the first book that features this new shading language is available, with the intention of becoming the standard book on the subject. Randi J. Rost's OpenGL Shading Language (published by Addison-Wesley) is a good introduction to developing shaders with the new OpenGL Shading Language, and demonstrates a number of useful applications for real-time programmable shaders." Read on for the rest of Ecker's review.
This discussion has been archived. No new comments can be posted.
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • I'd wait! (Score:5, Informative)

    by Grisha (15132) on Wednesday September 19, @01:58PM (#20671227)
    OpenGL 3.0 is due to be released in short order, and it's pretty much a complete redesign of the API.

    Out with state machines and in with OO abstractions.

    • Re:I'd wait! (Score:4, Interesting)

      by krgallagher (743575) on Wednesday September 19, @02:35PM (#20671653)
      (http://www.krgallagher.com/)
      "OpenGL 3.0 is due to be released in short order, and it's pretty much a complete redesign of the API."

      I am not a programmer but I play one on TV.

      So help out a N00b. Is Open GL strictly for graphics, or does it cover other system calls like sound and user IO? What I am getting at here is that most of the times when I see a windows game that also runs on Linux, it uses Open GL. Those that do not use Direct X. Is the problem that the Open GL standard does not include sufficient API's to deliver all the standard calls need to write a game? Is it that other standards like ALSA (I am guessing that is a sound API) do not have windows ports? Why oh why is there nothing out there that allows programmers to write some kind of ANSI coded games that will compile on mutiple operating systems without error or modification?

      OK I admit I am ignorant in this area, so please don't call me ignorant, I have already done so myself. It just seems to me that if Microsoft can do it with Direct X, the rest of the world should be able to do it better, more cross compliant, and portable.

      [ Parent ]
      • Re:I'd wait! (Score:5, Informative)

        by Abcd1234 (188840) on Wednesday September 19, @02:41PM (#20671735)
        (http://del.icio.us/Abcd1234/)
        So help out a N00b. Is Open GL strictly for graphics, or does it cover other system calls like sound and user IO?

        Graphics only.

        Why oh why is there nothing out there that allows programmers to write some kind of ANSI coded games that will compile on mutiple operating systems without error or modification?

        I take it you've never heard of SDL [libsdl.org]? Just use an OpenGL-enabled surface for graphics, and the standard SDL APIs for sound and input.
        [ Parent ]
      • Re:I'd wait! by everphilski (Score:2) Wednesday September 19, @03:10PM
      • Re:I'd wait! by Surt (Score:1) Wednesday September 19, @03:52PM
      • Re:I'd wait! by ILongForDarkness (Score:1) Wednesday September 19, @04:01PM
      • 1 reply beneath your current threshold.
    • by krog (25663) on Wednesday September 19, @02:42PM (#20671751)
      (http://cretin.sf.net/)
      ...before I replace my Camel Book, 2nd Edition. It hasn't worked out as well as I thought it might, 5 or 6 years ago.
      [ Parent ]
    • Re:I'd wait! by Wm_K (Score:2) Wednesday September 19, @02:54PM
    • Re:I'd wait! by ultranova (Score:2) Wednesday September 19, @05:09PM
    • Re:I'd wait! by UnknownSoldier (Score:2) Wednesday September 19, @05:57PM
    • Re:I'd wait! by niteice (Score:1) Wednesday September 19, @03:22PM
      • 1 reply beneath your current threshold.
    • Re:I'd wait! by mikael (Score:2) Wednesday September 19, @06:25PM
    • 2 replies beneath your current threshold.
  • by xxxJonBoyxxx (565205) on Wednesday September 19, @02:10PM (#20671353)

    The Red Book...returns in its meanwhile sixth edition with additions...


    By "meanwhile", do you mean "ho-hum"? (e.g.,, nothing new to see here?)
  • by thatskinnyguy (1129515) on Wednesday September 19, @02:16PM (#20671429)
    Here it is in 252 words thanks to Word's AutoSummarize feature.

    The Red Book, also known as the OpenGL Programming Guide published by Addison-Wesley Professional, returns in its meanwhile sixth edition with additions covering OpenGL 2.1. It's in this book. It's in this book. It's in this book. Even though the coverage was expanded, the authoritative guide to shader programming in OpenGL still remains the Orange Book aka The OpenGL Shading Language

    The Red Book is aimed at the beginning to intermediate graphics programmer that is not yet familiar with OpenGL. The book consists of 15 chapters and 9 appendices that together span approximately 860 pages.

    The first chapter gives a brief introduction to the basic concepts of OpenGL and describes the rendering pipeline model used in the API. Chapter seven contains a description of display lists, a unique 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. Most notably this chapter now covers pixel buffer objects, a fairly recent addition to OpenGL, which the fifth edition of the book did not mention. The discussion of images in chapter eight bring us straight to chapter nine on texture mapping, one of the largest chapters in the book. The final chapter of the book is a discussion of the OpenGL Shading Language (GLSL, for short). In the sixth edition this chapter has been updated to version 1.20 of GLSL as required by OpenGL 2.1. All in all, the Red Book remains the definitive guide to OpenGL.
  • Gah. (Score:1, Troll)

    by cromar (1103585) on Wednesday September 19, @02:17PM (#20671437)
    Please, please, please stop chapter by chapter summarizing of books in reviews. A summary of the book and notable points is much better. The reader doesn't care what is in the *chapters* until they have decided to read the *book!* Please. Everyone. Stop doing this. It's pedantic.

    Incidentally, I didn't realize my copy was three editions behind... Sophomore year seems so long ago.
    • Re:Gah. by pilgrim23 (Score:3) Wednesday September 19, @02:21PM
    • Re:Gah. by tehcyder (Score:1) Friday September 21, @07:03AM
    • Re:Gah. by Abcd1234 (Score:2) Wednesday September 19, @02:31PM
    • Re:Gah. by Intruger (Score:2) Wednesday September 19, @02:37PM
    • 1 reply beneath your current threshold.
  • Which Red Book? (Score:2)

    by AJWM (19027) on Wednesday September 19, @02:22PM (#20671503)
    (http://www.ajwm.net/amayer/)
    Funny, I always though of the Red Book as the PostScript prgramming guide (er, Language Reference). Either that or the standard for audio CDs (CDDA).

    Then there's the old O'Reilly "Rainbow Books", the eight or nine volumes on X Windows specs and programming -- but glancing over at my bookshelf, none of them are red, exactly.

  • by Andrei D (965217) on Wednesday September 19, @02:31PM (#20671611)
    Maybe this is a FAQ, but could someone point us why most game developers prefer DirectX, even if, by choosing OpenGL, they'd have the possibility to develop games for other operating systems as well? Yeah, I know, Windows has over 90% of the desktop market, but why don't develop for the whole market if something like OpenGL exist?
    • Re:Comparison to DirectX (Score:5, Informative)

      by nate nice (672391) on Wednesday September 19, @02:39PM (#20671711)
      (Last Journal: Wednesday October 20 2004, @01:41AM)
      DirectX has had an "easier" and "more pleasant" API for years. OpenGL is a state machine, programmed in good 'ol C. DirectX has an OO API and what some would argue a more complete library.

      OpenGL 3.0 will move to a an OO API. It should make programming in OpenGL a lot more attractive. I've heard from people they feel it's easier to do a lot more things in DirectX than OpenGL. It's all opinion, of course.

      I'm not a graphics programmer but I have played one on TV.
      [ Parent ]
      • Re:Comparison to DirectX (Score:5, Insightful)

        by edwdig (47888) on Wednesday September 19, @03:19PM (#20672169)
        (http://slashdot.org/)
        DirectX has had an "easier" and "more pleasant" API for years.

        DirectX is a nightmare of ActiveX/COM objects. It's anything but pretty to look at it. It takes a lot of code to get started before you can do anything. There's a very steep learning curve to fight through before you can do anything at all with it. It gets easier once you've managed to get it going, but it still isn't pretty.

        OpenGL is a state machine, programmed in good 'ol C.

        Which makes it very straightforward to work with. You don't find yourself wondering how something will work. If you have any background in 3D graphics theory, things work in OpenGL exactly as you'd expect.

        DirectX has an OO API and what some would argue a more complete library.

        The OO API doesn't make things easier, as it's COM based. It's advantage is integration with Windows.

        The library is where DirectX has an advantage. It's got some higher level functionality built in that OpenGL doesn't have.
        [ Parent ]
      • Re:Comparison to DirectX by Anonymous Coward (Score:2) Wednesday September 19, @04:26PM
      • Re:Comparison to DirectX by Lord Crc (Score:2) Wednesday September 19, @04:29PM
      • Re:Comparison to DirectX by Black Art (Score:2) Wednesday September 19, @04:46PM
    • Re:Comparison to DirectX (Score:5, Interesting)

      by Xiph (723935) on Wednesday September 19, @02:41PM (#20671741)
      MicroSoft subsidizes training.
      DirectX is the native API to the OS on most peoples computers.
      Microsoft has experienced technical writers publish books about DirectX the day it comes out.
      OpenGL books are being written mostly by developers, which aren't always good technical writers.
      Microsoft managed to mastermind OpenGL standard development to halt to a freeze for several years, they no longer hold the same influence.

      My opinion:
      OpenGL is a more logical language, with a few features that are far better.
      OpenGL makes me happy, no clue why, but I enjoy coding up against it, DirectX makes me concentrate and for some reason, I never manage to dispose properly of all my "managed" objects in DirectX. That being said, one thing i like about directX is DirectView.
      OpenGL + Cg makes me happy

      My captcha was porters, proving that there is not necessarily a direct link between what you write and what captcha you get :P (to me a porter is a beer)
      [ Parent ]
    • Re:Comparison to DirectX by Jerry Coffin (Score:2) Wednesday September 19, @04:02PM
    • Re:Comparison to Direct3D by M0max (Score:1) Thursday September 20, @01:55AM
    • 1 reply beneath your current threshold.
  • What's missing in the review (Score:1, Funny)

    by Anonymous Coward on Wednesday September 19, @03:29PM (#20672283)
    The reviewer does a good job of describing chapter by chapter and also the color the book's cover, but forgot to tell us what's on the inside cover and outside back cover. Of course no description of a book would be complete without info about what font was used to typeset. Who cares about the book's content when you've got such exciting reviewers. Write on...
    • 1 reply beneath your current threshold.
  • Questions (Score:2)

    by LM741N (258038) on Wednesday September 19, @05:24PM (#20673791)
    In any Linux or BSD system there is GL this, GL that. Yet the package that installs this seems to be called Mesa. Mesa I guess is still in development. Some OS versions fail to install the /usr/X11R6/include/GL Motif widget headers. I always have to go in and manually move them from the build directory to their useful location. Otherwise I have programs that won't compile.
  • Q about book (Score:2)

    by autophile (640621) on Wednesday September 19, @08:00PM (#20675589)

    Is this one of those books where the 860 pages is mostly filled with API documentation? Or is this a genuine how-to book? I'm definitely interested in learning OpenGL so that I can write a nice GUI for simple games, but it's hard to know where to start.

    Thanks,

    --Rob

  • Re:opengl is dead (Score:2)

    by TomorrowPlusX (571956) on Wednesday September 19, @02:44PM (#20671793)
    I know you're trolling, but get out of your parents' basement. There's more to the 3d visualization world than video games.
    [ Parent ]
  • by denison (735014) on Wednesday September 19, @03:38PM (#20672403)
    How quickly do stale donuts lose their value? Haven't stale donuts lost most of their value already?
    [ Parent ]
  • 5 replies beneath your current threshold.