OpenGL 4.0 Shading Language Cookbook

Over 60 highly focused, practical recipes to maximize your use of the OpenGL Shading Language

Book Description:

With over 60 recipes, this Cookbook will teach you both the elementary and finer points of the OpenGL Shading Language, and get you familiar with the specific features of GLSL 4.0. A totally practical, hands-on guide. Overview A full set of recipes demonstrating simple and advanced techniques for producing high-quality, real-time 3D graphics using GLSL 4.0 How to use the OpenGL Shading Language to implement lighting and shading techniques Use the new features of GLSL 4.0 including tessellation and geometry shaders How to use textures in GLSL as part of a wide variety of techniques from basic texture mapping to deferred shading Simple, easy-to-follow examples with GLSL source code, as well as a basic description of the theory behind each technique What you will learn from this book Compile, install, and communicate with shader programs Use new features of GLSL 4.0 such as subroutines and uniform blocks Implement basic lighting and shading techniques such as diffuse and specular shading, per-fragment shading, and spotlights Apply single or multiple textures Use textures as environment maps for simulating reflection or refraction Implement screen-space techniques such as gamma correction, blur filters, and deferred shading Implement geometry and tessellation shaders Learn shadowing techniques including shadow mapping and screen space ambient occlusion Use noise in shaders Use shaders for animation Approach This hands-on guide cuts short the preamble and gets straight to the point – actually creating graphics, instead of just theoretical learning. Each recipe is specifically tailored to satisfy your appetite for producing real-time 3-D graphics using GLSL 4.0. Who this book is written for If you are an OpenGL programmer looking to use the modern features of GLSL 4.0 to create real-time, three-dimensional graphics, then this book is for you. Familiarity with OpenGL programming, along with the typical 3D coordinate syste