OpenGL Programming Guide 143
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.
Microsoft (Score:1, Informative)
Re:Microsoft (Score:1, Offtopic)
Re:Microsoft (Score:1)
It's, only being discussed, but still, a worthy comment. Whether this has any weight to it or not, it's on-topic (ish).
Re:Microsoft (Score:1)
see http://en.wikipedia.org/wiki/Opengl [wikipedia.org] and scroll down to the section entitled "Future in Microsoft Windows".
It includes excerpts from some meetings at the recent Siggraph... it doesnt look good for OpenGL under Vista?
Re:Microsoft (Score:1, Insightful)
Re:Microsoft (Score:5, Informative)
Re:Microsoft (Score:2)
Re:Microsoft (Score:3, Insightful)
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.
Re:Microsoft (Score:2)
Re:Microsoft (Score:3, Informative)
Re:Microsoft (Score:2)
Re:Microsoft (Score:2)
Re:Microsoft (Score:2)
Detecting a difference between 30fps and 60fps is pretty easy for basically any gamer, detecting a difference between 60fps and 100fps already gets a bit more difficult, but is still doable for many people. So up until you have at the very least 60fps, better 100fps, constantly in all situations I wouldn't call the framerate irrelevant, sure, a game gets playable much earlier, but that wasn't the point. Everything above 100fps gets rath
Re:Microsoft (Score:2)
For computer generated graphics, without -motion blur-, ~72 fps is what you should aim for.
Why 72 fps?
Google it up on the net. (Wikipedia doesn't seem to be quite so good on this)
It's all down to how fast signals from the screen, hits your eyes, signals from eyes reach your brain and your brain interprets the signals as an image. Anyt
Re:Microsoft (Score:2)
The ~30 fps is the minimum below which you will start seeing individual frames. It doesn't mean that 30 is the best, if you look at the source with a corner of your eye, up to 70-75Hz you will still see the flickering. One can tell the difference between a 60Hz refresh rate on a monitor and 85Hz. Also if you stare at a Also, as you say, the motion blur will be there at 30 fps but that depends also on the fluorescence of the materials used. The same 30 fps on CRT will look different than 30 fps
Re:Microsoft (Score:2)
not quite, (Score:2)
the bit that confuses me sometimes is that I don't recall ever seeing a monitor with better than a 120Hz frame rate... the one I'm working with now only goes as far as 90. is this not a barrier?
Re:not quite, (Score:2)
Re:not quite, (Score:2)
(film is projected with a double shutter rate to appear at 48 to reduce flicker, but this of course does nothing for the motion.)
but the fact remains that your eye does not see in fps, it sees in continuous time. just that the response rate of the average cone is rathe
Re:not quite, (Score:2, Interesting)
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 (o
Re:Microsoft (Score:1)
Note that "frame rate" is different than "flicker rate". Even though movies are filmed at 24 fps,
Re:Microsoft (Score:2)
Re:Microsoft (Score:2)
Re:Microsoft (Score:1)
Re:Microsoft (Score:2, Informative)
Re:Microsoft (Score:2)
Is it even technically possible and/or has anyone considered constructing wrappers so that DirectX API may overlay an OpenGL implementation?
Or should we abandon DirectX and OpenGL for this Cg I hear about?
Re:Microsoft (Score:2)
If you do an application with Cg you will most likely use OpenGL or D3D for the rest of the engine.
Making DirectX faster isn't the issue (Score:1)
Re:Making DirectX faster isn't the issue (Score:3, Informative)
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 [wikipedia.org] for details (scroll to "Future in Microsoft Windows").
If true, it sure sounds like they are hobbling Opengl
Re:Making DirectX faster isn't the issue (Score:1)
Re:Making DirectX faster isn't the issue (Score:2)
Andy
Re:Microsoft (Score:2)
I'd like to defend Microsoft on this one. (Score:1)
Complaining about this is like complaining about how 32-bit x86 operating systems rendered DOS4GW use
What about this site? (Score:5, Interesting)
Re:What about this site? (Score:5, Informative)
Re:What about this site? (Score:2)
Also, I'm not a cheap bastard. The book's good, so I paid for it.
Re:What about this site? (Score:3, Informative)
Sorry about the rant.
To answer your actual question, you *do* need a relatively modern API reference, if you're studying from the 1.1 spec ( I learned off the 1.2 spec ). But the thing is, OpenGL is very well backwards compatible, so code written for the first edition will work fine on a modern OpenGL 2 driver.
Still, but it: It's a good book. I went from *zero* opengl experience to My mediocre game [zakariya.net] in 1.5 years, with a robotics simulator in the interim.
Re:What about this site? (Score:1)
I would be curious to know how the newer edition stands up to the old edition. OpenGL programming is very math ("maths" for the UK) intensive (canonical view volumes, vectors, etc). Of course, game mechanics are complicated enough.
If you are trying to learn OpenGL, Neon Helium [gamedev.net] is more useful (I have an older edition of the red book).
NeHe not so great (Score:1, Informative)
For one thing, the sample code is pretty crappily written, sadly outdated, and makes use of obsolete stuff like glaux.
For another, the maintainer has moved on...Gamedev.net is (kinda) maintaining the site now, and not much is happening in the way of new tutorials.
Try before you buy... (Score:5, Informative)
http://fly.cc.fer.hr/~unreal/theredbook/ [cc.fer.hr]
This is an older version, but still a very good grounding in the basics of interactive 3d graphics.
Re:Try before you buy... (Score:1)
Re:Try before you buy... (Score:4, Informative)
http://opengl.org/documentation/red_book_1.0/ [opengl.org]
Don't know if the fifth is online yet.
Re:Try before you buy... (Score:3, Informative)
The Red Book is not the Blue Book (Score:5, Informative)
http://www.opengl.org/documentation/blue_book_1.0
Re:The Red Book is not the Blue Book (Score:1)
Really How. (Score:1)
Real men wouldn't achieve the same result. (Score:1)
I compile the program with:
cl hello.c
Morpheus says... (Score:1)
Re:And the green book is this! (Score:2)
Figures (Score:3, Funny)
Re:Figures (Score:2)
Free version (Score:5, Informative)
Did I miss something (Score:2)
Re:Did I miss something (Score:2)
Re:Did I miss something (Score:1)
games (Score:3, Funny)
Re:games (Score:2)
Re:games (Score:1)
Re:games (Score:2)
Re:games (Score:2)
That's not the red book! (Score:5, Funny)
Also, hacking looks a lot like a bad screensaver. There's never any text editing or commandlines involved.
Re:That's not the red book! (Score:5, Informative)
Re:That's not the red book! (Score:3, Funny)
Re:That's not the red book! (Score:1)
Re:That's not the red book! (Score:2)
Save Some 1.57%! (Score:1, Informative)
Re:Save Some 1.57%! (Score:1)
You would think... (Score:2, Insightful)
You would think, wouldn't you, that it would contain explanations of every feature of OpenGL? After all, if it's not in the book, should it be in the language?
Re:You would think... (Score:2)
Re:You would think... (Score:2)
Re:You would think... (Score:1)
Strictly speaking though it is an API that includes a GLSlang language.
Hard cover? (Score:3)
Re:Hard cover? (Score:2)
The real "Red Book" (Score:1)
Covers & Colors (Score:5, Informative)
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.
Re:Covers & Colors (Score:2)
Re:Covers & Colors (Score:2)
Too Bad OpenGL Is Getting Crippled (Score:1, Troll)
Re:Too Bad OpenGL Is Getting Crippled (Score:5, Informative)
Re:Too Bad OpenGL Is Getting Crippled (Score:1)
Re:Too Bad OpenGL Is Getting Crippled (Score:2)
For example, there is no way to change resolutions or switch to windowed/fullscreen without losing the entire context. It's a well known limitation of WGL. Of course, Direct3D has no such problem...
Also, out-of-the-box video drivers never include OpenGL support, and basically everyone but nVidia and ATI ships worthless OpenGL support with their drivers anyway.
Re:Too Bad OpenGL Is Getting Crippled (Score:2)
Who would do such a thing???
Personally, I blame the Department of Redundancy Department.
Re:Too Bad OpenGL Is Getting Crippled (Score:2)
By the time Vista is in full swing (2010?), no one will care about OpenGL performance on Windows, because they already switched to Linux and/or OS X Intel, both of which happen to have great OpenGL support.
Re:Too Bad OpenGL Is Getting Crippled (Score:2)
What the heck? (Score:2)
I know - bad joke, but I just HAD to say it. The little elves in my head whisper evil things.
The "Red Book" huh ? (Score:1)
Or is that Aussies used car prices
stop calling it the Red Book. (Score:1)
http://www.cs.wisc.edu/~ghost/doc/book s.htm
I did the cover for the Red Book (Score:3, Interesting)
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
Red Book == Postscript (Score:3, Insightful)
What gives?
Re:Red Book == Postscript (Score:2)
New Red Book is Disappointing (Score:1)
I had such high expectations of the next Red Book. I was hoping for a more modern approach to OpenGL. What a shame.
I'll wait for the next edition of the orange book
Dragon Book (Score:1)
Re:Dragon Book (Score:1)
Re:Dragon Book (Score:1)
PHREAK (to Cereal): D'you bring those Crayola books?
CEREAL: Oh yeah, technicolor rainbow.
Cereal brings a book out of his bag.
CEREAL: Green one.
JOEY: What is that, what is that? Lemmie see. What are these?
DADE: International Unix Environments.
Cereal pulls out another book.
CEREAL: Luscious orange?
Cereal hands the orange book to Phreak.
DADE: Computer security criteria, DOD standards.
Another book comes out.
DADE: The Pink Shirt Book, Guide to IBM PCs. So called due to the nasty pink
I thought the Red Book... (Score:2)
Have they stopped the false advertising? (Score:2)
As you may guess, I was (and still am) quite pissed off by this false advertising, in the newsgroup an author said it was a mistake, a pretty big mistake if you ask me! Have they fixed this "mistake"?
Re:RIght on time (Score:2, Funny)
Re:RIght on time (Score:2)
'Little' and 'Brown' were the names of the authors of the first edition.
Re:Obsolete? (Score:1)
Re:Slightly Offtopic (Score:1)