OpenGL® Shading Language and over one million other books are available for Amazon Kindle. Learn more

Vous voulez voir cette page en français ? Cliquez ici.


or
Sign in to turn on 1-Click ordering.
More Buying Choices
Have one to sell? Sell yours here
Start reading OpenGL® Shading Language on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

OpenGL® Shading Language [Paperback]

Randi J. Rost

List Price: CDN$ 72.99
Price: CDN$ 58.59 & this item ships for FREE with Super Saver Shipping. Details
You Save: CDN$ 14.40 (20%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
Temporarily out of stock.
Order now and we'll deliver when available. We'll e-mail you with an estimated delivery date as soon as we have more information. Your account will only be charged when we ship the item.
Ships from and sold by Amazon.ca. Gift-wrap available.

Formats

Amazon Price New from Used from
Kindle Edition CDN $38.77  
Paperback CDN $58.59  
There is a newer edition of this item:
OpenGL Shading Language (3rd Edition) OpenGL Shading Language (3rd Edition)
CDN$ 42.83
In Stock.

Book Description

Feb 4 2006 0321334892 978-0321334893 2

"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.


Customers Who Bought This Item Also Bought


Product Details


Product Description

Review

“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, as well as 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 provides a timely, thorough, and entertaining introduction to the only OpenGL ARB-approved high-level shading language in existence. Whether an expert or a novice, there are gems to be discovered throughout the book, and the reference pages will be your constant companion as you dig into the depths of the shading APIs. From algorithms to APIs, this book has you covered.”

—Bob Kuehne, CEO, Blue Newt Software

 

“Computer graphics and rendering technologies just took a giant leap forward with hardware vendors rapidly adopting the new OpenGL Shading Language. This book presents a detailed treatment of these exciting technologies in a way that is extremely helpful for visualization and game developers.”

—Andy McGovern, Founder, Virtual Geographics, Inc.

 

“The OpenGL Shading Language is at the epicenter of the programmable graphics revolution, and Randi Rost has been at the center of the development of this significant new industry standard. If you need the inside track on how to use the OpenGL Shading Language to unleash new visual effects and unlock the supercomputer hiding inside the new generation of graphics hardware, then this is the book for you.”

—Neil Trevett, Senior Vice President, Market Development, 3Dlabs

 

 

--This text refers to an alternate Paperback edition.

From the Inside Flap

For just about as long as there has been graphics hardware, there has been programmable graphics hardware. Over the years, building flexibility into graphics hardware designs has been a necessary way of life for hardware developers. Graphics APIs continue to evolve, and because a hardware design can take two years or more from start to finish, the only way to guarantee a hardware product that can support the then-current graphics APIs at its release is to build in some degree of programmability from the very beginning.

Until recently, the realm of programming graphics hardware belonged to just a few people, mainly researchers and graphics hardware driver developers. Research into programmable graphics hardware has been taking place for many years, but the point of this research has not been to produce viable hardware and software for application developers and end users. The graphics hardware driver developers have focused on the immediate task of providing support for the important graphics APIs of the time: PHIGS, PEX, Iris GL, OpenGL, Direct3D, and so on. Until recently, none of these APIs exposed the programmability of the underlying hardware, so application developers have been forced into using the fixed functionality provided by traditional graphics APIs.

Hardware companies have not exposed the programmable underpinnings of their products because there is a high cost of educating and supporting customers to use low-level, device-specific interfaces and because these interfaces typically change quite radically with each new generation of graphics hardware. Application developers who use such a device-specific interface to a piece of graphics hardware face the daunting task of updating their software for each new generation of hardware that comes along. And forget about supporting the application on hardware from multiple vendors!

As we moved into the 21st century, some of these fundamental tenets about graphics hardware were challenged. Application developers pushed the envelope as never before and demanded a variety of new features in hardware in order to create more and more sophisticated onscreen effects. As a result, new graphics hardware designs became more programmable than ever before. Standard graphics APIs were challenged to keep up with the pace of hardware innovation. For OpenGL, the result was a spate of extensions to the core API as hardware vendors struggled to support a range of interesting new features that their customers were demanding.

The creation of a standard, cross-platform high level shading language for commercially available graphics hardware was a watershed event for the graphics industry. A paradigm shift occurred, one that took us from the world of rigid, fixed functionality graphics hardware and graphics APIs to a brave new world where the visual processing unit, or VPU (i.e., graphics hardware), is as important as the central processing unit, or CPU. The VPU is optimized for processing dynamic media such as 3D graphics and video. Highly parallel processing of floating point data is the primary task for VPUs, and the flexibility of the VPU will mean that it can also be used to process data other than a stream of traditional graphics commands. Applications can take advantage of the capabilities of both the CPU and the VPU, utilizing the strengths of each to perform the task at hand optimally.

This book describes how graphics hardware programmability is exposed through a high-level language in the leading cross-platform 3D graphics API: OpenGL. This language, the OpenGL Shading Language, allows applications to take total control over the most important stages of the graphics processing pipeline. No longer restricted to the graphics rendering algorithms and formulas chosen by hardware designers and frozen in silicon, software developers are beginning to use this programmability to create stunning effects in real-time.

Intended Audience

The primary audience for this book is application programmers that are interested in writing shaders. This book is intended to be used as both a tutorial and a reference book by people interested in learning to write shaders with the OpenGL Shading Language. Some will use the book in one fashion and some in the other. It is hoped that the organization will be amenable to both uses. It is not expected that most people will read the book in sequential order from back to front.

Readers do not need previous knowledge of OpenGL in order to absorb the material in this book, but it is very helpful. A brief review of OpenGL is included, but this book does not attempt to be a tutorial or reference book for OpenGL. Anyone attempting to develop an OpenGL application that uses shaders should be armed with OpenGL programming documentation in addition to this book.

Computer graphics has a mathematical basis, therefore some knowledge of algebra and trigonometry will help readers understand and appreciate some of the details presented. With the advent of programmable graphics hardware, key parts of the graphics processing pipeline are once again under the control of software developers. In order to develop shaders successfully in this environment, it is imperative that developers understand the mathematical basis of computer graphics.

About This Book

This book has three main parts. Chapters 1 through 8 are aimed at teaching the reader about the OpenGL Shading Language and how to use it. This part of the book covers details of the language and details of the OpenGL commands that are used to create and manipulate shaders. In order to provide the reader with a basis for writing shaders, Chapters 9 through 20 contain a gallery of shader examples and some explanation of the underlying algorithms. This part of the book is intended to be used as a basis for the reader's shader development and as a springboard to inspire new ideas. Finally, Chapter 21 contains a comparison with other notable commercial shading languages, and Appendices A, B, and C contain reference material for the language and the API entry points that support it.

The chapters are arranged to suit the needs of the reader who is least familiar with OpenGL and shading languages. Certain chapters can be skipped by readers who are more familiar with both topics. This book is designed to have somewhat compartmentalized chapters in order to allow such usage.

Chapter 1 contains a review of the fundamentals of the OpenGL API. Readers already familiar with OpenGL may skip to Chapter 2.

Chapter 2 provides an introduction to the OpenGL Shading Language and the OpenGL entry points that have been added to support it. If you want to know what the OpenGL Shading Language is all about and you have time to read only one chapter of this book, this is the one to read.

Chapter 3 thoroughly describes the OpenGL Shading Language. This material is organized to present the details of a programming language. This section will be useful as a reference section after readers have developed a general understanding of the language.

Chapter 4 discusses how the newly defined programmable parts of the rendering pipeline interact with each other and with OpenGL's fixed functionality. This discussion includes descriptions of the built-in variables defined in the OpenGL Shading Language.

Chapter 5 describes the built-in functions that are part of the OpenGL Shading Language. This section will also be useful as a reference section after readers have developed an understanding of the language.

Chapter 6 presents and discusses a fairly simple shader example. People who learn best by diving in and studying a real example will benefit from the discussion in this chapter.

Chapter 7 describes the entry points that have been added to OpenGL to support the creation and manipulation of shaders. This material will need to be understood by application programmers who want to use shaders in their application.

Chapter 8 presents some general advice on shader development and describes the shader development process. It also describes tools that are currently available to aid the shader development process.

Chapter 9 begins a series of chapters that present and discuss shaders with a common characteristic. In this chapter, shaders that duplicate some of the fixed functionality of the OpenGL pipeline are presented.

Chapter 10 presents a few shaders that are based on the capability to store data in and retrieve data from texture maps.

Chapter 11 is devoted to shaders that are procedural in nature (effects are computed algorithmically rather than being based on information stored in textures).

Chapter 12 presents several alternative lighting models that can be implemented using OpenGL shaders.

Chapter 13 discusses algorithms and shaders for producing shadows.

Chapter 14 delves into the details of shaders that implement more realistic surface characteristics, including refraction, diffraction, and more realistic reflection.

Chapter 15 describes noise and the effects that can be achieved by using it properly.

Chapter 16 contains examples of how shaders can be used to create rendering effects that vary over time.

Chapter 17 contains a discussion of the aliasing problem and how shaders can be written to reduce the effects of aliasing.

Chapter 18 illustrates shaders that are used to achieve effects other than photorealism. Such effects include technical illustration, sketching or hatching effects, and other stylized rendering.

Chapter 19 presents several shaders that are used to modify images as they are being drawn with OpenGL.

Chapter 20 describes some of the techniques and algorithms used in a complex OpenGL demo application that makes extensive use of the OpenGL Shading Language.

Chapter 21 compares the OpenGL Shading Language with other notable commercial shading languages.

Appendix A contains the language grammar that more clearly specifies the OpenGL Shading Language.

Appendix B contains reference pages for the API entry points that are related to the OpenGL Shading Language.

Appendix C is a quick reference for the OpenGL Shading Language

About the Shader Examples

The shaders contained in this book are primarily short programs designed to illustrate the capabilities of the OpenGL Shading Language. None of the example shaders should be presumed to illustrate the "best" way of achieving a particular effect. (Indeed, the "best" way to implement certain effects may have yet to be discovered through the power and flexibility of programmable graphics hardware.) Performance improvements for each shader are possible for any given hardware target. For most of the shaders, image quality may be improved by taking greater care to reduce or eliminate causes of aliasing.

The source code for these shaders is written in a way that I believe represents a reasonable trade-off between source code clarity, portability, and performance. Use them to learn the OpenGL Shading Language, and improve upon them for use in your own projects.

All of the images produced for this book were done either on the first graphics accelerator to provide support for the OpenGL Shading Language, the 3Dlabs Wildcat VP, or its successor, the 3Dlabs Wildcat Realizm. I have taken as much care as possible to present shaders that are done "the right way" for the OpenGL Shading Language rather than those with idiosyncracies due to being developed on the very early implementations of the OpenGL Shading Language.If you find any errors, please report them to me (randi@3dshaders.


Customer Reviews

There are no customer reviews yet on Amazon.ca
5 star
4 star
3 star
2 star
1 star
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com: 3.4 out of 5 stars  8 reviews
7 of 7 people found the following review helpful
5.0 out of 5 stars do your own shading?! Feb 7 2006
By W Boudville - Published on Amazon.com
Format:Paperback
Twenty years ago, I used to program graphics on an Evans and Sutherland PS340. It was then one of the top of the line graphics computers (costing $100k). It could labouriously do shading, but only Phong and Gouraud. Nowadays, many PCs have this ability, and much faster. But a problem still persists, where often the shading methods are restricted to what is implemented on the graphics chips.

In contrast, you have the approach in this definitive book on OpenGL Shading Language. This lets you implement in your code, shading routines of your own devising. To be sure, given the same shading method, one done in this language, and one in the hardware, then the latter will have better performance. But it turns out that today's computers are fast enough, and have enough RAM, that the difference in response might not be appreciable.

The book describes an extensive set of built-in convenience functions that come with the language. And the language's API is explained in detail. The author rightly recommends that you come at it with some experience in the standard OpenGL.

Since the language is still quite new, you are more or less on your own, when looking at development tools. This dearth is expected to be remedied in a few years. But right now, you'll have to rely on your wits. Along with a chapter that gives general principles of how you should develop your own shader. What may be even more use, however, is the second half of the book. Devoted to case studies of many shaders. Understanding these may be more beneficial than any IDE.

Oh, as you might expect from a graphics book, there is a lovely set of colour plates in the middle of the book, showing what custom shaders can do. Treat it as inspiration if you wish.
15 of 18 people found the following review helpful
5.0 out of 5 stars Excellent guide to OpenGL Shading Language Feb 17 2006
By calvinnme - Published on Amazon.com
Format:Paperback
The recent trend in graphics hardware has been to replace fixed functionality with programmability in areas that have grown exceedingly complex (e.g., vertex processing and fragment processing). The OpenGL Shading Language has been designed to allow application programmers to express the processing that occurs at those programmable points of the OpenGL pipeline. Independently compilable units that are written in this language are called shaders. A program is a set of shaders that are compiled and linked together. The OpenGL Shading Language is based on ANSI C and many of the features have been retained except when they conflict with performance or ease of implementation. This shading language is without a doubt the most important addition to OpenGL since its inception, and this book provides an excellent guide to programming with it. The author was one of the primary contributors to the development of the language, and he provides a well-written and insightful explanation of the language and its use.
The book begins with a review of OpenGL basics, followed by an introduction to shaders and how they fit into the pipeline. It then covers the language itself, including data types, operators, interaction with the OpenGL state machine and fixed function pipeline, built-in functions, and more. It also introduces and explains the OpenGL APIs needed to use shaders.
The last half of the book focuses on shader development, including general process and workflow, and coverage of many specific techniques, such as procedural textures and GPU-based animation. It even includes a section on implementing the fixed function pipeline using shaders. The book ends with a handy comparison of OpenGL Shading Language with other shading languages, such as Cg, HLSL, and Renderman and a couple of appendices providing a language grammar and API reference.
I particularly liked chapters 6 through 8, which take you from a simple shading example -"brick"- through the specific steps of shader development that you would need to master regardless of the API you are using. Also the chapters on procedural textures and noise and the accompanying code examples helped clear up some matters that were murky when I read "Texturing & Modeling: A Procedural Approach" by Ebert et al. In summary, I highly recommend this book to anyone interested in implementing software shading, both from the standpoint of OpenGL and from the standpoint of the design process itself. I notice that Amazon does not show the table of contents for the second edition, so I do that here:
Chapter 1. REVIEW OF OPENGL BASICS
OpenGL History; OpenGL Evolution; Execution Mode; The Frame Buffer; State; Processing Pipeline; Drawing Geometry; Drawing Images; Coordinate Transforms; Texturing;

Chapter 2. BASICS
Introduction to the OpenGL Shading Language; Why Write Shaders?; OpenGL Programmable Processors; Language Overview; System Overview; Key Benefits;

Chapter 3. LANGUAGE DEFINITION
Example Shader Pair; Data Types; Initializers and Constructors; Type Conversions; Qualifiers and Interface to a Shader; Flow Control; Operations; Preprocessor; Preprocessor Expressions; Error Handling;

Chapter 4. THE OPENGL PROGRAMMABLE PIPELINE
The Vertex Processor; The Fragment Processor; Built-in Uniform Variables; Built-in Constants; Interaction with OpenGL Fixed Functionality;

Chapter 5. BUILT-IN FUNCTIONS
Angle and Trigonometry Functions; Exponential Functions; Common Functions; Geometric Functions; Matrix Functions; Vector Relational Functions; Texture Access Functions; Fragment Processing Functions; Noise Functions;

Chapter 6. SIMPLE SHADING EXAMPLE
Brick Shader Overview; Vertex Shader; Fragment Shader; Observations;

Chapter 7 OPENGL SHADING LANGUAGE API
Obtaining Version Information; Creating Shader Objects; Compiling Shader Objects; Linking and Using Shaders; Cleaning Up; Query Functions; Specifying Vertex Attributes; Specifying Uniform Variables; Samplers; Multiple Render Targets; Development Aids; Implementation-Dependent API Values; Application Code for Brick Shaders;

Chapter 8. SHADER DEVELOPMENT
General Principles; Performance Considerations; Shader Debugging; Shader Development Tools; Scene Graphs;

Chapter 9. EMULATING OPENGL FIXED FUNCTIONALITY
Transformation; Light Sources; Material Properties and Lighting; Two-Sided Lighting; No Lighting; Fog; Texture Coordinate Generation; User Clipping; Texture Application;

Chapter 10. STORED TEXTURE SHADERS
Access to Texture Maps from a Shader; Simple Texturing Example; Multitexturing Example; Cube Mapping Example; Another Environment Mapping Example; Glyph Bombing;

Chapter 11. PROCEDURAL TEXTURE SHADERS
Regular Patterns; Toy Ball; Lattice; Bump Mapping;

Chapter 12. LIGHTING
Hemisphere Lighting; Image-Based Lighting; Lighting with Spherical Harmonics; The *erLight Shader;

Chapter 13. SHADOWS
Ambient Occlusion; Shadow Maps; Deferred Shading for Volume Shadows;

Chapter 14. SURFACE CHARACTERISTICS
Refraction; Diffraction; BRDF Models; Polynomial Texture Mapping with BRDF Data;

Chapter 15. NOISE
Noise Defined; Noise Textures; Trade-offs; A Simple Noise Shader; Turbulence; Granite; Wood;

Chapter 16. ANIMATION
On/Off; Threshold; Translation; Morphing; Other Blending Effects; Vertex Noise; Particle Systems; Wobble;

Chapter 17. ANTIALIASING PROCEDURAL TEXTURES
Sources of Aliasing; Avoiding Aliasing; Increasing Resolution; Antialiased Stripe Example; Frequency Clamping;

Chapter 18. NON-PHOTOREALISTIC SHADERS
Hatching Example; Technical Illustration Example; Mandelbrot Example;

Chapter 19. SHADERS FOR IMAGING
Geometric Image Transforms; Mathematical Mappings; Lookup Table Operations; Color Space Conversions; Image Interpolation and Extrapolation; Blend Modes;

Chapter 20. REALWORLDZ
Features; RealWorldz Internals; Implementation; Atmospheric Effects; Ocean; Clouds;

Chapter 21. LANGUAGE COMPARISON
Chronology of Shading Languages; RenderMan; OpenGL Shader (ISL); HLSL; Cg;
Appendix A. Language Grammar
Appendix B. API Function Reference
8 of 11 people found the following review helpful
1.0 out of 5 stars Broken Code, Incomplete Examples Jan 18 2010
By Trousers - Published on Amazon.com
Format:Paperback
The code is often broken, the book has typos, and the examples are rarely ever complete. The portions missing from the examples are the critical aspects for those new to GL 3.

Listmania!

Create a Listmania! list

Look for similar items by category


Feedback


Amazon.ca Privacy Statement Amazon.ca Shipping Information Amazon.ca Returns & Exchanges