This new edition provides step-by-step instruction on modern 3D graphics shader programming in OpenGL with C++, along with its theoretical foundations. It is appropriate both for computer science graphics courses and for professionals interested in mastering 3D graphics skills. Ithas been designed in a 4-color, "teach-yourself" format with numerousexamples that the reader can run just as presented. Every shader stage is explored,from the basics of modeling, textures, lighting, shadows, etc., throughadvanced techniques such as tessellation, normal mapping, noise maps, as wellas new chapters on simulating water, stereoscopy, and ray tracing. FEATURES: Covers modern OpenGL 4.0+ shaderprogramming in C++, with instructions for both PC/Windows and Macintosh Illustrates every technique with runningcode examples. Everything needed to install the libraries, and complete sourcecode for each example Includes step-by-step instruction for usingeach GLSL programmable pipeline stage (vertex, tessellation, geometry, andfragment) Explores practical examples formodeling, lighting, and shadows (including soft shadows), terrain, water, and 3Dmaterials such as wood and marble Adds new chapters on simulating water, stereoscopy, and ray tracing with compute shaders Explains how to optimize code for tools such as Nvidia's Nsight debugger Includes companion files with code,object models, figures, and more.