GPU Gems

GPU Gems is now available, right here, online. You can purchase a beautifully printed version of this book, and others in the series, at a 30% discount courtesy of InformIT and Addison-Wesley.

The CD content, including demos and content, is available on the web and for download.

Part I: Natural Effects

Special effects have differentiated real-time applications throughout the history of consumer-level graphics accelerators, and more important, they have helped immerse users into the virtual settings envisioned by designers. In games and in visualization applications, special effects greatly enhance the user's experience, portraying environments from the surreal to the photorealistic. Good special effects convince users to suspend their disbelief and become absorbed in the story or setting. This part of the book collects numerous practical techniques for creating natural effects that have traditionally been difficult to render properly and robustly.

Water animation and lighting are some of the most difficult tasks in computer graphics, and two chapters are dedicated to water rendering. Chapter 1, "Effective Water Simulation from Physical Models" by Mark Finch of Cyan Worlds—creators of classic games such as Myst—explores animating and lighting water surfaces and provides useful tricks for improving reflections. In Chapter 2, "Rendering Water Caustics," Daniel Sánchez-Crespo and I show how to incorporate convincing caustics using a similar basis for water animation.

In Chapter 3, "Skin in the 'Dawn' Demo," Curtis Beeson and Kevin Bjorke detail the shading techniques used for the fairy in the "Dawn" demo, which was written for the launch of the NVIDIA GeForce FX 5800 GPU. The chapter provides valuable insights into the development process—especially the critical shading decisions influenced by the design goals—when NVIDIA created this cinematic-quality demo that is now synonymous with photorealistic, real-time rendering.

Chapter 4, "Animation in the 'Dawn' Demo," goes on to describe how Dawn was brought to life. Curtis Beeson explains how the programmers were able to give the artists control over blend shapes to create a diverse range of expressions. The chapter also discusses the various trade-offs that were made to perform the animation in real time.

The versatility of Ken Perlin's Academy Award–winning Noise algorithm has been shown repeatedly in real-time and offline computer graphics, starting from its first use in the film Tron. In Chapter 5, "Implementing Improved Perlin Noise," Ken elaborates on recent advancements, as described at SIGGRAPH 2002, which correct two particular defects of Ken's original work. The chapter also provides an efficient and robust framework for an implementation of Noise on modern programmable graphics hardware.

In Chapter 6, "Fire in the 'Vulcan' Demo," Hubert Nguyen describes the fire rendering used in the GeForce FX 5900 launch demo, "Vulcan." Though the effect, like most of the others in this part of the book, is not a true physical simulation, it does follow in the steps of offline techniques such as the one used in The Lord of the Rings. The realistic and convincing fiery imagery is made possible through some enhancements to overcome the performance limitations when rasterizing mass amounts of particles. Rounding off the focus on the natural elements is Chapter 7, "Rendering Countless Blades of Waving Grass." Kurt Pelzer tackles the challenge of depicting vast fields of waving grass using a tried and tested method whose first incarnation was seen in the "Codecreatures" real-time demo. He expands on this technique to enable higher-performance rendering that better suits the needs of a game engine, and he details the content-creation requirements.

Finally, in Chapter 8, "Simulating Diffraction," Jos Stam considers submicron-scale detail, such as the grooves on compact discs. The chapter describes a simplification of Jos's diffraction lighting model, first presented at SIGGRAPH 1999. The model has its foundations on the physical properties of light, which when modeled as a wave, can create colorful interference patterns.

Juan Guardado, NVIDIA


Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and Addison-Wesley was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals.

The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein.

The publisher offers discounts on this book when ordered in quantity for bulk purchases and special sales. For more information, please contact:

      U.S. Corporate and Government Sales
      (800) 382-3419

For sales outside of the U.S., please contact:

      International Sales

Visit Addison-Wesley on the Web:

Library of Congress Control Number: 2004100582

GeForce™ and NVIDIA Quadro® are trademarks or registered trademarks of NVIDIA Corporation.
RenderMan® is a registered trademark of Pixar Animation Studios.
"Shadow Map Antialiasing" © 2003 NVIDIA Corporation and Pixar Animation Studios.
"Cinematic Lighting" © 2003 Pixar Animation Studios.
Dawn images © 2002 NVIDIA Corporation. Vulcan images © 2003 NVIDIA Corporation.

Copyright © 2004 by NVIDIA Corporation.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior consent of the publisher. Printed in the United States of America. Published simultaneously in Canada.

For information on obtaining permission for use of material from this work, please submit a written request to:

      Pearson Education, Inc.
      Rights and Contracts Department
      One Lake Street
      Upper Saddle River, NJ 07458

Text printed on recycled and acid-free paper.

5 6 7 8 9 10 QWT 09 08 07

5th Printing September 2007