Chapter 1. Getting Started with GLSL
In this chapter, we will cover the following recipes:
- Using a function loader to access the latest OpenGL functionality
- Using GLM for mathematics
- Determining the GLSL and OpenGL version
- Compiling a shader
- Linking a shader program
- Sending data to a shader using vertex attributes and vertex buffer objects
- Getting a list of active vertex input attributes and locations
- Sending data to a shader using uniform variables
- Getting a list of active uniform variables
- Using uniform blocks and uniform buffer objects
- Getting debug messages
- Building a C++ shader program class
Introduction
The OpenGL Shading Language (GLSL) Version 4 brings unprecedented power and flexibility to programmers interested in creating modern, interactive, and graphical programs. It allows us to harness the power of modern Graphics Processing Units (GPUs) in a straightforward way by providing a simple yet powerful language and API. Of course, the first step towards using GLSL is to create a program...