70 internautes sur 75 ont trouvé ce commentaire utile
- Publié sur Amazon.com
For years, books in the OpenGL SuperBible series were recommended for anyone looking for an excellent tutorial and thorough coverage of OpenGL features. But up to OpenGL 2.0, programming in OpenGL was done through the fixed function pipeline, and the OpenGL SuperBible books were the best place to start learning that. With GLSL introduced in OpenGL 2.0, OpenGL supported both the traditional fixed function pipeline and a new programmable pipeline where you can write your own shader programs and have much more control over the graphic card. OpenGL 2.0 tried to have the best of both worlds: if you liked the old OpenGL then you can use it, and if you wanted to experiment with modern OpenGL you can use that as well. That resulted in a huge API with conflicting design goals. This conflict can be seen in the OpenGL(R) SuperBible: Comprehensive Tutorial and Reference (4th Edition), reflecting the version of OpenGL it covered. The tutorial part focused exclusively on fixed-function OpenGL. That part was excellent and I still use it as a reference when I'm programming for old mobile devices that supported only OpenGL ES 1.0. The book also introduced shaders among other advanced topics in the second part. This introduction didn't really follow from what you learned in the tutorial part. It was a group of separate articles that were written in a different style and tone. I don't doubt you can easily pick it up and learn writing shaders from these chapters, but they didn't really go about teaching you how to write shaders, instead focusing more on showing you cool examples of stuff you can do with shaders. Given that a lot of what you do with shaders requires a mathematical background -- which the 4th edition got around by introducing only what's necessary, someone learning OpenGL without such a background would get confused when suddenly the later chapters are talking about cosines and other concepts.
Eventually, the OpenGL API evolved and the fixed function commands were all deprecated and later moved to a different profile. The new OpenGL was much leaner and only revolves about creating shaders and writing to buffers. The problem is that it's easy to teach the old OpenGL, you don't need to know the underlying details of how light is calculated or how transformations are performed to write a program in fixed function OpenGL. You can get away without teaching anything but basic mathematics, and you could still come up with strong examples. With modern OpenGL, things are different. There is no built in lighting equation, no matrix stack, no functions to rotate an object or set a camera. You have to write all of that yourself. A book teaching modern OpenGL, or the core profile of OpenGL 3.3, needs to teach you not only OpenGL, but also the fundamentals of 3D graphics. Such a book would be quite big, advanced for many users, and wouldn't be able to cover all the features of OpenGL. How can you create a simple and thorough book about modern OpenGL? If you can assume that the reader knows the fixed function pipeline, then it's easier to teach them the new features. But what if you can't assume that?
The authors of OpenGL SuperBible 5 found a way around, and it works quite well. The authors built a library that allows people to start writing impressive programs right away. They don't have to worry about setting up vertex buffer objects, writing shaders, or any of that. This way you can start teaching by giving practical examples, and you slowly teach OpenGL by introducing the concepts behind that library. Make no mistake, this book doesn't teach you to use that specific library, it teaches you OpenGL. Anything you do with the library you will learn to do yourself in OpenGL in later chapters. Shaders are introduced early and follow wonderfully from previous discussion. Many advanced features are covered in detail and you learn how to write shaders, and not just how to copy and paste example code. The result is fantastic; the tutorial part is by far the best introduction to modern OpenGL you'll find. You still don't need a mathematical background, and the 3D math chapter does a good job of introducing all the ingredients you will need to write programs.
The book is divided into 3 parts. The first part is an introduction and tutorial, the second part is about advanced topics such as buffers and dealing with geometry, and the final part is about platform specific issues including a coverage of OpenGL ES for mobile devices. The tutorial part is great and if the book constituted only of this part, it'd definitely be worth buying. The advanced topic coverage is really variable. Some topics are covered in great detail and with useful examples (I really liked the introduction to the geometry shader for example), other topics are introduced in a hurry and just throw examples at you without even explaining what the example is supposed to do or teach. I'm not sure if this is really a bad thing. You need to realize that some of these advanced topics are actually quite advanced, and the book doesn't assume much from the reader. Including them in the book is a benefit because once you've learned more from other sources or from your own experiments you can go back to these chapters and understand them better. None of these chapters is bad, they just don't follow from what you learned from the tutorial part. For example, the basic idea of multisampling is introduced early, which is good for an example where you just enable multisampling and see the result. Later chapters go into the fine details of how multisampling is implemented, based on the basic introduction. If you already understand multisampling then it'd all make sense, but if your only source is the book then it can be hard to follow. Another example is the chapter which introduces buffers, the sample program tries to 'look cool' where a simpler (and uglier) sample would have been more appropriate.
Speaking of the sample programs, the code is generally well written and properly commented. Going through the source code for the book library is a great way to learn. Most of the samples compiled fine on Linux (using the binary Nvidia driver), but some gave me black screens or wrong results. I also had to make some changes to the code to make certain samples work. A few samples don't even come with makefiles for Linux. I sent an email about it to the author and it'll hopefully get fixed eventually. The google code repository where the samples are hosted does get updated so I wouldn't worry much about that.
Summary: if you want to learn modern OpenGL (post 3.0), then get the book. Even if you already have the 4th edition and know a bit about shaders and buffers, you will still benefit from the book because it covers many more advanced topics and I'm sure there will be a thing or two you didn't know about. While I spent some time talking about perceived problems like complex advanced chapters or few samples that don't work, I assure you that it's not as bad as I make it sound. I just thought it was fair to note these minor issues in case there was a 6th edition for OpenGL 5.0! I was worried about two things when I considered getting the 5th edition: (1) I already have the 4th edition so is this an incremental update or something completely new? And (2) if the book uses a library to hide some of the advanced features then does it spend a lot of time on that as opposed to teaching real OpenGL? The answer to the first question is that it's a completely new book that is exclusively about OpenGL 3.3. The answer to the second question is, like I said earlier, that the book library is there for a purpose, which is ultimately teaching you how to do things with nothing but OpenGL. I apologize for writing so much, I never wrote a book review before. :)
Shorter summary: buy the book!
6 internautes sur 6 ont trouvé ce commentaire utile
- Publié sur Amazon.com
This book is very informative and thorough in its coverage. Before reading this book I knew some 3d math, and a rough idea of some 3D rendering topics, but had no experience with any graphics APIs. After having just completed this book, I can definitely say I have a clear idea of how openGL pipeline works, as well as various techniques for creating different effects, and for improving performance. Overall I am quite happy with this book.
However this book is not without its flaws. There are a few major ones that jump out straight away:
1) The examples use a custom library written by the author called GLTools, which encapsulates most of the math, and geometry submission. I can see the motivation behind this, as it lets you quickly dive into running the examples without the 'boilerplate hump'. However the primary problem with GLTools is that is a major dependency of the entire book, and while it doesn't do anything too complex, much of it is not explained until the vey end of the book (and some of it is not explained at all). At least the source for GLTools is available. This was annoying for me because I wanted to start a mini-project after learning the basics to "cement" my knowledge before continuing with the advanced sections. However I needed to rely on GLTools, because it was intrinsic to the examples (geometry submission - which is not covered until chapter 12, the last chapter), and although the examples were running, I felt like I still didnt really know everything that was happening until I reached the end of the book. If you are new to OpenGL, you cant break off halfway through the book to make a simple app (without depending on GLTools), you must see it through to the end.
2) The book was written by 4 authors, and you can tell; If read cover-to-cover you get a few surprises with keywords or jargon that were never introduced earlier, but are talked about as if they were. This can be quite jarring. The first few chapters flow quite well, but it starts feeling a bit 'glued together' or rushed towards the end - especially chapters 11 (Advanced Shader Usage) & 12 (Advanced Geometry Management). The perfect example of this is in Chapter 11, there is a "Spring Mass System" physical simulation example (probably the coolest example in the book), which uses concepts that are only properly introduced in chapter 12 (Vertex Buffer Objects, Vertex Array Objects, Transform Feedback). Also, there was no source code on the website or svn for this example, even though the book mentions to just 'look at the source code'.
3) Math is touched on very breifly and avoided if possible. If I didn't have prior knowledge of vector and matrix math, I would have found this very frustrating.
4) Extending point 2, it feels like the book was ordered the wrong way around. I would have preferred to have been introduced to buffer management much earlier, and then have the various examples of different techniques and effects later on. It also seems like some of the examples and topics in the book have not been topologically sorted - they have been sorted for the ease of the writer to keep everything in one place, rather than the ease of the reader (i.e. taking into account what they have learnt so far), especially towards the end.
5) Pages 700-937 are just an OpenGL function reference. I cant see myself using this very often, as it would be much faster and more convenient to just look it up on the web/electronically. I would have preferred they instead spent these pages on getting deeper into each topic and covering some of the math. The reference section just feels like a waste of paper.
6) Some of the examples in the book have typos, or incorrect code, or code that doesnt match with the website's code (which mostly runs fine). Any other errors are fixed in the svn repo code. The code quality wasn't very high, and many iterative examples had old comments and redundant code from previous iterations/examples. However it was still clear what the code was doing. On windows, there are precompiled executables provided for the early chapters but not the later ones - a small but noteworthy ommission. As mentioned before there was an example entirely missing (Spring Mass System). I tried contacting the author but have not got any replies back. There are also some examples included in the code (e.g. normal mapping) that are not mentioned in the book (however quite easy to understand as an adaptation of similar examples).
7) There are some conceptual errors in some examples. For example, in the specular shading example, the shader does not take the view vector into account (even though it is explained in the book), and instead just uses the normal vector (i.e. just diffuse lighting with a higher luminosity 'peak' added to it at the same position). This 'mistake' is then carried through many of the examples that build off it. The reason why this may have passed unnoticed is that the light position is fixed. However when you animate the light position, it is obviously wrong (compared to a fixed version which uses the view vector). Mistakes like this made me lose some confidence in the examples.
Having said all of this, I still recommend this book:
1) It is the most up to date OpenGL book. In many ways it is one of the only options if you want to learn openGL 3.3+
2) It provides some very good examples, and does a good job at explaining concepts - what it does explain, it explains clearly and uses some good analogies.
3) It covers a lot of ground and explores performance options and tradeoffs.
This book is very much 'core' - it uses glut for the examples, but has an additional 4 chapters at the end for native platform-specific deployment (Windows, Mac, Linux, OpenGL ES / Mobile). There is no coverage of user input (all examples use glut, and keys to switch modes, simple navigation using arrow keys). There isnt any discussion of application architecture, data structures, models, content creation pipelines, tools, debuggers, etc. It is just focused purely on using OpenGL, and spends very little time discussing the other components or 'scaffolding' required in creating a real-world 3D app.
If you are new to OpenGL you will definitely have learned a lot after finishing this book.