Skip to content
Part IA Michaelmas Term

OpenGL Rendering Pipeline

OpenGL History

  • OpenGL 1.0 (1992): Fixed-function pipeline
  • OpenGL 2.0 (2004): GLSL shaders introduced
  • OpenGL 3.2 (2009): Core profile, deprecated fixed-function
  • OpenGL 4.5+ (2014+): Modern features, SPIR-V shaders

Programming Model

  • CPU side: gl* functions to create objects, copy data, modify state
  • GPU side: Shaders written in GLSL (OpenGL Shading Language)

The Rendering Pipeline

Full OpenGL pipeline with stages

Vertex Data → Vertex Shader → Tessellation → Geometry Shader →
Primitive Assembly → Clipping → Rasterisation → Fragment Shader → Screen Buffer

Pipeline Stages

Programmable Stages

StagePurpose
Vertex ShaderTransform vertices, pass attributes
TessellationSubdivide patches into triangles
Geometry ShaderCreate/modify primitives
Fragment ShaderCompute pixel colours

Fixed-Function Stages

StagePurpose
Primitive AssemblyOrganise vertices into primitives
ClippingRemove geometry outside view frustum
RasterisationGenerate fragments from primitives

Primitive Assembly

Organise vertices into primitives (triangles, lines, points) based on drawing mode.

Clipping

Remove geometry outside the view frustum:

  • Vertices outside are clipped
  • Edges crossing the boundary are split
  • New vertices generated at clip boundaries

Rasterisation

Generate fragments (pixel candidates) for each primitive:

  • Determine which pixels are inside the triangle
  • Interpolate vertex attributes using barycentric coordinates
  • Output fragment positions and interpolated attributes

Summary

  • OpenGL pipeline combines programmable and fixed-function stages
  • Vertex shader processes individual vertices
  • Fragment shader computes final pixel colours
  • Rasterisation bridges vertex and fragment stages

Past Paper Questions

2024 Paper 3 Question 4: Describe the stages of the OpenGL pipeline. Which are programmable?

2023 Paper 3 Question 4: Explain what happens during rasterisation.

2022 Paper 3 Question 4: What is the purpose of primitive assembly and clipping in the pipeline?