Wednesday, January 5, 2011

GPU Gems 2 : Programming Techniques for High-Performance Graphics and General-Purpose Computation (Gpu Gems)



GPU Gems 2 : Programming Techniques for High-Performance Graphics and General-Purpose Computation (Gpu Gems)
| 2005-03-03 00:00:00 | | 0 | Game Programming




User review
Excellent book
Written simply and clearly, I found it really interesting to read. Tho sometimes I'd wish more maths here,,.

User review
Outstanding reference
The first half (28 chapters) of this book address the needs of the graphics programming master, or master-to-be. This goes way past the basics of GPU programming and language, and dives directly into solutions of demanding problems. This includes techniques for adding complexity to a visual environment at modest cost, real-time modeling of grass in the wind, softened shadows, and dozens of other aids for efficient and believable rendering. Some techniques address non-photorealistic techniqes as well. Together, they add a big handful of new tools to the toolbox of even advanced GPU developers. (Beginners: I'm sorry, but this isn't for you. Some day, just not today.)


I have to admit, though, my interest lies largely in the last 20 chapters. In this section, authors from university and industry research teams describe `GPGPU` - general processing on GPUs. This puts the incredible computing power of the GPU to use on tasks from linear algebra and differential equations to finance, computer vision, fluid flow, and medical imaging, instead of rendering viewable pictures. GPGPU promises huge performance increases over standard CPUs, but imposes huge barriers to realizing that promise. GPUs achieve their high performance by tailoring their physical architecture to a specific class of computations. That class is large, granted, but still covers only a tiny portion of today's compute-intensive tasks - and if your computation doesn't match the GPU model, you're just out of luck. These chapters offer tips'n'tricks for overcoming the architectural barrier, for rethinking applications in terms that GPUs can handle effectively.


GPGPU has been around for only a few years, largely as isolated acts of individual cleverness. No organized body of knowledge and practice exists for explointing this computational resource, and none seems likely to exist for some years to come. Every body of knowledge goes through that stage, `button collecting` of scattered, unrelated facts, the necessary elements from which larger patterns will some day be drawn. This collection, even if hit-or-miss for any one reader's needs, does its part to collect today's techniques and to disseminate that knowledge. Maybe some day, GPGPU will be as common and systematic as C programming is today - until then, anthologies like this are what we have, and this is a good one.


-- wiredweird

User review
A comprehensive resource - but not for the novice
Truly Matt Pharr and NVIDIA are at the top of their game, and his `GPU Gems` series is certainly the only one of its kind for graphics professionals that are familiar with GPU's and shading languages already, and want to exploit them for the maximum speed and effect achievable using today's technology. It is not a `how-to` book on shading or GPUs or even advanced graphics. There are equations and code interspersed throughout the book, with bits of wisdom that are very instructive for the initiated. However, if you are a home-grown graphics programmer who knows C, or C++, or Java, and even some assembly language, plus you are familiar with image processing and computer graphics techniques, that will probably not be enough to get you through this book. I would say that this is a five star book for high-level professional graphics programmers who work with GPU specifics and shaders daily, and I would say it is a two or three star book for everyone else.

The one section of the book that is pretty accessible to anyone with knowledge of computer architecture and computer graphics would be section 4 of the book, which is about general purpose computation on GPU's themselves. That section has a series of articles that comprise an excellent tutorial on GPU's, what they are, and what they can do. It is the best material in print I have seen on the subject.

If you want a good introduction into the concept of writing shaders plus practice with an actual shading language, try `OpenGL Shading Language, 2nd Edition` by Rost, assuming you already know OpenGL. For a great on-line resource for modeling and graphics that will get you going in the right direction of knowing what the authors of these articles know, type `Elias Hugo` into Google and check out the first address shown. There is a wealth of on-line articles, complete with math and pseudocode, available there. Then, maybe, you will be ready to sift some knowledge from this `GPU Gems` series.

I notice that the table of contents is not shown by Amazon, so I list the articles here:

PART 1:GEOMETRIC COMPLEXITY

Towards Photorealism in Virtual Botany

Terrain Rendering using GPU-Based Geometry Clipmaps

Inside Geometry Instancing

Segment Buffering

Optimizing Resource Management with Multi-Streaming

Hardware Occlusion Queries Made Useful

Adaptive Tessellation of Subdivision Surfaces with Displacement Mapping

Per-Pixel Displacement Mapping with Distance Functions

PART 2:SHADING, LIGHTING, AND SHADOWS

Deferred Shading in STALKER

Real-Time Computation of Dynamic Irradiance Environment Maps

Approximate Bidirectional Texture Functions

Tile-Based Texture Mapping

Implementing the Mental Images Phenomena Renderer on the GPU

Dynamic Ambient Occlusion and Indirect Lighting

Blueprint Rendering and `Sketchy Drawings`

Accurate Atmospheric Scattering

Efficient Soft-Edged Shadows Using Pixel Shader Branching

Using Vertex Texture Displacement for Realistic Water Rendering

Generic Refraction Simulation

PART 3:HIGH-QUALITY RENDERING

Fast Third-Order Texture Filtering

High Quality Antialiased Rasterization

Fast Prefiltered Lines

Hair Animation and Rendering in the Nalu Demo

Using Lookup Tables to Accelerate Color Transformations

GPU Image Processing in Apple's Motion

Implementing Improved Perlin Noise

Advanced High-Quality Filtering

Mipmap Level Measurement

PART 4:GENERAL PURPOSE COMPUTATION ON GPUS: A PRIMER

Streaming Architectures and Technology Trends

The GeForce 6 Series GPU Architecture

Mapping Computational Concepts to GPUs

GPU Computation Strategies and Tips

Implementing Efficient Parallel Data Structures on GPUs

Flow Control Idioms

GPU Program Optimization

Stream Reduction Operations for GPGPU Applications

PART 5:IMAGE-ORIENTED COMPUTING

Octree Textures on the GPU

High-Quality Global Illumination Rendering Using Rasterization

Global Illumination using Progressive Refinement Radiosity

Computer Vision on the GPU

Deferred Filtering: Rendering from Difficult Data Formats

Conservative Rasterization

PART 6:SIMULATION AND NUMERICAL ALGORITHMS

GPU Computing for Protein Structure Prediction

A GPU Framework for Solving Systems of Linear Equations

Options Pricing on the GPU

Improved GPU Sorting

Flow Simulation with Complex Boundaries

Medical Image Reconstruction with the FFT




User review
Excellent Second Book in the GPU Gems Series
This book is the second installment of the GPU Gems book series by NVIDIA. Just like the first book, GPU Gems 2 is a collection of articles by various authors from game development companies, academia, and tool developers on advanced techniques for programming graphics processing units (or GPUs for short). It is aimed at intermediate to advanced graphics developers that are familiar with the most common graphics APIs. The reader should also be proficient in C++. As with the first GPU Gems book, GPU Gems 2 is not for beginners. For professional graphics and game developers, however, it is an excellent collection of interesting techniques, tips, and tricks.


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 (also called GPGPU). In particular, the last 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, and another chapter focuses on using occlusion queries to implement coherent hierarchical occlusion culling.

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.


Part two of the book consisting of 11 chapters deals with shading and lighting. This part contains highly interesting chapters on deferred shading in the game S.T.A.L.K.E.R., and computing irradiance environment maps on the GPU in real-time. 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. Finally, a GPU-only implementation of improved Perlin Noise is also presented in this part of the book.


The chapters in the fourth part of the book represent an introduction to the fantastic field of GPGPU. The 8 chapters of this part first describe the general streaming architecture of GPUs, 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

The 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.


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.


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.

User review
Pretty pictures
This book is targeted at people who have a good solid grasp of either OpenGL or D3D as well as a grounding in programming languages such as C/C++ or Java. While this much is obvious, the book is still painfully difficult to get anything useful out of.

The problem amounts to the fact that there is no cohesion between chapters - each one is written by a different author (and clearly they have not read each other's material) - there is no reference or introduction but worst of all, no common terms.

Example; What D3D calls a `pixel shader`, OpenGL call `fragment shader`, but there are also `vertex shader`, `vertex program`, `pixel program` and `fragment program`,,. some of these are the same thing while others are wildly different, but I found at least 4 references in this book to what I could only make sense of by substituting another term (the correct one). Each author has written their part from their own view point using their own terms.

The code snippets contained rarely have any comments or even descriptions of how they work.

Overall I generally felt like I was either reading someone's thesis or a marketing spiel about a particular aspect of some game.

There are many pretty pictures though.


Download this book!

Free Ebooks Download