CSCI 480 / 580: Lecture/Lab 24 - GLSL Primer

GLSL - The GL Shader Language

Vertex and Fragment shaders are written in GLSL, a domain-specific mini-language for writing shaders. The syntax is C/C++-like, and basic shaders tend to look like very simple C programs, such as:

// some declarations here

void main() {
    // main program here
}

Shader Responsibilities

The vertex shader’s job is to:

The fragment shader’s job is to:

GLSL Features

Here are some things about GLSL that are not C-like:

Examples of working with vector and matrix types