Book description
"Cg is the key to unlocking the power of a new generation of
programmable graphics hardware. This book is the definitive
introduction to Cg, and will be essential for anyone programming
high-quality real-time graphics. The Cg Tutorial will teach you to
use Cg to create effects never before available for real-time
applications."
--Larry Gritz, Author of Advanced RenderMan (Morgan
Kaufmann, 2000)
"An important and timely book: Pixel-level procedural
textures--animated clouds, fire, water, the whole bag of procedural
tricks--finally go from the movie screen to the desktop. Access to
computation of this power through a C-like language will usher in
an exciting new era for the graphics community."
--Ken Perlin, Professor, New York University
Cg (C for graphics) is a complete programming environment for the fast creation of special effects and real-time cinematic quality experiences on multiple platforms. By providing a new level of abstraction, Cg lets developers more directly target OpenGL®, DirectX®, Windows®, Linux, Mac OS X®, and console platforms, such as the Xbox™, without having to program directly to the graphics hardware assembly language. Cg was developed by NVIDIA® Corporation in close collaboration with Microsoft® Corporation, and is compatible with both the OpenGL API and Microsoft's HLSL for DirectX 9.0.
The Cg Tutorial explains how to implement both basic and advanced techniques for today's programmable GPU architectures.
Major topics covered include:
3D transformations
Per-vertex and per-pixel lighting
Skinning and key-frame interpolation
Environment mapping
Bump mapping
Fog
Performance optimization
Projective texturing
Cartoon shading
Compositing
The accompanying CD-ROM includes the tools needed to run the sample programs in the book.
Table of contents
- Copyright
- Cg Language Concepts
- Figures and Plates
- Examples
- Tables
- Equations
- Foreword
- Preface
-
1. Introduction
- 1.1. What Is Cg?
- 1.2. Vertices, Fragments, and the Graphics Pipeline
- 1.3. Cg’s Historical Development
- 1.4. The Cg Environment
- 1.5. Exercises
- 1.6. Further Reading
- 2. The Simplest Programs
- 3. Parameters, Textures, and Expressions
-
4. Transformations
- 4.1. Coordinate Systems
- 4.2. Applying the Theory
- 4.3. Exercises
- 4.4. Further Reading
-
5. Lighting
- 5.1. Lighting and Lighting Models
- 5.2. Implementing the Basic Per-Vertex Lighting Model
- 5.3. Per-Fragment Lighting
- 5.4. Creating a Lighting Function
- 5.5. Extending the Basic Model
- 5.6. Exercises
- 5.7. Further Reading
- 6. Animation
-
7. Environment Mapping Techniques
- 7.1. Environment Mapping
- 7.2. Reflective Environment Mapping
- 7.3. Refractive Environment Mapping
- 7.4. The Fresnel Effect and Chromatic Dispersion
- 7.5. Exercises
- 7.6. Further Reading
-
8. Bump Mapping
- 8.1. Bump Mapping a Brick Wall
- 8.2. Bump Mapping a Brick Floor
- 8.3. Bump Mapping a Torus
- 8.4. Bump Mapping Textured Polygonal Meshes
- 8.5. Combining Bump Mapping with Other Effects
- 8.6. Exercises
- 8.7. Further Reading
- 9. Advanced Topics
-
10. Profiles and Performance
-
10.1. Profile Descriptions
- 10.1.1. The Vertex Shader Profile for DirectX 8
- 10.1.2. The Basic NVIDIA Vertex Program Profile for OpenGL
- 10.1.3. The ARB Vertex Program Profile for OpenGL
- 10.1.4. The Vertex Shader Profiles for DirectX 9
- 10.1.5. The Advanced NVIDIA Vertex Program Profile for OpenGL
- 10.1.6. The Pixel Shader Profiles for DirectX 8
- 10.1.7. The Basic NVIDIA Fragment Program Profile for OpenGL
- 10.1.8. The DirectX 9 Pixel Shader Profiles
- 10.1.9. The ARB Fragment Program Profile for OpenGL
- 10.1.10. The Advanced NVIDIA Fragment Program Profile for OpenGL
-
10.2. Performance
- 10.2.1. Use the Cg Standard Library
- 10.2.2. Take Advantage of Uniform Parameters
- 10.2.3. Using Vertex Programs vs. Fragment Programs
- 10.2.4. Data Types and Their Impact on Performance
- 10.2.5. Take Advantage of Vectorization
- 10.2.6. Use Textures to Encode Functions
- 10.2.7. Use Swizzling and Negation Freely
- 10.2.8. Shade Only the Pixels That You Must
- 10.2.9. Shorter Assembly Is Not Necessarily Faster
- 10.3. Exercises
- 10.4. Further Reading
-
10.1. Profile Descriptions
- A. Getting Started with Cg
- B. The Cg Runtime
- C. The CgFX File Format
- D. Cg Keywords
- E. Cg Standard Library Functions
- Color Inserts
Product information
- Title: The Cg Tutorial: The Definitive Guide to Programmable Real-Time Graphics
- Author(s):
- Release date: February 2003
- Publisher(s): Addison-Wesley Professional
- ISBN: 9780321545398
You might also like
book
Introduction to 3D Game Programming with DirectX 10
Introduction to 3D Game Programming with DirectX 10 provides an introduction to programming interactive computer graphics, …
book
GPU Pro 6
The sixth edition of this bestselling game development reference offers proven tips and techniques for the …
book
Unity 2018 Shaders and Effects Cookbook
Bring realism to your games by mastering post-processing effects and advanced shading techniques in Unity 2018 …
book
Advanced Graphics Programming Using OpenGL
Today truly useful and interactive graphics are available on affordable computers. While hardware progress has been …