This book presents techniques to render photo-realistic images by programming the Graphics Processing Unit (GPU). We discuss effects such as mirror reflections, refractions, caustics, diffuse or glossy indirect illumination, radiosity, single or multiple scattering in participating media, tone reproduction, glow, and depth of field. The book targets game developers, graphics programmers, and also students with some basic understanding of computer graphics algorithms, rendering APIs like Direct3D or OpenGL, and shader programming. In order to make the book self-contained, the most important concepts of local illumination and global illumination rendering, graphics hardware, and Direct3D/HLSL programming are reviewed in the first chapters. After these introductory chapters we warm up with simple methods including shadow and environment mapping, then we move on toward advanced concepts aiming at global illumination rendering. Since it would have been impossible to give a rigorous review of all approaches proposed in this field, we go into the details of just a few methods solving each particular global illumination effect. However, a short discussion of the state of the art and links to the bibliography are also provided to refer the interested reader to techniques that are not detailed in this book. The implementation of the selected methods is also presented in HLSL, and we discuss their observed performance, merits, and disadvantages. In the last chapter, we also review how these techniques can be integrated in an advanced game engine and present case studies of their exploitation in games. Having gone through this book, the reader will have an overview of the state of the art, will be able to apply and improve these techniques, and most importantly, will be capable of developing brand new GPU algorithms. Table of Contents: Global Illumintation Rendering / Local Illumination Rendering Pipeline of GPUs / Programming and Controlling GPUs / Simple Improvements of the Local Illumination Model / Ray Casting on the GPU / Specular Effects with Rasterization / Diffuse and Glossy Indirect Illumination / Pre-computation Aided Global Illumination / Participating Media Rendering / Fake Global Illumination / Postprocessing Effects / Integrating GI Effects in Games and Virtual Reality Systems / Bibliography C00.pdf......Page 1 GLOBAL ILLUMINATION RENDERING......Page 27 Materials......Page 32 Rendering equation......Page 34 Local illumination......Page 36 Global illumination......Page 39 Random walk solution of the renderingequation......Page 40 Monte Carlo Integration......Page 43 Importance Sampling......Page 45 Iteration solution of the rendering equation......Page 46 Application of former GI research results in GPUGI......Page 48 C02.pdf......Page 49 Evolution of the fixed-function rendering pipeline......Page 52 Rasterization With Linear Interpolation......Page 53 Texturing......Page 55 Transformation......Page 57 Programmable GPUs......Page 60 The Geometry Shader......Page 62 Pipeline Stages and Their Control by Render States......Page 64 PROGRAMMING AND CONTROLLING GPUS......Page 68 Introduction to HLSL programming......Page 70 Vertex Shader Programming......Page 72 Fragment Shader Programming......Page 75 Controlling the GPU from the CPU......Page 76 Controlling the Direct3D 9 Pipeline......Page 77 Controlling the Pipeline Using Effect Files......Page 82 Shaders beyond the standard pipelineoperation......Page 86 Are GPUs Good for Global Illumination?......Page 87 Basic Techniques for GPU Global Illumination......Page 88 SIMPLE IMPROVEMENTS OF THE LOCALILLUMINATION MODEL......Page 92 SHADOW MAPPING......Page 94 Shadow Map Generation......Page 96 Rendering With the Shadow Map......Page 97 Shadow Map Anti-aliasing......Page 100 IMAGE-BASED LIGHTING......Page 103 Mirrored Reflections and Refractions......Page 106 Diffuse and Glossy Reflections Without Self-shadowing......Page 108 Diffuse and Glossy Reflections With Shadowing......Page 111 RAY CASTING ON THE GPU......Page 116 RAY--TRIANGLE INTERSECTION IN A SHADER......Page 117 THE RAY ENGINE......Page 121 ACCELERATION HIERARCHY BUILT ON RAYS......Page 123 Implementation of Recursive Ray-tracing Using the Ray Engine......Page 124 Ray Casting......Page 126 FULL RAY-TRACERS ON THE GPU USING SPACEPARTITIONING......Page 128 Uniform Grid......Page 129 Hierarchical Bounding Boxes......Page 130 Kd-Tree......Page 131 LOOSE kd-TREE TRAVERSAL IN A SINGLE SHADER......Page 133 GPU Representation of the Loose kd-tree......Page 135 GPU Traversal of the Loose kd-tree......Page 137 Performance......Page 141 SPECULAR EFFECTS WITH RASTERIZATION......Page 142 RAY-TRACING OF DISTANCE MAPS......Page 146 Parallax Correction......Page 147 Linear Search......Page 148 Refinement by Secant Search......Page 150 SINGLE LOCALIZED REFLECTIONS AND REFRACTIONS......Page 152 SPECULAR REFLECTIONS WITH SEARCHING ONTHE REFLECTOR......Page 156 SPECULAR REFLECTIONS WITH GEOMETRY OR IMAGE TRANSFORMATION......Page 157 SELF REFLECTIONS AND REFRACTIONS......Page 158 CAUSTICS......Page 162 Light Pass......Page 163 Photon Hit Filtering and Light Projection......Page 165 COMBINING DIFFERENT SPECULAR EFFECTS......Page 170 DIFFUSE AND GLOSSY INDIRECT ILLUMINATION......Page 172 RADIOSITY ON THE GPU......Page 174 Random Texel Selection......Page 177 Update of the Radiance Texture......Page 179 PRE-COMPUTED RADIOSITY......Page 183 DIFFUSE AND GLOSSY FINAL GATHERING WITHDISTANCE MAPS......Page 185 PRE-COMPUTATION AIDED GLOBAL ILLUMINATION......Page 194 FINITE-ELEMENT METHOD......Page 197 Compression of Transfer Coefficients......Page 199 PRE-COMPUTED RADIANCE TRANSFER......Page 201 Direct3D Support of the Diffuse Pre-computed Radiance Transfer......Page 205 LIGHT PATH MAP......Page 208 Implementation......Page 210 C09.pdf......Page 221 PARTICLE SYSTEM MODEL......Page 223 BILLBOARD RENDERING......Page 224 Spherical Billboards......Page 225 ILLUMINATING PARTICIPATING MEDIA......Page 230 Dust and Smoke......Page 231 Fire......Page 232 Layer Composition......Page 235 PARTICIPATING MEDIA ILLUMINATION NETWORKS......Page 236 Iteration Solution of the Volumetric Rendering Equation......Page 237 Building the Illumination Network......Page 238 Iterating the Illumination Network......Page 239 FAKE GLOBAL ILLUMINATION......Page 244 THE SCALAR OBSCURANCES METHOD......Page 246 THE SPECTRAL OBSCURANCES METHOD......Page 247 CONSTRUCTION OF THE OBSCURANCES MAP......Page 249 DEPTH PEELING......Page 251 IMAGE FILTERING......Page 255 Separation of Dimensions......Page 257 Exploitation of the Bi-linear Filtering Hardware......Page 258 Importance Sampling......Page 260 TONE MAPPING......Page 262 Local Tone Mapping......Page 264 Temporal Luminance Adaptation......Page 265 Scotopic Vision......Page 266 Implementation......Page 267 DEPTH OF FIELD......Page 268 Camera Models and Depth of Field......Page 269 Depth of Field With the Simulation of Circle of Confusion......Page 270 INTEGRATING GI EFFECTS IN GAMES AND VIRTUAL REALITY SYSTEMS......Page 274 GAME ENGINES AND SCENE GRAPH MANAGERS......Page 275 COMBINING DIFFERENT RENDERING ALGORITHMS......Page 279 CASE STUDIES......Page 282 Moria......Page 283 RT Car......Page 285 Space Station......Page 289 C03.pdf......Page 69 C06.pdf......Page 143 C07.pdf......Page 173 C08.pdf......Page 195 C11.pdf......Page 245