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
- Copyright
- Praise for OpenGL® Shading Language, Second Edition
- Praise for the First Edition of OpenGL® Shading Language
- Foreword
- Foreword to the First Edition
- Preface
- About the Author
- About the Contributors
- Acknowledgments
- 1. Review of OpenGL Basics
- 2. Basics
- 3. Language Definition
- 4. The OpenGL Programmable Pipeline
- 5. Built-in Functions
- 6. Simple Shading Example
-
7. OpenGL Shading Language API
- 7.1. Obtaining Version Information
- 7.2. Creating Shader Objects
- 7.3. Compiling Shader Objects
- 7.4. Linking and Using Shaders
- 7.5. Cleaning Up
- 7.6. Query Functions
- 7.7. Specifying Vertex Attributes
- 7.8. Specifying Uniform Variables
- 7.9. Samplers
- 7.10. Multiple Render Targets
- 7.11. Development Aids
- 7.12. Implementation-Dependent API Values
- 7.13. Application Code for Brick Shaders
- 7.14. Summary
- 7.15. Further Information
- 8. Shader Development
- 9. Emulating OpenGL Fixed Functionality
- 10. Stored Texture Shaders
- 11. Procedural Texture Shaders
- 12. Lighting
- 13. Shadows
- 14. Surface Characteristics
- 15. Noise
- 16. Animation
- 17. Antialiasing Procedural Textures
- 18. Non-Photorealistic Shaders
-
19. Shaders for Imaging
- 19.1. Geometric Image Transforms
- 19.2. Mathematical Mappings
- 19.3. Lookup Table Operations
- 19.4. Color Space Conversions
- 19.5. Image Interpolation and Extrapolation
-
19.6. Blend Modes
- 19.6.1. Normal
- 19.6.2. Average
- 19.6.3. Dissolve
- 19.6.4. Behind
- 19.6.5. Clear
- 19.6.6. Darken
- 19.6.7. Lighten
- 19.6.8. Multiply
- 19.6.9. Screen
- 19.6.10. Color Burn
- 19.6.11. Color Dodge
- 19.6.12. Overlay
- 19.6.13. Soft Light
- 19.6.14. Hard Light
- 19.6.15. Add
- 19.6.16. Subtract
- 19.6.17. Difference
- 19.6.18. Inverse Difference
- 19.6.19. Exclusion
- 19.6.20. Opacity
- 19.7. Convolution
- 19.8. Summary
- 19.9. Further Information
- 20. RealWorldz
- 21. Language Comparison
- A. Language Grammar
-
B. API Function Reference
- Implementation-Dependent API Values for GLSL
- Other Queriable Values for GLSL
- glAttachShader
- glBindAttribLocation
- glCompileShader
- glCreateProgram
- glCreateShader
- glDeleteProgram
- glDeleteShader
- glDetachShader
- glDrawBuffers
- glEnableVertexAttribArray
- glGetActiveAttrib
- glGetActiveUniform
- glGetAttachedShaders
- glGetAttribLocation
- glGetProgram
- glGetProgramInfoLog
- glGetShader
- glGetShaderInfoLog
- glGetShaderSource
- glGetUniform
- glGetUniformLocation
- glGetVertexAttrib
- glGetVertexAttribPointer
- glIsProgram
- glIsShader
- glLinkProgram
- glShaderSource
- glUniform
- glUseProgram
- glValidateProgram
- glVertexAttrib
- glVertexAttribPointer
- OpenGL 1.5 to OpenGL 2.0 GLSL Migration Guide
- Afterword
-
Glossary
-
Further Reading
- Color Plate
Product information
- Title: OpenGL® Shading Language, Second Edition
- Author(s):
- Release date: January 2006
- Publisher(s): Addison-Wesley Professional
- ISBN: 0321334892
You might also like
book
OpenGL® Shading Language, Third Edition
extensively updated for OpenGL 3.1, is the experienced application programmer’s guide to writing shaders. Part reference, …
book
OpenGL 4 Shading Language Cookbook - Third Edition
Over 70 recipes that cover advanced techniques for 3D programming such as lighting, shading, textures, particle …
book
Level of Detail for 3D Graphics
Level of detail (LOD) techniques are increasingly used by professional real-time developers to strike the balance …
book
Blender 3D By Example - Second Edition
Get up and running with Blender 3D through a series of practical projects that will help …