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 pipelline2). It is typically written ina special programming language such as GLSL3 or WGSL4. 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.

References

[1] Vertex Shader - OpenGL Wiki

[2] Rendering Pipeline Overview - OpenGL Wiki

[3] GLSL

[4] WebGPU Shading Language

Backlinks

  • Computer Graphics