Vertex Shaders

A vertex shader is a program that runs on the GPU that is one of the stages in a “rendering pipeline” (e.g. the OpenGL rendering pipelline1). It is typically written ina special programming language such as GLSL2 or WGSL3. The job of a vertex shader is to take a single vertex as input and output a single vertex (usually in 4D homogenous coordinates), in “clip-space”, after doing some user-defined transformation on it. It may also generate other user-defined outputs.

The rendering pipeline takes these outputs and the output vertex and then interpolates them to generate values for points between two vertices (e.g. on a triangle formed by three vertices). These are called “Fragments”. The pipeline then eventually calls the fragment shader to generate pixels (of some color) corresponding to these fragments.

2

GLSL

Backlinks

  • Computer Graphics