OpenGL® Shading Language, Second Edition

Book description

"As the 'Red Book' is known to be the gold standard for OpenGL, the 'Orange Book' is considered to be the gold standard for the OpenGL Shading Language. With Randi's extensive knowledge of OpenGL and GLSL, you can be assured you will be learning from a graphics industry veteran. Within the pages of the second edition you can find topics from beginning shader development to advanced topics such as the spherical harmonic lighting model and more."

—David Tommeraasen, CEO/Programmer, Plasma Software

"This will be the definitive guide for OpenGL shaders; no other book goes into this detail. Rost has done an excellent job at setting the stage for shader development, what the purpose is, how to do it, and how it all fits together. The book includes great examples and details, and good additional coverage of 2.0 changes!"

—Jeffery Galinovsky, Director of Emerging Market Platform Development, Intel Corporation

"The coverage in this new edition of the book is pitched just right to help many new shader-writers get started, but with enough deep information for the 'old hands.'"

—Marc Olano, Assistant Professor, University of Maryland

"This is a really great book on GLSL—well written and organized, very accessible, and with good real-world examples and sample code. The topics flow naturally and easily, explanatory code fragments are inserted in very logical places to illustrate concepts, and all in all, this book makes an excellent tutorial as well as a reference."

—John Carey, Chief Technology Officer, C.O.R.E. Feature Animation

OpenGL® Shading Language, Second Edition, extensively updated for OpenGL 2.0, is the experienced application programmer's guide to writing shaders. Part reference, part tutorial, this book thoroughly explains the shift from fixed-functionality graphics hardware to the new era of programmable graphics hardware and the additions to the OpenGL API that support this programmability. With OpenGL and shaders written in the OpenGL Shading Language, applications can perform better, achieving stunning graphics effects by using the capabilities of both the visual processing unit and the central processing unit.

In this book, you will find a detailed introduction to the OpenGL Shading Language (GLSL) and the new OpenGL function calls that support it. The text begins by describing the syntax and semantics of this high-level programming language. Once this foundation has been established, the book explores the creation and manipulation of shaders using new OpenGL function calls.

OpenGL® Shading Language, Second Edition, includes updated descriptions for the language and all the GLSL entry points added to OpenGL 2.0; new chapters that discuss lighting, shadows, and surface characteristics; and an under-the-hood look at the implementation of RealWorldz, the most ambitious GLSL application to date. The second edition also features 18 extensive new examples of shaders and their underlying algorithms, including

  • Image-based lighting

  • Lighting with spherical harmonics

  • Ambient occlusion

  • Shadow mapping

  • Volume shadows using deferred lighting

  • Ward's BRDF model

  • The color plate section illustrates the power and sophistication of the OpenGL Shading Language. The API Function Reference at the end of the book is an excellent guide to the API entry points that support the OpenGL Shading Language. Also included is a convenient Quick Reference Card to GLSL.

    Table of contents

    1. Copyright
      1. Dedication
    2. Praise for OpenGL® Shading Language, Second Edition
    3. Praise for the First Edition of OpenGL® Shading Language
    4. Foreword
    5. Foreword to the First Edition
    6. Preface
      1. Intended Audience
      2. About This Book
      3. About the Shader Examples
      4. Errata
      5. Typographical Conventions
    7. About the Author
    8. About the Contributors
    9. Acknowledgments
    10. 1. Review of OpenGL Basics
      1. 1.1. OpenGL History
      2. 1.2. OpenGL Evolution
      3. 1.3. Execution Model
      4. 1.4. The Frame Buffer
      5. 1.5. State
      6. 1.6. Processing Pipeline
      7. 1.7. Drawing Geometry
        1. 1.7.1. Geometry Specification
        2. 1.7.2. Per-Vertex Operations
        3. 1.7.3. Primitive Assembly
        4. 1.7.4. Primitive Processing
        5. 1.7.5. Rasterization
        6. 1.7.6. Fragment Processing
        7. 1.7.7. Per-Fragment Operations
        8. 1.7.8. Frame Buffer Operations
      8. 1.8. Drawing Images
        1. 1.8.1. Pixel Unpacking
        2. 1.8.2. Pixel Transfer
        3. 1.8.3. Rasterization and Back-End Processing
        4. 1.8.4. Read Control
      9. 1.9. Coordinate Transforms
      10. 1.10. Texturing
      11. 1.11. Summary
      12. 1.12. Further Information
    11. 2. Basics
      1. 2.1. Introduction to the OpenGL Shading Language
      2. 2.2. Why Write Shaders?
      3. 2.3. OpenGL Programmable Processors
        1. 2.3.1. Vertex Processor
        2. 2.3.2. Fragment Processor
      4. 2.4. Language Overview
        1. 2.4.1. Language Design Considerations
        2. 2.4.2. C Basis
        3. 2.4.3. Additions to C
        4. 2.4.4. Additions from C++
        5. 2.4.5. C Features Not Supported
        6. 2.4.6. Other Differences
      5. 2.5. System Overview
        1. 2.5.1. Driver Model
        2. 2.5.2. OpenGL Shading Language Compiler/Linker
        3. 2.5.3. OpenGL Shading Language API
      6. 2.6. Key Benefits
      7. 2.7. Summary
      8. 2.8. Further Information
    12. 3. Language Definition
      1. 3.1. Example Shader Pair
      2. 3.2. Data Types
        1. 3.2.1. Scalars
        2. 3.2.2. Vectors
        3. 3.2.3. Matrices
        4. 3.2.4. Samplers
        5. 3.2.5. Structures
        6. 3.2.6. Arrays
        7. 3.2.7. Void
        8. 3.2.8. Declarations and Scope
        9. 3.2.9. Type Matching and Promotion
      3. 3.3. Initializers and Constructors
      4. 3.4. Type Conversions
      5. 3.5. Qualifiers and Interface to a Shader
        1. 3.5.1. Attribute Qualifiers
        2. 3.5.2. Uniform Qualifiers
        3. 3.5.3. Varying Qualifiers
        4. 3.5.4. Constant Qualifiers
        5. 3.5.5. Absent Qualifier
      6. 3.6. Flow Control
        1. 3.6.1. Functions
        2. 3.6.2. Calling Conventions
        3. 3.6.3. Built-in Functions
      7. 3.7. Operations
        1. 3.7.1. Indexing
        2. 3.7.2. Swizzling
        3. 3.7.3. Component-wise Operation
      8. 3.8. Preprocessor
      9. 3.9. Preprocessor Expressions
      10. 3.10. Error Handling
      11. 3.11. Summary
      12. 3.12. Further Information
    13. 4. The OpenGL Programmable Pipeline
      1. 4.1. The Vertex Processor
        1. 4.1.1. Vertex Attributes
        2. 4.1.2. Uniform Variables
        3. 4.1.3. Special Output Variables
        4. 4.1.4. Built-in Varying Variables
        5. 4.1.5. User-Defined Varying Variables
      2. 4.2. The Fragment Processor
        1. 4.2.1. Varying Variables
        2. 4.2.2. Uniform Variables
        3. 4.2.3. Special Input Variables
        4. 4.2.4. Special Output Variables
      3. 4.3. Built-in Uniform Variables
      4. 4.4. Built-in Constants
      5. 4.5. Interaction with OpenGL Fixed Functionality
        1. 4.5.1. Two-Sided Color Mode
        2. 4.5.2. Point Size Mode
        3. 4.5.3. Clipping
        4. 4.5.4. Raster Position
        5. 4.5.5. Position Invariance
        6. 4.5.6. Texturing
      6. 4.6. Summary
      7. 4.7. Further Information
    14. 5. Built-in Functions
      1. 5.1. Angle and Trigonometry Functions
      2. 5.2. Exponential Functions
      3. 5.3. Common Functions
      4. 5.4. Geometric Functions
      5. 5.5. Matrix Functions
      6. 5.6. Vector Relational Functions
      7. 5.7. Texture Access Functions
      8. 5.8. Fragment Processing Functions
      9. 5.9. Noise Functions
      10. 5.10. Summary
      11. 5.11. Further Information
    15. 6. Simple Shading Example
      1. 6.1. Brick Shader Overview
      2. 6.2. Vertex Shader
      3. 6.3. Fragment Shader
      4. 6.4. Observations
      5. 6.5. Summary
      6. 6.6. Further Information
    16. 7. OpenGL Shading Language API
      1. 7.1. Obtaining Version Information
      2. 7.2. Creating Shader Objects
      3. 7.3. Compiling Shader Objects
      4. 7.4. Linking and Using Shaders
      5. 7.5. Cleaning Up
      6. 7.6. Query Functions
      7. 7.7. Specifying Vertex Attributes
      8. 7.8. Specifying Uniform Variables
      9. 7.9. Samplers
      10. 7.10. Multiple Render Targets
      11. 7.11. Development Aids
      12. 7.12. Implementation-Dependent API Values
      13. 7.13. Application Code for Brick Shaders
      14. 7.14. Summary
      15. 7.15. Further Information
    17. 8. Shader Development
      1. 8.1. General Principles
        1. 8.1.1. Understand the Problem
        2. 8.1.2. Add Complexity Progressively
        3. 8.1.3. Test and Iterate
        4. 8.1.4. Strive for Simplicity
        5. 8.1.5. Exploit Modularity
      2. 8.2. Performance Considerations
        1. 8.2.1. Consider Computational Frequency
        2. 8.2.2. Analyze Your Algorithm
        3. 8.2.3. Use the Built-in Functions
        4. 8.2.4. Use Vectors
        5. 8.2.5. Use Textures to Encode Complex Functions
        6. 8.2.6. Review the Information Logs
      3. 8.3. Shader Debugging
        1. 8.3.1. Use the Vertex Shader Output
        2. 8.3.2. Use the Fragment Shader Output
        3. 8.3.3. Use Simple Geometry
      4. 8.4. Shader Development Tools
        1. 8.4.1. RenderMonkey
        2. 8.4.2. OpenGL Shading Language Compiler Front End
      5. 8.5. Scene Graphs
      6. 8.6. Summary
      7. 8.7. Further Information
    18. 9. Emulating OpenGL Fixed Functionality
      1. 9.1. Transformation
      2. 9.2. Light Sources
        1. 9.2.1. Directional Lights
        2. 9.2.2. Point Lights
        3. 9.2.3. Spotlights
      3. 9.3. Material Properties and Lighting
      4. 9.4. Two-Sided Lighting
      5. 9.5. No Lighting
      6. 9.6. Fog
      7. 9.7. Texture Coordinate Generation
      8. 9.8. User Clipping
      9. 9.9. Texture Application
      10. 9.10. Summary
      11. 9.11. Further Information
    19. 10. Stored Texture Shaders
      1. 10.1. Access to Texture Maps from a Shader
      2. 10.2. Simple Texturing Example
        1. 10.2.1. Application Setup
        2. 10.2.2. Vertex Shader
        3. 10.2.3. Fragment Shader
      3. 10.3. Multitexturing Example
        1. 10.3.1. Application Setup
        2. 10.3.2. Vertex Shader
        3. 10.3.3. Fragment Shader
      4. 10.4. Cube Mapping Example
        1. 10.4.1. Application Setup
        2. 10.4.2. Vertex Shader
        3. 10.4.3. Fragment Shader
      5. 10.5. Another Environment Mapping Example
        1. 10.5.1. Vertex Shader
        2. 10.5.2. Fragment Shader
      6. 10.6. Glyph Bombing
        1. 10.6.1. Application Setup
        2. 10.6.2. Vertex Shader
        3. 10.6.3. Fragment Shader
      7. 10.7. Summary
      8. 10.8. Further Information
    20. 11. Procedural Texture Shaders
      1. 11.1. Regular Patterns
        1. 11.1.1. Stripes Vertex Shader
        2. 11.1.2. Stripes Fragment Shader
      2. 11.2. Toy Ball
        1. 11.2.1. Application Setup
        2. 11.2.2. Vertex Shader
        3. 11.2.3. Fragment Shader
      3. 11.3. Lattice
      4. 11.4. Bump Mapping
        1. 11.4.1. Application Setup
        2. 11.4.2. Vertex Shader
        3. 11.4.3. Fragment Shader
        4. 11.4.4. Normal Maps
      5. 11.5. Summary
      6. 11.6. Further Information
    21. 12. Lighting
      1. 12.1. Hemisphere Lighting
      2. 12.2. Image-Based Lighting
      3. 12.3. Lighting with Spherical Harmonics
      4. 12.4. The ÜberLight Shader
        1. 12.4.1. ÜberLight Controls
        2. 12.4.2. Vertex Shader
        3. 12.4.3. Fragment Shader
      5. 12.5. Summary
      6. 12.6. Further Information
    22. 13. Shadows
      1. 13.1. Ambient Occlusion
      2. 13.2. Shadow Maps
        1. 13.2.1. Application Setup
        2. 13.2.2. Vertex Shader
        3. 13.2.3. Fragment Shader
      3. 13.3. Deferred Shading for Volume Shadows
        1. 13.3.1. Shaders for First Pass
        2. 13.3.2. Shaders for Second Pass
      4. 13.4. Summary
      5. 13.5. Further Information
    23. 14. Surface Characteristics
      1. 14.1. Refraction
      2. 14.2. Diffraction
      3. 14.3. BRDF Models
      4. 14.4. Polynomial Texture Mapping with BRDF Data
        1. 14.4.1. Application Setup
        2. 14.4.2. Vertex Shader
        3. 14.4.3. Fragment Shader
      5. 14.5. Summary
      6. 14.6. Further Information
    24. 15. Noise
      1. 15.1. Noise Defined
        1. 15.1.1. 2D Noise
        2. 15.1.2. Higher Dimensions of Noise
        3. 15.1.3. Using Noise in OpenGL Shaders
      2. 15.2. Noise Textures
      3. 15.3. Trade-offs
      4. 15.4. A Simple Noise Shader
        1. 15.4.1. Application Setup
        2. 15.4.2. Vertex Shader
        3. 15.4.3. Fragment Shader
      5. 15.5. Turbulence
        1. 15.5.1. Sun Surface Shader
        2. 15.5.2. Marble
      6. 15.6. Granite
      7. 15.7. Wood
        1. 15.7.1. Application Setup
        2. 15.7.2. Fragment Shader
      8. 15.8. Summary
      9. 15.9. Further Information
    25. 16. Animation
      1. 16.1. On/Off
      2. 16.2. Threshold
      3. 16.3. Translation
      4. 16.4. Morphing
        1. 16.4.1. Sphere Morph Vertex Shader
      5. 16.5. Other Blending Effects
      6. 16.6. Vertex Noise
      7. 16.7. Particle Systems
        1. 16.7.1. Application Setup
        2. 16.7.2. Confetti Cannon Vertex Shader
        3. 16.7.3. Further Enhancements
      8. 16.8. Wobble
      9. 16.9. Summary
      10. 16.10. Further Information
    26. 17. Antialiasing Procedural Textures
      1. 17.1. Sources of Aliasing
      2. 17.2. Avoiding Aliasing
      3. 17.3. Increasing Resolution
      4. 17.4. Antialiased Stripe Example
        1. 17.4.1. Generating Stripes
        2. 17.4.2. Analytic Prefiltering
        3. 17.4.3. Adaptive Analytic Prefiltering
        4. 17.4.4. Analytic Integration
        5. 17.4.5. Antialiased Brick Fragment Shader
      5. 17.5. Frequency Clamping
        1. 17.5.1. Antialiased Checkerboard Fragment Shader
      6. 17.6. Summary
      7. 17.7. Further Information
    27. 18. Non-Photorealistic Shaders
      1. 18.1. Hatching Example
        1. 18.1.1. Application Setup
        2. 18.1.2. Vertex Shader
        3. 18.1.3. Generating Hatching Strokes
        4. 18.1.4. Obtaining Uniform Line Density
        5. 18.1.5. Simulating Lighting
        6. 18.1.6. Adding Character
        7. 18.1.7. Hatching Fragment Shader
      2. 18.2. Technical Illustration Example
        1. 18.2.1. Application Setup
        2. 18.2.2. Vertex Shader
        3. 18.2.3. Fragment Shader
      3. 18.3. Mandelbrot Example
        1. 18.3.1. About the Mandelbrot Set
        2. 18.3.2. Vertex Shader
        3. 18.3.3. Fragment Shader
        4. 18.3.4. Julia Sets
      4. 18.4. Summary
      5. 18.5. Further Information
    28. 19. Shaders for Imaging
      1. 19.1. Geometric Image Transforms
      2. 19.2. Mathematical Mappings
      3. 19.3. Lookup Table Operations
      4. 19.4. Color Space Conversions
      5. 19.5. Image Interpolation and Extrapolation
        1. 19.5.1. Brightness
        2. 19.5.2. Contrast
        3. 19.5.3. Saturation
        4. 19.5.4. Sharpness
      6. 19.6. Blend Modes
        1. 19.6.1. Normal
        2. 19.6.2. Average
        3. 19.6.3. Dissolve
        4. 19.6.4. Behind
        5. 19.6.5. Clear
        6. 19.6.6. Darken
        7. 19.6.7. Lighten
        8. 19.6.8. Multiply
        9. 19.6.9. Screen
        10. 19.6.10. Color Burn
        11. 19.6.11. Color Dodge
        12. 19.6.12. Overlay
        13. 19.6.13. Soft Light
        14. 19.6.14. Hard Light
        15. 19.6.15. Add
        16. 19.6.16. Subtract
        17. 19.6.17. Difference
        18. 19.6.18. Inverse Difference
        19. 19.6.19. Exclusion
        20. 19.6.20. Opacity
      7. 19.7. Convolution
        1. 19.7.1. Smoothing
        2. 19.7.2. Edge Detection
        3. 19.7.3. Sharpening
      8. 19.8. Summary
      9. 19.9. Further Information
    29. 20. RealWorldz
      1. 20.1. Features
      2. 20.2. RealWorldz Internals
        1. 20.2.1. Terrain-Rendering Structure
        2. 20.2.2. Shading
        3. 20.2.3. Fractal Terrains
        4. 20.2.4. Fractal Terrains in RealWorldz
        5. 20.2.5. Noise Texture Creation
        6. 20.2.6. Tile Set Noise
        7. 20.2.7. Surface Normals
        8. 20.2.8. Overhanging Terrain
      3. 20.3. Implementation
        1. 20.3.1. Noise Values and Derivatives
        2. 20.3.2. Tile Sets
        3. 20.3.3. The Function Tree
        4. 20.3.4. Terrain Color
        5. 20.3.5. AltGrad Map for Snow
        6. 20.3.6. AltGrad Map for AlienRockArt
        7. 20.3.7. AltGrad Map for DragonRidges
        8. 20.3.8. Lighting
        9. 20.3.9. Performance Considerations
      4. 20.4. Atmospheric Effects
        1. 20.4.1. Aerial Perspective
        2. 20.4.2. Sky Shading
      5. 20.5. Ocean
        1. 20.5.1. Reflections
        2. 20.5.2. Reflected Sky
        3. 20.5.3. Rendering the Ocean
      6. 20.6. Clouds
      7. 20.7. Summary
      8. 20.8. Further Information
    30. 21. Language Comparison
      1. 21.1. Chronology of Shading Languages
      2. 21.2. RenderMan
      3. 21.3. OpenGL Shader (ISL)
      4. 21.4. HLSL
      5. 21.5. Cg
      6. 21.6. Summary
      7. 21.7. Further Information
    31. A. Language Grammar
    32. B. API Function Reference
      1. Implementation-Dependent API Values for GLSL
      2. Other Queriable Values for GLSL
      3. glAttachShader
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      4. glBindAttribLocation
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      5. glCompileShader
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      6. glCreateProgram
        1. Name
        2. C Specification
        3. Description
        4. Notes
        5. Errors
        6. Associated Gets
        7. See Also
      7. glCreateShader
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      8. glDeleteProgram
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      9. glDeleteShader
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      10. glDetachShader
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      11. glDrawBuffers
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      12. glEnableVertexAttribArray
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      13. glGetActiveAttrib
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      14. glGetActiveUniform
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      15. glGetAttachedShaders
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      16. glGetAttribLocation
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      17. glGetProgram
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. ASSOCIATED GETS
        8. See Also
      18. glGetProgramInfoLog
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      19. glGetShader
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      20. glGetShaderInfoLog
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      21. glGetShaderSource
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      22. glGetUniform
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      23. glGetUniformLocation
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      24. glGetVertexAttrib
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      25. glGetVertexAttribPointer
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      26. glIsProgram
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      27. glIsShader
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      28. glLinkProgram
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      29. glShaderSource
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      30. glUniform
        1. Name
        2. C Specification
        3. Parameters
        4. C Specification
        5. Parameters
        6. C Specification
        7. Parameters
        8. Description
        9. Notes
        10. Errors
        11. Associated Gets
        12. See Also
      31. glUseProgram
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      32. glValidateProgram
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      33. glVertexAttrib
        1. Name
        2. C Specification
        3. Parameters
        4. C Specification
        5. Parameters
        6. Description
        7. Notes
        8. Errors
        9. Associated Gets
        10. See Also
      34. glVertexAttribPointer
        1. Name
        2. C Specification
        3. Parameters
        4. Description
        5. Notes
        6. Errors
        7. Associated Gets
        8. See Also
      35. OpenGL 1.5 to OpenGL 2.0 GLSL Migration Guide
    33. Afterword
    34. Glossary
    35. Further Reading
    36. Color Plate

    Product information

    • Title: OpenGL® Shading Language, Second Edition
    • Author(s): Randi J. Rost
    • Release date: January 2006
    • Publisher(s): Addison-Wesley Professional
    • ISBN: 0321334892