O'Reilly logo

Graphics Shaders, 2nd Edition by Steve Cunningham, Mike Bailey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

xxiii
Preface
Does this remind you of yourself?
You have lots of great, creative ideas in your head, but can’t seem to get
the right pixels to come out onto your graphics screen. Then, you are our type
of person. And, this is your type of book.
Welcome to the second edition of Graphics Shaders: Theory and Practice. As
the name implies, this book deals with both the theory and equations behind
what shaders do, as well as lots and lots of code examples of puing the theory
into practice. To help you, this book has been printed with color throughout.
That means that the lots of examples have lots of images to go with them to
help understand the concepts. So stop and stay for a while. Put your feet up
and start reading. You are really going to enjoy this.
hp://xkcd.com
xxiv
Preface
This book has over 100 more pages than the rst edition did. Here are the
major improvements:
1. This book is wrien against the most-recent specication releases:
OpenGL 4.x and GLSL 4.x0.
2. All code examples have been brought up-to-date with the current stan-
dard of the GLSL language.
3. There is an entire chapter (with examples) on the new tessellation shaders.
4. All chapters have more examples and more exercises.
5. Many diagrams have been improved. The ones involving GLSL function-
ality levels have been brought up to 4.x0.
6. The OpenGL Architecture Review Board (ARB) has depecated some por-
tions of OpenGL, but has not eliminated them. This edition discusses that,
and presents a strategy to write your own code with that in mind. All code
examples in this book now follow that strategy. Also, by following that
strategy, you will be prepared for migration to OpenGL-ES 2.0.
7. Appendices have been added showing the use of C++ classes to make
writing OpenGL shader applications easier, and help with the post-dep-
recation strategy.
Programmable computer graphics shaders have had an interesting his-
tory. In not-too-distant memory, at least for some of us, all aspects of computer
graphics were programmable. In fact, “programmable” is probably not a good
term, because that implies that there was a programmability option when cre-
ating an image. There wasn’t. If you wanted anything to happen, you had no
choice but to program it. Yourself. “Involuntary programmability” might be a
beer way to put it.
Computer graphics APIs changed that for most graphics practitioners.
With a good API, you could write very good graphics programs much more
easily because you could let the API’s functionality take over large portions of
the graphics process. However, you paid for this in giving up any functional-
ity that the API didn’t know how to handle. A good example is surface shad-
ing, where most of the 1990s APIs could not support anything beyond simple
smooth lighted surfaces.
Fortunately, neither the computer graphics research community nor
advanced graphics practitioners were satised with this. First in software and
then in hardware, as graphics processors were developed, specic functional-
ity was developed to support the programming of features that xed-function
graphics APIs had fenced o. This functionality has now developed its own
standards, including the GLSL shader language that is part of the OpenGL
standard. Programmable graphics shaders, programs that can be downloaded

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required