Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Books

Submission + - Book Review: OpenGL SuperBible (Fifth Edition)

asgard4 writes: Statistics
Title: OpenGL SuperBible (Fifth Edition)
Author: Richard S. Wright, Jr., Nicholas Haemel, Graham Sellers, Benjamin Lipchak
Pages: 969
Rating: 9/10
Publisher: Addison-Wesley Publishing http://www.awl.com/
ISBN-10: 0-32-171261-7
ISBN-13: 978-0-32-171261-5
Price: $59.99 US
Book Website: http://www.opengl.org/superbible, www.informit.com/title/9780321712615
Summary: Quite possibly the best introduction to OpenGL 3.3 programming that focuses exclusively on graphics programming using shaders.

The OpenGL SuperBible (www.informit.com/title/9780321712615) in its fifth edition is almost a complete rewrite. The authors threw out the discussion of old-style, fixed-function programming and replaced it with an introduction to OpenGL that is exclusively focused on using shaders from the very beginning. All the things that got deprecated with the advent of OpenGL 3 got removed, making it a more relevant and up-to-date book than the previous editions. The OpenGL SuperBible still strives to be the "world's best introduction to OpenGL" according to the authors. Let's see if it can keep that promise.

With the removal of the fixed-function pipeline, the OpenGL SuperBible is no longer quite the heavy-weight it used to be. It shrunk from more than 1200 to about 970 pages, which is not necessarily a bad thing. The book starts out with a basic introduction to 3D graphics, coordinate systems, and some basic math concepts, followed by short rundown of the history of OpenGL and a first little example program that renders a triangle. The authors even provide instructions on how to setup the C/C++ projects to build the example on Windows and MacOS. The writing is to the point but still verbose enough to easily follow the text. The authors analyze the example program in detail making it easy for a beginner to follow and understand the code. Overall, I really like the writing style and the flow of the book.

The next few chapters gradually introduce more and more OpenGL API functionality intermixed with new 3D graphics concepts, such as rendering points, lines, and polygons in various ways, alpha blending, how to use geometric transformations and projections, and how to move objects and the camera. Eventually, basic texture mapping is introduced with most of the basic things you need to know about the topic. In particular, specifying textures coordinates, sampling textures in the fragment shader, the various filtering modes (even anisotropic filtering), and texture compression are discussed. In a later chapter the authors do another deep dive into the topic of textures, in particular rectangle textures, cube maps, multitexturing, point sprites, and using texture arrays

Until this point the authors used haven't really talked much about shader programming yet. Most of the examples use simple pre-made shaders that don't really do much. This changes with chapter six titled "Nonstock Shaders" where we get a first glimpse of how to write our own shaders in GLSL, the OpenGL Shading Language. In particular, a fragment shader that uses a simple lighting model to light objects is developed.

After these introductory chapters presenting the basics of OpenGL programming, the next part of the book focuses on more advanced topics, beginning with buffer objects and how to use them to make your OpenGL programs run much more efficiently on modern hardware. Some of the examples presented in this part of the book include using render-to-texture to do reflections, tone mapping, and bloom. This part of the book closes with two fairly long chapters on advanced usage of the shader pipeline, in particular the transform feedback and the geometry shader stages. There is also some discussion on more advanced effects achievable with fragment shaders, in particular applying filters to images, such as a Gaussian blur or a Sobel filter. Finally, rendering geometry efficiently with vertex buffer objects and rendering many objects via geometry instancing is presented.

The final part of the book consists of 4 chapters explaining how to integrate OpenGL with the underlying operating system, in particular with Windows, Mac OS X, and Linux plus various other Unix flavors. The last chapter of this part of the book is about OpenGL ES, which is a version of OpenGL designed to be used especially on embedded system devices, in particular mobile phones and PDAs, to render real-time, interactive 3D graphics.

The book has a lot of images and diagrams throughout, though unfortunately not all of them are in color. There are however 24 color plates of the most interesting images in the middle of the book. The complete source code of the book, and even precompiled binaries for Windows and Mac OS X, can be downloaded from the book’s webpage http://www.opengl.org/superbible.

If you are new to both 3D graphics programming and OpenGL with a bit of C/C++ programming experience and you are eager to learn how to develop interactive programs with OpenGL, then this book is exactly right for you. The book is written in an easy to understand style without skimming the details (or even more advanced topics). It is the most comprehensive introduction to OpenGL that doesn’t require a lot of previous knowledge I have seen to date. The decision to completely drop any discussion of the fixed-function pipeline turned out to be an excellent choice. Finally there is a book that no longer wastes the reader's time with the parts of OpenGL that nobody who does serious graphics development uses and instead presents up-to-date information on how to do 3D graphics on modern graphics hardware.

All in all, the OpenGL SuperBible in its fifth edition succeeds very well in keeping its promise to be the best introduction to OpenGL and 3D graphics programming. Even after you’re done working your way through the main parts of the book you will always come back to the handy OpenGL API reference in the appendix of the book.

About the review author:
The author has been involved in real-time graphics programming for more than 10 years and works as a professional game developer for High Moon Studios http://www.highmoonstudios.com/ in sunny California.
Books

Submission + - Book Review: The Design of Design

asgard4 writes: Statistics
Title: The Design of Design. Essays from a Computer Scientist
Authors: Frederic P. Brooks, Jr.
Pages: 432
Rating: 8/10
Publisher: Pearson Education
ISBN-10: 0201362988
ISBN-13: 9780201362985
Summary: Inspiring new book by Fred Brooks.

Coming up with sound, elegant, and easy to implement designs is not a
trivial matter, as Fred Brooks, author of the classic book "The
Mythical Man-Month", acknowledges in his latest book "The Design of
Design". In many disciplines — especially in software development -
the design process and how to produce good designs is relatively
poorly understood. Teaching the design process to students is even
more difficult. In the form of opinionated essays, Brooks attempts to
summarize what we know about the design process, how it has changed
over time, and how we can produce better and more elegant designs.
Brooks has decades of experience designing large systems and is well
known for his involvement in the design of IBM's OS/360.
Even though Brooks is a computer scientist, the book applies equally
well to many other disciplines outside of software development that
have a formal design process, such as architecture. A lot of his
examples come from other engineering disciplines and architecture. But
of course he presents the obligatory OS/360 case study as well.

The book is divided into six parts, the first three of which I
consider the most relevant and most interesting. In part one, Brooks
starts out with a discussion of models for the design process. In
particular, he presents his take on how the traditional Rational Model
(or the Waterfall Model — its offspring that is better known to
computer scientists) is not sufficient to achieve greatness in design
because it has a too simplistic and idealistic view of the design
process. Brooks then proceeds to discuss better, more iterative models
for designing, for example, Boehm's Spiral Model used in software
development, which much of the newer so-called agile methodologies are
based on. He argues that it is important to have a clear, concise
model that can be accompanied by an easy to understand graphical
representation, such as a diagram, in order to be able to teach the
design process to novice designers.

Part two of the book is about collaboration and team design. On large
projects there will usually be multiple designers that are forced to
work together to produce a single, coherent design. The major
stumbling block in team design is achieving conceptual integrity.
Brooks suggests that the most important way of achieving this is by
empowering a single software architect that has a high-level overview
and can make the final call on different, competing design
alternatives. I totally agree with this from my own experience of
working on large projects where multiple people held design
responsibilities. In this part of the book, the author also has a
timely chapter on telecollaboration and on the impact of modern
technologies, such as videoconferencing via the internet, on team
design.

Part three, titled Design Principles, contains various essays on
budgeting, constraints, and user involvement in the design process.
There is also some interesting material on what Brooks calls exemplars
in design, i.e. the reuse of previous designs as a whole or in part in
creating new designs. My favorite chapter in this section of the book
is the one on good style. I find that a good design doesn't just need
to be coherent and functional, it also needs to be elegant. Brooks's
definition of design style is quite good in my opinion: "Style is a
set of different repeated microdecisions, each made the same way
whenever it arises, even though the context may be different". Well put.

Part four of the book, in which the author outlines his dream software
system for designing houses, is the by far weakest part of the book
for me. The presented "design" of the dream system is simply a list of
high-level features without going into any detail, which is pretty
pointless in my opinion. Part five gets more interesting again with
two essays on great designers and how to foster an environment at a
company to make designers great. In particular, I like the idea of
having designers "eat their own dog food", i.e. forcing them to use
the end products of their designs out in the wild (maybe in form of a
sabbatical at one of the system's customers). The book concludes with
seven chapters on various case studies. While these are certainly
interesting, they don't contain any additional essential thoughts on
the design process that weren't already presented in the previous
parts of the book.

"The Design of Design" is an excellent book from one of the pioneers
in computer science. Brooks's writing style is as elegant and
enjoyable as ever. While he dates himself in some of his examples, the
overarching ideas of the book are timeless and important. Not many
books have been written about the design of the design process itself
and this book is a valuable addition. It is mostly aimed at designers
and people that have spent some time reflecting on the design process
itself. The casual reader and people that are more concerned with
implementing designs rather than creating the designs themselves might
find it somewhat intangible. However, even designers in disciplines
other than computer science or software development can gain a lot
from the insights in this book.
Graphics

Submission + - Book Review OpenGL Programming Guide (7th Edition)

Martin Ecker writes: Statistics
Title: OpenGL Programming Guide (Seventh Edition) – The Official Guide to Learning OpenGL, Versions 3.0 and 3.1
Authors: Dave Shreiner, The Khronos OpenGL ARB Working Group
Pages: 883
Rating: 8/10
Publisher: Addison-Wesley Professional http://www.informit.com/opengl
ISBN-10: 0-321-55262-8
ISBN-13: 978-0-321-55262-4
Price: $59.99 US
Summary: The Red Book remains the authoritative guide to OpenGL.

The Red Book, also known as the OpenGL Programming Guide published by Addison-Wesley Professional, returns in its seventh edition, now covering OpenGL up to and including version 3.1. The Red Book, so called because of its deep red cover, is the most-well known, authoritative introduction to the OpenGL graphics API. In this review I want to take you on a whirlwind tour through the pages of this book to see what it has to offer.

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. Just as the previous edition of the book, the seventh edition is incredibly comprehensive and thorough. It contains explanations of pretty much every feature OpenGL has to offer, even the more obscure and rarely used ones. This is good in the sense that it's a fairly complete book, but it can also be somewhat overwhelming for a beginner when confronted with a book that weighs in at almost 900 pages. However, the good news is that the material is presented in a logical progression and even a novice will get up to speed with the basics of OpenGL after reading only the first few chapters of the book. Some of the early chapters in the book contain a few more advanced sections mostly explaining new features that got introduced with OpenGL 3.1. These sections are conveniently marked as advanced and can probably be skipped on a first read-through of the material.

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, lighting, framebuffer blending, and fog are discussed.

Chapter seven contains a description of display lists, a unique and with OpenGL 3.1 deprecated 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, and most notably covers pixel buffer objects, a somewhat recent addition to OpenGL. The discussion of images in chapter eight brings us straight to chapter nine on texture mapping, one of the largest and arguably most important chapters in the book. Everything you need to know about textures is discussed, 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 seventh edition – floating-point textures and texture arrays added in OpenGL 3.0 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. 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.

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 seventh edition this chapter has been updated to version 1.30 and 1.40 of GLSL, as required by OpenGL 3.0 and 3.1, respectively. 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 book "OpenGL Shading Language. Third Edition" also called 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.

With OpenGL 3.1 deprecating many older API features of OpenGL in favor of more modern alternatives, the seventh edition of the Red Book seems to have a bit of a split personality at times. If you're only interested in functionality not deprecated in 3.1 you can skip entire chapters, such as the chapter on display lists or fixed-function lighting. Of course, the knowledge of matrix stacks and how to use transformations is still relevant, but the corresponding OpenGL functions have been deprecated in favor of doing all the transformation math in the vertex shader or, what most people have been doing anyway, using your own matrix structures/classes on the CPU. The situation is similar for many of the other deprecated features (such as fixed-function lighting, color index mode, immediate mode, ...) that are still described in the book. I think the time is right to combine the Red Book with the Orange Book, removing any discussion of deprecated features, to have a book that focuses solely on the modern approach to graphics programming, which is mostly based on shaders. I can only hope such an OpenGL 3.1-only focused book will see the light of day soon.

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.

About the review author:
The author has been involved in real-time graphics programming for more than 10 years and works as a professional game developer for High Moon Studios http://www.highmoonstudios.com/ in sunny California.
Graphics

Submission + - Book Review: OpenGL Shading Language (3rd Edition)

Martin Ecker writes: Statistics
Title: OpenGL Shading Language (Third Edition)
Author: Randi J. Rost, Bill Licea-Kane
Pages: 743
Rating: 9/10
Publisher: Addison-Wesley Professional http://www.informit.com/opengl
ISBN-10: 0-321-63763-1
ISBN-13: 978-0-321-63763-5
Price: $59.99 US
Book Website: http://www.3dshaders.com/
Summary: A solid introduction to developing shaders in the OpenGL Shading Language GLSL.

The “OpenGL Shading Language” (also called the Orange Book because of its orange cover) is back in its meanwhile third edition with updated discussions of the OpenGL shading language up to version 1.40 introduced with OpenGL 3.1. Like the previous edition, the third edition of the book is one of the best introductions to GLSL — the OpenGL Shading Language — that not only teaches the ins and outs of GLSL itself but also explains in-depth how to develop shaders in GLSL for lighting, shadows, animation, and other topics relevant to real-time computer graphics.

Not unexpectedly the book starts out with a brief review of OpenGL basics. However, I would not recommend diving into this book without having prior experience with OpenGL, or at least with some other kind of 3D API, such as Direct3D. The book targets an audience that is already familiar with computer graphics and with OpenGL. Furthermore, knowledge of the C programming language is expected.

The next few chapters introduce the syntax and semantics of GLSL. At its core, GLSL is very similar to C. All the usual control flow statements, such as if statements and for loops, are available. However, the language adds some graphics-specific types, such as vectors and matrices. Even though this material is fairly dry, the writing is easy to follow and all concepts are presented with plenty of examples. Also uniform blocks — a new feature of GLSL version 1.40 — are discussed. Uniform blocks are used to efficiently send a block of variables via a uniform buffer to the GPU.

After familiarizing the reader with the language itself, chapter four delves into the integration of the shader-programmable units into the OpenGL pipeline, in particular the vertex and fragment shader units. Note that geometry shaders are not discussed in this book since they are a fairly recent addition to the OpenGL 3.2 specification.
The next chapter goes over all the built-in, common functions that GLSL provides, such as sin, cos, abs, fract, and so on. Being more of a visual learner, what I really like about this chapter that the authors provide function graphs for each of the functions introduced.
After all the basics of the shading language have been laid out in previous chapters, chapter six is dedicated to a full-fledged example that uses GLSL to procedurally render a brick pattern. If you're already familiar with other shading languages, such as Direct3D's HLSL or Cg, and you want to switch over to OpenGL/GLSL, I recommend jumping straight to this chapter to see how much you can grasp and then going back to the preceding pages to fill in the blanks if necessary.

The somewhat lengthy chapter seven contains detailed descriptions of the entry points provided by OpenGL to create and set up shader programs. Among other things, it describes how shader objects are created, compiled, and then linked to form shader programs that can then be used to render objects. Chapter seven concludes the dry, technical part of the book that introduced both the shading language and the necessary infrastructure to use it from a host program running on the CPU. The remainder of the book concentrates on numerous graphics techniques that can be achieved with shaders, such as bump mapping, lighting, shadows, animation, procedural effects, and many more. In short, it's the real fun part of the book where all the theory gets put into practice.

One of the highlights for me is the chapter on writing lighting shaders that discusses hemi-sphere lighting, image-based lighting using environment maps as light probes, and spherical harmonics lighting. The chapter on lighting is concluded by a discussion of the ÜberLight shader, a shader for a very versatile lighting model initially presented as RenderMan shader by Pixar Animation Studios.
Where there's no light there's shadow and so the book has an interesting chapter on various shadowing techniques, in particular ambient occlusion, shadow maps, and an interesting technique for rendering shadow volumes using deferred shading. The latter technique can be used to render soft shadows convincingly.

The most interesting chapter for me in the book is the one on surface characteristics. It discusses and develops shaders to render surface materials that exhibit complex light interaction. The authors start out with a discussion of refraction and present shaders to achieve the classic Fresnel reflection/refraction and chromatic aberration effects. Then diffraction, i.e. light bending around sharp edges, is discussed and a shader that renders a vinyl record realistically is developed. Finally, the chapter focuses on BRDF-based lighting and develops various material shaders using the BRDF model, a quite important topic nowadays since more and more video games now actually use BRDF-based lighting models.

Another important chapter in the book in my opinion is chapter seventeen about antialiased procedural textures. I consider it important because it is often ignored that shaders that procedurally create textures usually suffer from aliasing artifacts. This chapter shows a number of anti-aliasing techniques to diminish these issues. Chapter eighteen is a fun chapter on non-photorealistic rendering, discussing hatching, Gooch shading, and how to render the Mandelbrot set in a shader. Finally, the book closes with a comparison of GLSL with other shading languages, in particular RenderMan, HLSL, and Cg. This is mostly of interest to real geeks and language lawyers ;)

As in the previous edition, all images and diagrams in the book are in black and white, except for a few pages that contain 34 color plates in the middle of the book. Most of the images are not overly "flashy" but do give a practical idea of the types of rendered images a particular shader can produce.

The book’s accompanying website at http://www.3dshaders.com/ offers the source code to all the shaders presented in the book for download. Also available are other shaders not mentioned in the book and a demo application including source code, which nicely demonstrates the shaders in action. Most of the shaders are available under a very liberal BSD-style open source license.

The third edition of "OpenGL Shading Language" is an excellent introduction to shader programming with GLSL. It provides an in-depth and comprehensive discussion of the shading language itself as well as the C shader API used to create and manage shaders in the host program. The best and largest part of the book focuses on developing shaders for various applications, such as lighting, shadows, animation, and other areas of real-time computer graphics. If you’re interested in learning GLSL and shader programming in OpenGL, this is the book to get.

About the review author:
The author has been involved in real-time graphics programming for more than 10 years and works as a professional game developer for High Moon Studios http://www.highmoonstudios.com/ in sunny California.

Slashdot Top Deals

All seems condemned in the long run to approximate a state akin to Gaussian noise. -- James Martin

Working...