Example code for the OpenGL Shading Language Cookbook - 2nd Edition (3rd Edition now available)
Alternatives To Glslcookbook
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
4 years ago3mitC
Example code for the OpenGL Shading Language Cookbook - 2nd Edition (3rd Edition now available)
Opengl 4 Shading Language Cookbook Third Edition259
18 days ago1mitC
OpenGL 4 Shading Language Cookbook - Third Edition, published by Packt
5 years agomit
Opengl Build High Performance Graphics70
2 months agomitC++
OpenGL Build High Performance Graphics, by Packt
Juce Cookbook18
3 years agocc0-1.0Makefile
Collection of tutorials & resources for the C++ library JUCE
4 years ago8Rust
A Rust implementation of the book OpenGL 4 Shading Language Cookbook Third Editoin
Opengl 4 Shading Language Cookbook1
7 years agoC++
Alternatives To Glslcookbook
Select To Compare

Alternative Project Comparisons

🎉 NEW The 3rd Edition is now available!!! 🎉

Example code from the OpenGL Shading Language Cookbook, 2nd Edition

The example code from the OpenGL Shading Language Cookbook, 2nd Edition, by David Wolff and published by Packt Publishing, 2013 (ISBN: 9781782167020).

Recent changes:

  • Most examples now run on MacOS!
  • CMake build now uses package config files when finding GLM and GLFW. This should make for a more streamlined configuration. Use CMAKE_PREFIX_PATH to point CMake to your installs.
  • Examples now properly support high-density displays.


To compile these examples, you'll need the following:

  • The GLM Mathematics Library version 0.9.6 or later. Note that versions prior to 0.9.6 may not work properly because of a switch from degrees to radians. GLM 0.9.5 will work, but you'll need to add #define GLM_FORCE_RADIANS prior to including the glm header files.
  • GLFW version 3.0 or later.

Compiling the examples

The example code builds with CMake. Note that the examples for Chapter 10 will not function on MacOS due to lack of support for compute shaders on that platform.

  1. Install GLFW by following the instructions on their web site.
  2. Install the latest version of GLM. Note that for CMake to find GLM correctly, you need to run the install "build" (e.g. make install) or install GLM from your favorite package manager. Otherwise, the CMake config files will not be created/available.
  3. Download this example code from github, or clone using git.
  4. Run cmake. If cmake has difficulties finding the GLFW or GLM installations, set the variable CMAKE_PREFIX_PATH to help cmake find them.
  5. Compile by running make.

Any problems, create an issue on github.

Tips for compiling for Windows with Visual Studio

  • Use the Visual Studio target in CMake: -G "Visual Studio...", open the Visual Studio solution. You should see one project per chapter.
  • Each chapter requires a command line argument to choose a recipe. When running in VS, be sure to set the 'Command Argument' under 'Properties' for the appropriate recipe.

OpenGL Function Loading

An OpenGL header file and a function loader for a 4.3 core profile are included with this project. They were generated using GLAD. This loader should also work on MacOS under a 4.1 core profile, but of course not all functions will load.

The code has been tested with OpenGL 4.3 on Windows/Linux and OpenGL 4.1 on MacOS.

Popular Cookbook Projects
Popular Opengl Projects
Popular Learning Resources Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.