OpenGL Programming Guide 6th Ed.
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.
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.
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.
By "meanwhile", do you mean "ho-hum"? (e.g.,, nothing new to see here?)
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.
The game.
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.
"Just as the previous, fifth edition of the book, the sixth edition is incredibly complete and thorough. "'
860 pages and it'll collapse your spine and your bookshelf. Plus technical books lose their value quicker than stale donuts.
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.
-- Alastair
Open sorcerers?
* puts on his pointy hat.
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?
We often refuse to accept an idea merely because the tone of voice in which it has been expressed is unsympathetic to us
...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.
Cretin - a powerful and flexible CD reencoder
I know you're trolling, but get out of your parents' basement. There's more to the 3d visualization world than video games.
lorem ipsum, dolor sit amet
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...
I believe this is how blender still does it, the entire interface is written in openGL.
---- Booth was a patriot ----
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.
Direct3D is no more advanced than OpenGL so your "lot of money into research" theory is busted. Direct3D is really no more innovative than any other Microsoft product, ie. it's a tiny bit behind everybody else but it has a lot more marketing with the words "innovation" in it.
... every now and again Microsoft will change the API so you'll to go through and rewrite your program.
.exe file and it will run on any windows installation since Windows 95.
They do spend a lot of money on PR and taking games company bosses to lunch.
You can definitely get the exact same speed from OpenGL as Direct3D on top end hardware - I do it every day.
OpenGL drivers for major graphics cards (ATI/Nvidia/Intel) are about the same level of stability/etc. as Direct3D drivers - both are really just an abstraction of the graphics card's own internal API so that's not really surprising. For other manufacturers Direct3D may have a slight edge here but Direct3D isn't 100% on those cards either. Expect problems with both APIs if you push them beyond the core functionality (e.g. trying to do CAD instead of games).
OpenGL doesn't have "few windows apps", it has "few windows games". Microsoft spends a lot of money to make sure this is so.
DirectX has awful support unless you're a games company - it's and ugly API (COM), the documentation is awful, there's no decent support groups and
Deployment of Direct3D programs is a nightmare. The SDK changes on a monthly basis and you basically have to include the 30Mb runtime with your program or it won't run - the DLLs don't match up. If you search c:\windows for "d3d*.dll" you'll see what I mean - a long list of files of the form "d3dx9_XX.dll" where XX is a number indicating the SDK release. With OpenGL I can just give you a single
Direct3D is good for throwaway projects with limited shelf life. I can still compile and run OpenGL programs I wrote ten years ago, no problem. No that I really have to - they still work and even took advantage of new graphics card features when they appeared (eg. hardware vertex tranform). If those programs were Direct3D they wouldn't be working now, they'd need a rewrite.
For professional games Direct3D is probably better. For everything else, and definitely for hobby work, OpenGL is better.
No sig today...
ABI? Undocumented quirks? Clones? What are you on about?
OpenGL is the name of an API. Various companies make implementations for their hardware / OS, and then they pay SGI for the right to call their implementations 'OpenGL' (after passing a load of conformance tests).
Mesa is an implementation of the OpenGL, it just hasn't been officially blessed by SGI (although they do support it's existance in other ways) so it can't legally call itself OpenGL.
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
Towards the Singularity.
OpenGL is the name of the API, which is what I said. I also said it was the name of the reference implementation provided by SGI (which it is). A reference implementation gives you an ABI and - invariably - quirks. SGI's OpenGL code provided in X11 and on their OSS pages are a reference implementation, not a commercial implementation. Even though OpenGL does not specify an ABI - it is an API specification - it is inherent in the process of having a reference implementation that people will code to the ABI provided by that reference version so that their code can just drop in.
It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
since version 8, directX has been far easier to program than opengl... :(
it is easy to create a directx application,
- you no longer have to deal with the crazy amounts of COM crap
- the init calls are really streamlined now.
- also nehe has tutorials for lots of dx apps
directx mirrors the hardware more correctly (was more true back with DX8/9), meaning that your code will run faster. (however opengl is catching up fast)
game developers really really care about performance.
microsoft gives support, and hs a really really smart team who can help give great ideas on cutting edge usage (i've met them).
opengl extensions are really annoying to sift through to find what you should be using... dx9 API is right there. so much fixed function clutter still in opengl..
PC drivers support directx better (usually).
xbox 360 supports directx (mostly), so code will port to a significant paying market (unlike you free loadin linux hippies - just kidding).
great documentation.
this is why directx is preferred these days.
(I was a huge a opengl advocate pre DX8, definitely not a fanboy).
that said, it's not too hard to make a wrapper around both DX and opengl using the highest performance graphics driver calls. both APIs today have the features...
music - http://www.subatomicglue.com
I think the confusion here is that you are stating that there are quirks in the ABI. ABI = Application Binary Interface. Two completely different binary implementations can have the same binary interface. Implementations usually have the quirks, not the interface itself, whether it's binary (ABI) or a programmer-friendly format (API).
...Direct3D is different. It is a separate 3D graphics API whose specification is controlled by Microsoft. As such, Microsoft can make the requirement that any graphics HW, consumer or workstation, that wishes to be WHQL (Windows Hardware Quality Lab) certified for Windows, must pass the WHQL testing and certification suite which tests for compliance with the Direct3D specification. This assures that if a graphics driver passes WHQL certification, there is a certain level of compliance and reliability associated with the graphics driver, both for 2D (e.g. GDI, GDI+) and 3D (meaning Direct3D but _not_ OpenGL).
Specifically, regarding your question about working around developments in the gaming industry ... Autodesk is working very closely with Microsoft to incorporate support for CAD features and capabilities into Direct3D. We are working very closely with Microsoft to make sure that CAD usage is tested as part of WHQL testing and certification of Direct3D graphics drivers. This will apply to _all_ graphics HW on the Windows platform, meaning high end "workstation" graphics HW, consumer graphics HW, and low-cost graphics chipsets that come on-the-motherboard.
I would like to take a slight digression just to give a bit of a historical perspective on the issue of 3D graphics HW. I have been around long enough to have worked with 3D graphics HW _before_ OpenGL existed. In that earlier time period, I worked with over seven different 3D graphics APIs. When SGI succeeded in imposing OpenGL as "the" 3D graphics API on the entire industry, this was not viewed as a "wonderful event" by everyone in the SW industry. The HW industry loved it, and they have been rather successful in ignoring any innovation or suggestions for 3D graphics development from the SW community during the entire time OpenGL has existed. Autodesk has attempted to work with the OpenGL HW community to enhance 3D graphics but has been met with a very deaf ear by the OpenGL HW community, similar to the experiences of many other SW vendors. Perhaps one exception to this situation has been the willingness of some OpenGL HW vendors to "adjust" their OpenGL implementations so some 3D games using OpenGL will run better ... but there has been little, if any, serious collaboration between graphics HW vendors and CAD SW vendors to incorporate features that seem reasonable from a SW perspective. Perhaps this is one reason why there are over _350_ documented OpenGL "extensions" that expose various "features" available on various generations of graphics HW from various HW vendors.
Microsoft has had a long and interesting history with Direct3D and they have had some evolving to go through to reach the point where they are now with Direct3D 9 on WinXP (and Win2K) and Direct3D 10 on Windows Vista. However, the _most_ important aspect from a SW development (and computer user) perspective is that Microsoft has been willing to listen and incorporate suggestions from the SW community. The resulting Direct3D specifications (as well as SW development tools) that have come from Microsoft are at least a generation or more advanced beyond the rather obtuse, cryptic OpenGL specifications and stone age development environments that the graphics HW vendors push at SW developers to use with OpenGL.
The bottom line is that competition is good and the fact that we have Direct3D as a professionally developed 3D standard instead of being forced to use OpenGL is very healthy. Without Direct3D, we are completely at the mercy of the graphics HW vendors in terms of what they believe the industry needs. For example, I continue to be amazed at how we as computer users seem willing to "accept" a blue screen crash or an application crash-to-the-desktop caused by an
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. 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 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. 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. 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.
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. 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.
Suck it, dweeb.
Didn't opengl die with quake2? lol