OpenGL brings an added dimension to your graphics by utilizing the remarkable power of modern GPUs. This straight-talking cookbook is perfect for intermediate C++ programmers who want to exploit the full potential of OpenGL Overview In Detail OpenGL is the leading cross-language, multi-platform API used by masses of modern games and applications in a vast array of different sectors. Developing graphics with OpenGL lets you harness the increasing power of GPUs and really take your visuals to the next level. OpenGL Development Cookbook is your guide to graphical programming techniques to implement 3D mesh formats and skeletal animation to learn and understand OpenGL. OpenGL Development Cookbook introduces you to the modern OpenGL. Beginning with vertex-based deformations, common mesh formats, and skeletal animation with GPU skinning, and going on to demonstrate different shader stages in the graphics pipeline. OpenGL Development Cookbook focuses on providing you with practical examples on complex topics, such as variance shadow mapping, GPU-based paths, and ray tracing. By the end you will be familiar with the latest advanced GPU-based volume rendering techniques. What you will learn from this book Approach This hands-on Cookbook cuts through the preamble and gets straight to the point. OpenGL Development Cookbook is perfect for intermediate C++ programmers. Full of practical techniques for implementing amazing computer graphics and visualizations, using OpenGL. Crammed full of useful recipes, OpenGL Development Cookbook will help you exploit OpenGL to its full potential. Who this book is written for OpenGL Development Cookbook is geared toward intermediate OpenGL programmers to take you to the next level and create amazing OpenGL graphics in your applications.
I had great expectations when I first opened this book. In fact, I feel there is a big void right in the middle of published books about OpenGL.
At one side of the void there are either technical references or introductory texts, which explain the reader how to properly use the library but don't show practical applications: at the end of those books people know how to texture lookup from a vertex shader, not how to render realistic terrain from a height map.
At the other side there are collections of articles about very advanced rendering techniques, intended for people already well versed in graphics programming and hardly of any use for the everyday developer (think about the ShaderX or the GPU Pro series).
The premise of this book is to be the gap filler, which tells you about all the cool things you can do with OpenGL (in addition to rendering teapots) in a wide range of topics, while remaining practical enough for the average OpenGL developer.
While it's a good shot in that direction, it doesn't live up to this ambitious premise.
Let's start with what's good: recipes cover a vast range of applications, including mirrors, object picking, particle systems, GPU physics simulations, ray tracing, volume rendering and more.
OpenGL version of choice is 3.3 core profile, so all the recipes are implemented using modern OpenGL while still being compatible with most GPU hardware out there. Every recipe comes with a self-contained and working code example that you can run and tweak. All examples share coding style and conventions, which is great added value.
The toolchain of choice is Visual Studio for Windows, but the examples also build unmodified on Linux installations. Despite Mac OS X only supporting up to OpenGL 3.2, examples not requiring 3.3 features will build there as well with minor modifications (just be sure to use included GLUT.framework rather than freeglut, as the latter relies on XQuartz which isn't able to request an OpenGL 3 context).
Then, there's something that just doesn't work well. First, the formatting of code excerpts is terrible: long lines wrap twice or thrice with no leading spaces, so without highlighting it's nigh impossible to read the code right at first glance. Given that a good 30% of this book is code, this is really something that should be addressed in a second edition.
A somewhat deeper problem is about how recipes are presented. Most of them dive directly in a step-by-step sequence of code snippets, taking little time to explain the required background and the overall idea behind the implementation. On a related note, the book states that knowledge of OpenGL is just a "definite plus" to get through it, but after the very first recipe spends a total of three lines explaining what Vertex Array Objects are, before jumping into code that uses them, it becomes clear that being proficient with OpenGL is a requirement to appreciate the book.
The quality of the recipes varies a lot through the book: the best written and most interesting ones are from chapters 6, 7 and 8, which comes as no surprise as the author's research interests include the topics they cover. I would have exchanged many of the previous recipes, some of which are variations on the same theme, to be about techniques that both fit the recipe format and are relevant for any up-to-date rendering engine (depth of field, fur, caustics, etc...). On a related note, I think that perhaps the single biggest flaw of the book is that it's written by a single author, but to offer 50 great recipes a cookbook needs several ones, each master in her own trade and each offering the best of her knowledge.
In the end: if you're already well versed in OpenGL, have interest in the specific topics best covered by the author, and you're going to read each recipe at the computer to comfortably read code, OpenGL Development Cookbook has something to offer. While not the gapfiller I was initially looking for, the learning opportunity from having a code example for each recipe is remarkable.
OpenGL Development Cookbook What I like The structure of the book makes it pretty easy to follow. In the beginning, it is good to read the introduction and familiarize with the application framework. After that, a reader can read in whatever order he/she likes. Each of the items is written in a similar way. Topics are of course done by a single person, so there is no need to switch between writing styles.
Vast majority of items are very well done and explained. I liked chapter about Order Independent Transparency in particular. You have there very good explanation, pictures, code (with additional comments) and a comparison of techniques at the end.
Another great item relates to Volume rendering (3D Textures, ray casting, splatting). Before reading the chapter I thought that such topic is quite hard to implement. Now, it looks simpler and clearer. There is a detailed discussion about final quality of the output. More the slices (or texture samples) the better the result, but performance drops.
Technology chosen is, in my opinion, very suitable. We have Visual C++ 2010, freeGLUT, Glm and SOIL.Those additional libraries are small and very simple to understand (not to mention their popularity). There is no additional need to learn some complicated framework/engine.
What I dislike
The level of topics is sometimes strange. We have a nice and easy item that describes basic lighting, or item about simple particle systems. Next to it we have advanced elements like OOIT using dual depth peeling or even more like Ray Tracing. I would prefer to have items that are more or less at the same level. Or at least change the "distance" between extremes.
Some more description would be nice. I know that it is hard to compress all that knowledge in only 300 pages. But for some topics the author could make a bit more effort. For instance when dealing with geometry shaders and subdivision of a quad just a little diagram/image could explain more. This could make the book more complete.
To sum up: The book is definitely worth reading for any developer who has already managed to render a triangle in OpenGL and wants to go further.