Book Image

OpenGL 4 Shading Language Cookbook - Third Edition

By : David Wolff
Book Image

OpenGL 4 Shading Language Cookbook - Third Edition

By: David Wolff

Overview of this book

OpenGL 4 Shading Language Cookbook, Third Edition provides easy-to-follow recipes that first walk you through the theory and background behind each technique, and then proceed to showcase and explain the GLSL and OpenGL code needed to implement them. The book begins by familiarizing you with beginner-level topics such as compiling and linking shader programs, saving and loading shader binaries (including SPIR-V), and using an OpenGL function loader library. We then proceed to cover basic lighting and shading effects. After that, you'll learn to use textures, produce shadows, and use geometry and tessellation shaders. Topics such as particle systems, screen-space ambient occlusion, deferred rendering, depth-based tessellation, and physically based rendering will help you tackle advanced topics. OpenGL 4 Shading Language Cookbook, Third Edition also covers advanced topics such as shadow techniques (including the two of the most common techniques: shadow maps and shadow volumes). You will learn how to use noise in shaders and how to use compute shaders. The book provides examples of modern shading techniques that can be used as a starting point for programmers to expand upon to produce modern, interactive, 3D computer-graphics applications.
Table of Contents (17 chapters)
Title Page
Packt Upsell


About the author

David Wolff is a professor in the computer science department at Pacific Lutheran University (PLU). He received a PhD in Physics and an MS in computer science from Oregon State University. He has been teaching computer graphics to undergraduates at PLU for over 17 years, using OpenGL.

About the reviewers

Dr. Muhammad Mobeen Movania received his PhD degree in Advance Computer Graphics and Visualization from Nanyang Technological University (NTU), Singapore. After his graduation, he joined the Institute for Infocomm Research, A-Star Singapore as a research scientist.

Dr. Movania has published several international conference and journal papers in the area of computer graphics and visualization. He has written two books on OpenGL namely, OpenGL Development Cookbook and OpenGL Build High Performance Graphics. He has also contributed book chapters in OpenGL InsightsWebGL Insights, and Game Engine Gems 3. He is associated with DHA Suffa University since 2013 and is currently serving as the Head of Computer Science Department. His GitHub ID is mmmovania.

I would like to thank Allah for his countless blessings on me. My thanks are then due on my family: my parents (Mr. and Mrs. Abdul Aziz Movania), my wife (Tanveer Taji), my brothers and sisters (Mr. Muhammad Khalid Movania, Mrs. Azra Saleem, Mrs. Sajida Shakir, and Mr. Abdul Majid Movania), all my nephews/nieces, and my children (Muntaha and Muhammad Faizan Movania).


Johannes Unterguggenberger is a University Assistant at TU Wien's Rendering and Modeling Group, Institute of Visual Computing and Human-Centered Technology. He is training students to become skilled graphics developers, which includes gaining expertise in OpenGL and GLSL. He always orients towards the future, be it by refusing to use any C++ version older than 17, developing Augmented Reality rendering techniques and frameworks, or exploring the limits of new graphics hardware.

After working in various fields across the IT industry, he is now fully devoted to education and research, having set his sights on achieving greater visual gloriousness in future games and other real-time applications. Furthermore, he really likes good CG-books and congratulates you for picking one of them up.


Packt is searching for authors like you

If you're interested in becoming an author for Packt, please visit and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.