GPU Gems 2
The book is divided into six parts, each dealing with a different aspect of GPU programming. Compared to the first book, more emphasis is put on the quickly evolving area of general-purpose computation on GPUs, an area that is commonly known as GPGPU (General Purpose GPU; for more information see http://www.gpgpu.org). To my knowledge, this is the first book to contain so much information related to this relatively new field. In particular, three of the six parts of the book are about GPGPU and its applications. The first three parts, however, are about real-time computer graphics.
The first part of the book contains 8 chapters on photo-realistic rendering that mostly deal with how to efficiently render a large number of objects in a scene, which is a necessity for rendering convincing natural effects, such as grass or trees. Two chapters in this part of the book discuss geometry instancing and segment buffering, two techniques to render a large number of instances of the same object, and another chapter focuses on using occlusion queries to implement coherent hierarchical occlusion culling, which is also useful in scenes with high depth complexity.
Other interesting topics in this part of the book include adaptive tessellation of surfaces on the GPU, displacement mapping - an extension to the popular parallax mapping used in some current games - that allows to render realistic bumps on a simple quad, and terrain rendering with geometry clipmaps. Geometry clipmaps can be used to render large terrains almost completely on the GPU. They were first introduced in a SIGGRAPH 2004 paper by Frank Losasso and Hugue Hoppe, and the algorithm is discussed in detail by Arul Asivatham and Hoppe himself in chapter two of this book. This technique will most likely find wide application in next generation games.
Part two of the book consisting of 11 chapters deals with shading and lighting. I found chapter 9 by Oles Shishkovtsov on deferred shading in the soon-to-be-released computer game S.T.A.L.K.E.R. quite interesting. The game features a full deferred shading renderer, which is probably a first for a commercial game. In his chapter Oles describes some of the tricks used and some of the pitfalls encountered while developing that renderer. Also highly interesting is Gary King's chapter on computing irradiance environment maps in real-time on the GPU. These dynamically created irradiance maps can be used to approximate global illumination in dynamic scenes.
Furthermore, this part of the book has chapters on rendering atmospheric scattering, implementing bidirectional texture functions on the GPU, dynamic ambient occlusion culling, water rendering, and using shadow mapping with percentage-closer filtering to achieve soft shadows.
The third part of the book consists of 9 chapters on high-quality rendering. Most chapters in this part deal with implementing high-quality filtering in fragment shaders. For example, there is an interesting chapter on filtered line rendering and another chapter on cubic texture filtering. In chapter 23 NVIDIA also provides interesting insights into the inner workings of their Nalu demo, which was the release demo for the GeForce 6 series that displays an animated mermaid underwater. In particular, the chapter describes the techniques used to implement the mermaid's hair. Finally, Simon Green of NVIDIA presents his GPU-only implementation of improved Perlin Noise.
Whereas the first three parts of the book cover techniques for real-time computer graphics, the three final parts deal exclusively with GPGPU. Since GPUs nowadays offer a high level of programmability and because of their wide-spread use in commodity PCs, GPUs can be used as a cost-efficient processor for general computation in addition and parallel to the CPU.
Efficient usage of the GPU for general computation, so that conventional CPU implementations can be outperformed, requires special care when mapping algorithms to the highly parallel architecture of the GPU pipeline. Part four of the book mostly deals with exactly this and represents an introduction to the fantastic field of GPGPU. The 8 chapters of this part first describe the general streaming architecture of GPUs, with one chapter going into the details of the architecture of the GeForce 6 series in particular, and then move on to show how to map conventional CPU data structures and algorithms to the GPU. For example, textures can be regarded as the GPU equivalent to CPU data arrays. There is also a chapter on how to implement flow-control idioms on the GPU and a chapter on optimizing GPU programs.
The 6 chapters of part five of the book are on image-oriented computing and describe a number of GPGPU algorithms for performing global illumination computations, for example by using radiosity, on the GPU. There is also a chapter on doing computer vision on the GPU, which I found to be quite exciting. Because of its high parallelism, the GPU can be used to do the tedious tasks of edge detection and marker recognition required in computer vision in a very efficient manner, thus elevating the CPU to do other tasks in the meantime. James Fung, the author of this chapter, is also involved in an open source project called OpenVIDIA (see http://openvidia.sourceforge.net) that is all about GPU-accelerated computer vision. he final chapter in this part of the book explains how to perform conservative rasterization, which is important for some GPGPU algorithms to achieve accurate results.
The final part of the book has 6 chapters that present GPGPU techniques to perform a variety of simulation and numerical algorithms on the GPU. One chapter shows how to map linear algebra operations onto the GPU and develops a GPU framework to solve systems of linear equations. In other chapters the GPU is used for protein structure prediction, options pricing, flow simulation, and medical image reconstruction. These chapters show good examples of how the GPU can be used for non-graphics-related tasks. Furthermore, Peter Kipfer and Rüdiger Westermann present algorithms for efficient sorting on the GPU. Since sorting is such an important building block of many higher-level algorithms, it is important to have an efficient implementation for GPGPU algorithms.
The book contains many illustrations and diagrams that visualize the results of certain techniques or explain the presented algorithms in more detail. All images in the book are in color, which is definitely advantageous for a graphics book. In my opinion, the excellent quality and also the quantity of images and illustrations is one of the strongest points of this book compared to other graphics books.
The book also comes with a CD-ROM with supplemental material, videos, and demo applications to some chapters. Most of the applications include the full source code, which makes it easy to experiment with the techniques presented in the book. Note that most of the applications run on Windows only and many of them require a shader model 3.0 graphics card, such as a GeForce 6600 or 6800. The latest ATI cards, such as the X800, are not sufficient for running some demos because they only support shader model 2.0.
I highly recommend this book to any professional working as graphics or game developer. It is a valuable addition to my library of graphics books and I will come back to a number of articles in the near future. The focus on GPGPU in the second half of the book is a welcome addition and we can expect to see more and more non-graphics-related applications make use of the processing power in today's GPUs.
Martin Ecker has been involved in real-time graphics programming for more than 10 years and works as a game developer for arcade games. In his rare spare time he works on a graphics-related open source project called XEngine http://xengine.sourceforge.net.You can purchase GPU Gems 2 - Programming Techniques for High-Performance Graphics and General-Purpose Computation from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Bring back glide!
I probably will get this book to read up on the general purpose parallel processing. Hook up a cluster of hacked X-Boxes, use the CPUs and GPUs together = Massively Parallel Processing.
One of the uses for the GPU that looks promising is audio processing. There was an article about one company developing VSTs that use the GPU. It will be interesting to see how people will utilize their graphics cards in the future.
It wants the last four stories back.
Does it come with a dictionary?
I mean really, even the review contained so many domain specific terms it was hard to follow. Still, I can't imagine this as being a requirement for game programmers. Certainly many games utilize the features within on PC's, but the majority of the games today aren't made for PC's. And the majority of programmers on a game dev team don't deal with the game's renderer.
Sure, it might be good to have, and much of the parellel processing practices will translate to consoles, but required?
You position your left foot behind you, put your right foot out, raise the toes of your right foot, move your left foot to where you want your right foot to glide, then close the distance between your left and right feet by only gliding the right foot. There you have it. You are now gliding. A friend of mine haunts that wicked "stileproject" website and showed me this video from a jungle about a bird that can moon-walk for its mating display. Moon-walking aside, Michael Jackson stole from cattle-hands their moonwalking. And whenever Michael yells "Ewww", and "Ohhhh", that is also stolen; us cattlehands say "Ewww" alot because we step knee-deep in alot of shit; and we yell "Ewww" alot too when we walk into the "wrong" bar thinking it was actually women we had seen primarily. This clears up alot of topics, in one post about gliding. Stay tuned for car transmissions: the PowerGlide.
without prejudice
fixed
Go to http://books.slashdot.org/article.pl?sid=04/06/01/ 1120217
for the review of the earlier book.
Ok. What resolution should I set my monitor so that I can actually feel the guts splatter on my face in these first person shooters?
The first commercial game that I know of to use a full deferred shading engine was Shrek for the Xbox, which was released in Fall 2001.
I also worked on an unannounced PC game in 2003 that had a fully deferred shading (lighting) renderer. Alas, that title was cancelled.
Deferred Shading on the PC is not very practical on pre-shader model 2.0 hardware, though possible I'm sure. The Xbox allows direct access to the register combiners, exposing more than 2x the fragment processing power than DX8 / Shader 1-1.3 on the PC.
The book seems like a must-have. One question though: to which extent does it apply to other manufacturer's GPUs too? I'm not entirely comfortable with it being written by one specific manufacturer if I'm looking for information applicable to all/most potential users.
see a Text Widget
"Deferred Shading on the PC is not very practical on pre-shader model 2.0 hardware, though possible I'm sure. The Xbox allows direct access to the register combiners, exposing more than 2x the fragment processing power than DX8 / Shader 1-1.3 on the PC."
This is good, but how much of the GPU's power can't be used because of bus limitiations?
One of the most interesting aspects of GPU programming that I've been playing with recently is Quartz Composer released as part of MacOS X 10.4's dev tools (included on the install DVD.)
I maging/Conceptual/QuartzComposer/qc_intro/chapter_ 1_section_1.html I maging/Conceptual/CoreImaging/ci_plugins/chapter_4 _section_3.html
It's a visual programming environment that lets you hook together "patches" that create, control, and present audio and video. You can include GL-slang kernels as well. Also, since MacOS X 10.4's Core Image will recompile GL shader language into Altivec code if the GPU isn't up to the task, it adds a lot of flexibility as to when you're okay using the shader language. You can synchronize audio effects with real-time video effects, and hook up iSights, still images, MIDI sound, audio input, mix them all together on the CPU and GPU, and present some stunning effects. I'm certainly going to be checking this book out to see if it helps with this sort of endeavor.
I don't want to Slashdot anyone's site, since most people working on it are just publishing their creations on personal blogs, but a few google searches can turn up some really fantastic visual effects people have created in the couple weeks it's been out.
Here is Apple's intro to the subject:
http://developer.apple.com/documentation/Graphics
and, specifically,
http://developer.apple.com/documentation/Graphics
E pluribus unum
The very last chapter "Medical Image Reconstruction with the FFT" was really the only one that had caught my eye -- anyone out there know of any projects involving processing loads of FFT's on a GPU such as in image restoration? Just curious...
and now back to the fallout shelter...
Are there any wikis out there that contain these sorts of GPU tricks?
But what's especially cool is the chapter is available for free download on the GPU Gems 2 site.
I wonder if Open Graphics Project can gain from this book?
Every line of text on the main page is in italics now.
It seems to me that the kind of linear algebra needed for LAME encoding is similar to the operations that GPUs provide in very cheap MFLOPS. The raw performance of a pair of $100 videocards vastly exceeds that of the $200 CPU that's busy running the kernel. Is there any software out there that lets me plug videocards into my server, and run dozens or hundreds of LAME encoders on them?
--
make install -not war
For obvious reasons, the GPU will be best at doing linear algerbra related problems quickly. I am curious, however, whether anyone has tried numerical integration (I've gone through several sites before without seeing mention of this). While the GPU may not be the best suited for this, it seems like it might be possible to still offload some work done by the CPU with the GPU, and potentially speed up simulations.
If anyone has any information on this, I would be very interested to hear (or perhaps other hardware solutions for solving ODEs quickly)
I guess we are stalled with a minor improvement with the Pentium 3, and step backward per clockrate with the Pentium 4 and limited availability of compilers that know how to optimize for it. With the pending multi cores per chip, I might play around with balancing DSP tasks between processors and threads, but I don't think I am going to muck around with some proprietary GPU or DSP -- life is too short and the "time to market" window is too narrow.
I'll give you another link, to The Cg Tutorial: The Definitive Guide to Programmable Real-Time Graphics, which can be seen as an introductory level book on graphics programming. I especially liked the chapter on bump mapping, where this concept is extremely well explained. A drawback is that it should only be considered an introduction. It sounds like the gpu gems book goes more in-depth.
Please login to access my lawn
If this book is anything like the first installment it will be mostly an advertisement for nVidia hardware along with a repackaging of material that is already available from the internet - much of it indexed already on NVidia's site.
AFAIK the first book was aimed at people such as myself - an experienced 3D games programmer, nVidia was also advertising it at their conferences hard to the delegates. Unfortunatley I felt completley let down by the content - much of it was rehashed, very little effort into platform independance was given (many of the samples and techniques only work on NVidia hardware although equally good generic techniques exist).
Of course ATI effectivley do the same, sponsoring books that contain techniques exclusivley for their hardware.
It's a shame because this series could have been a fantastic resource and IMHO there would be a market for a vendor ambivalent equivalent.
Hmm.