OpenGL Programming Guide
Martin Ecker writes "The Red Book, also known as the OpenGL Programming Guide, is back in its fifth edition. It received the name Red Book because of the nice red book cover, and possibly also because it has remained the standard introductory text on the OpenGL graphics API for years, and always referring to it as "OpenGL Programming Guide" is too long. This fifth edition now also covers new features introduced with versions 1.5 and 2.0 of the OpenGL standard. So let me take you on a tour through the pages of this book to see what it has to offer." Ecker's review continues below.
OpenGL Programming Guide (5th Ed.) - The Official Guide to Learning OpenGL, Version 2
author
Dave Shreiner, Mason Woo, Jackie Neider, Tom Davis
pages
838
publisher
Addison-Wesley Publishing
rating
8
reviewer
Martin Ecker
ISBN
0321335732
summary
A very complete and thorough introduction to OpenGL
I should mention that the last edition I read of the Red Book was the first edition, and a lot of material has been added to the book in the meantime. Just as the first edition, however, the fifth edition is still 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 new occlusion queries added to OpenGL recently? 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 only thing the book does not cover in detail is vertex and fragment shaders because they have their own book, 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 who 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 800 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. The authors also discuss here the basics of using colors, fixed-function lighting, framebuffer blending, and fog.
Chapter seven contains a description of display lists, a unique feature of OpenGL that allows to store OpenGL API calls for efficient multiple use later on in a program. Chapter eight then moves on to discuss what an image is for OpenGL, which brings us straight to chapter nine on texture mapping, one of the largest chapters in the book. This chapter discusses everything you need to know on textures, from specifying texture images in uncompressed and compressed form to applying textures to primitives using the various kinds of supported texture filters. Also depth textures and their application as shadow maps 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.
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 - newly added in the fifth addition -- is a short introduction to the OpenGL Shading Language (GLSL, for short). Even though the OpenGL API functions required to use GLSL are presented, this is only a quick 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, which is a bit odd considering that the Red Book actually doesn't really concentrate on programmable shaders or GLSL. It's a good reference nevertheless.
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.
The Red Book remains the definitive guide to learning OpenGL. Whenever someone asks me "What book should I read first to learn OpenGL?" this is the book I refer them to. 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 this book in its entirety you pretty much know everything there is to know about OpenGL.
Martin Ecker has been involved in real-time graphics programming for more than 9 years and works as a games developer for casual arcade games. In his rare spare time he works on a graphics-related open source project called XEngine. You can purchase OpenGL Programming Guide (5th Ed.) - The Official Guide to Learning OpenGL, Version 2 from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
I should mention that the last edition I read of the Red Book was the first edition, and a lot of material has been added to the book in the meantime. Just as the first edition, however, the fifth edition is still 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 new occlusion queries added to OpenGL recently? 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 only thing the book does not cover in detail is vertex and fragment shaders because they have their own book, 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 who 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 800 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. The authors also discuss here the basics of using colors, fixed-function lighting, framebuffer blending, and fog.
Chapter seven contains a description of display lists, a unique feature of OpenGL that allows to store OpenGL API calls for efficient multiple use later on in a program. Chapter eight then moves on to discuss what an image is for OpenGL, which brings us straight to chapter nine on texture mapping, one of the largest chapters in the book. This chapter discusses everything you need to know on textures, from specifying texture images in uncompressed and compressed form to applying textures to primitives using the various kinds of supported texture filters. Also depth textures and their application as shadow maps 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.
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 - newly added in the fifth addition -- is a short introduction to the OpenGL Shading Language (GLSL, for short). Even though the OpenGL API functions required to use GLSL are presented, this is only a quick 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, which is a bit odd considering that the Red Book actually doesn't really concentrate on programmable shaders or GLSL. It's a good reference nevertheless.
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.
The Red Book remains the definitive guide to learning OpenGL. Whenever someone asks me "What book should I read first to learn OpenGL?" this is the book I refer them to. 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 this book in its entirety you pretty much know everything there is to know about OpenGL.
Martin Ecker has been involved in real-time graphics programming for more than 9 years and works as a games developer for casual arcade games. In his rare spare time he works on a graphics-related open source project called XEngine. You can purchase OpenGL Programming Guide (5th Ed.) - The Official Guide to Learning OpenGL, Version 2 from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
How does this new version compare to this site: The red book?? Is it worth the money to buy it if you are a true beginner with a decent C background, but little prior work with 3D graphics? Or would it be fair to say that the online book would suffice and that a API reference for changes and updates would allow you to do simple rendering?
When all else fails, try.
Book is available online here (and a few other places/formats, try google):
http://fly.cc.fer.hr/~unreal/theredbook/
This is an older version, but still a very good grounding in the basics of interactive 3d graphics.
I'm glad its NOT referred to as the "'Little' Red Book". That would just not be acceptable.
The reason they call it the red book is to distinguish it from the blue book, which is the OpenGL reference manual.
/
http://www.opengl.org/documentation/blue_book_1.0
Damn it! I just bought the 4th edition two days ago on Amazon.
You can get this book in PDF or HTML for free from here. Obviously it's as up to date as this edition but probably good enough for most beginners.
Maybe the people who complain about the lack of quality games should put the book to use.
I've seen "Hackers"! They use the Red Book to hack the Gibson.
Also, hacking looks a lot like a bad screensaver. There's never any text editing or commandlines involved.
Is this book available in hard cover?
The thing about these OpenGL books that makes them different from all the others on the market is that they are DEFINITIVE. They are put out by the OpenGL Architecture Review Board - who are the very people who design and update the API. If the books don't agree with the implementation - it's the implementation that's wrong!
The full set are as follows:
Red Book - Programming guide - chatty description which still has all of the arguments of all of the functions described within it. You *need* this book...expect to buy a new one every couple of years as the API evolves. Keep one copy at work and the last generation one at home...maybe keep the one before that in your car!
Blue Book - Reference Manual - quite literally a set of 'man' pages printed out and bound together in a book. Useful if you like to read books instead of screens.
Green Book - GLUT. Covers the GL Utility Toolkit. This is really rather unnecessary.
Alpha Book - OpenGL programming for Windows. (It actually has a white cover...but since we had the RGB books, we needed Alpha to complete the set!)
Orange Book - OpenGL shader language (GLSL). If you want to program at the cutting edge of realtime graphics, you'll be using shaders. It's written in a style broadly similar to the way the Red Book is written and is very readable.
Finally, there is the OpenGL specification document. This has (AFAIK) never been put into print (which is a great shame - I'd buy it) - you can download it from www.opengl.org and it contains VERY detailed documentation of every function that goes far beyond any of the printed manuals - but which presumes you already know OpenGL pretty well. However, if you need to know the mathematical description of how OpenGL implementations are supposed to calculate the level of detail of your texture map...this is where you'll find that.
Whilst all the other books are handy to have around, the RedBook is utterly essential to OpenGL programmers (even those of us who've been using it for the whole eleven years of it's life will find themselves referring to it often enough to warrant owning a copy). The nice thing about it is that it's very readable. You can open it at page 1 knowing nothing - and read through to the end and wind up having learned all of OpenGL - or you can pretend it's a set of man pages and use the (excellent) index to find a simple description of every function and it's arguments that's *NEARLY* as good as the Blue Book.
Microsoft's OGL wrapper for DirectX does add a lot of overhead, but it doesn't matter - hardly anyone uses that. Normally under Windows you use the OpenGL implementation that comes from the graphics chipset manufacturer. NVIDIA, ATI, 3DLabs, etc. all have their own, which can be very fast without any sort of DirectX involvement. These are generally much more up to data than MS OGL anyway.
"Leave the strategizing to those of us with planet-sized brains." -Tycho
A gamer craves not these things.
Seriously, not only are games full-screen most of the time, but I would much rather have my graphics card working on my framerate than transparent jiggly menus.
I quit!
It's great that you jump on the freak out bandwagon. MS has tried to kill OpenGL before and they will try again. It's not going to be that big of a deal. OpenGL is used way more then DirectX for everything non-games (yes, there is a world out there that doesn't involve games). Here's a clue for everyone who is freaking out about this and doesn't mind having an open mind and learning a thing or two in the process.
I had originally wanted to make a Lego dinosaur, but the people in charge at SGI had thought that perhaps that was a message that they didn't want to put out there.
Anyway, if you're wondering, the idea of the globe is that you can make the whole world out of little tiny pieces -- which seems like OpenGL to me. OpenGL is a great library, beautifully orthogonal, simple, and consistent, just the right thing for building 3D applications.
And, btw, I think that the Google logo looks a whole lot like the OpenGL on the table in the book cover, but...hey, whatever.
Thad Beier
I love Mondays. On a Monday, anything is possible.
What they are doing is layering the opengl icd on top of directx, freezing it at 1.4, disallowing extensions, and NOT providing info to 3rd parties to implement their own icd driver... Net result it will be 50% slower. See http://en.wikipedia.org/wiki/Opengl for details (scroll to "Future in Microsoft Windows").
If true, it sure sounds like they are hobbling Opengl
My googling for jargon revealed that the Red Book is really a Postscript manual.
What gives?
https://www.accountkiller.com/removal-requested
False. Additional frames pass too quickly to be perceived as individual images, but they still add to the perception of smooth motion.
you pick a graphics mode, which may be provided by MS (software) or by the hardware manufacturer (accelerated).
According to the text from OpenGL.org, most OGL applications (which use ICD) will indead run through the DirectX layer. If MS is making hardware manufacturers go through DirectX, then I think this will be a big problem. If you are at all concerned with this issue, then I suggest you read up on the history of OpenGL on Windows.
If you can read this sig, you're too close.
You get a "composite" frame, as in the first third is current frame-2, the second third is current frame-1, and the final third is current frame. It's called "tearing" and looks ugly. The solution, of course, is vertical syncing (only flipping during the vertical retrace), but vsync has issues if you're running just above, at, or below the monitor's framerate. (If your render time is too long and you're missing the sync by a millisecond, you must wait until the next sync before flipping, which means that you're running at monitor rate/2. Without sync, it will be closer to the actual update rate.)
To see tearing in action, watch vertical lines in animations/games as they move across the screen. With proper synconization, the line should always be vertical. If vsync is disabled, you'll see visible breaks in the vertical line.
The ideal world would be one in which the update/render time is never longer than say half a frame, and vsync can be used without penalty always. However, there will always be variable render times in the real world as the number of objects and compexity of the geometry is highly variable.
N.B. Tearing will occur even if the animation/update rate is less than the monitor's frequency.