OpenGL Programming Guide 6th Ed. 86
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.
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).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. |
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.
Re:I'd wait! (Score:4, Interesting)
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.
Re:Comparison to DirectX (Score:5, Interesting)
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
Re:Comparison to DirectX (Score:2, Interesting)
Or any other language you want. I've used it from Python, and it's great. It's portable, fast enough for me (though I'm not writing Doom3 here), close enough to the C API that I can use any C reference, but still Pythonic enough that it's pleasant to work with. Plus, if you can put something (or everything) into a display list, it *really* flies.
It's trivial to wrap a state machine. It took me about 2 minutes to wrap glBegin/glEnd with a Python 2.5 context manager, so I never have to write glBegin/glEnd again, and my code is indented to show the structure of my graphics. Very nice.
I guess if you're writing games at iD (or to compete with them), C is the way to go. For the rest of us, a higher-level language is much less painful. If my boss wants a new visualization of some data in 3D, I can whip it up really quick in Python, and he won't care that it's only N fps instead of 2N fps, as long as N > 50. Or if he decides he really wants it faster, I can probably port it to C without much trouble.
From what I've seen, Direct3D is not simpler than OpenGL with a HLL.
Plenty of FUD there.... (Score:2, Interesting)
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.