A shader is a small program that computes some aspect of rendering, most often the color of a surface point but also vertex positions, geometry, and general purpose computation. Rather than hard coding a fixed lighting formula into the renderer, shaders let the person creating an image describe shading as code that the renderer executes for each vertex, fragment, or pixel. This programmability is what gives modern computer graphics its enormous variety of materials and effects, from skin and metal to water, fire, and stylized non photorealistic looks.
The concept originates in Robert L. Cook’s 1984 SIGGRAPH paper “Shade Trees.” Cook proposed describing the appearance of a surface as a tree of operations, a shade tree, in which each node takes parameters from its children and produces parameters for its parent, with leaves supplying inputs such as surface normals, light directions, and texture lookups. This made shading a flexible, composable expression rather than a single fixed equation, and it directly anticipated the idea of a shading language. The approach was developed into the RenderMan Shading Language, which let users write procedural surface, light, displacement, and volume shaders for high quality offline rendering.
Shaders moved from offline software into real-time hardware as GPUs gained programmable stages around the turn of the millennium. Early shaders were written in restricted assembly languages, but high level shading languages soon followed: the OpenGL Shading Language, GLSL, and Microsoft’s High Level Shading Language, HLSL, for Direct3D, along with NVIDIA’s Cg. These languages resemble C, with built in vector and matrix types and access to texture sampling, and they compile to code that runs on the GPU’s parallel execution units. The OpenGL Shading Language specification defines the language precisely, including its data types, built in functions, and the vertex and fragment stages it targets.
A modern rendering pipeline exposes several programmable shader stages. Vertex shaders transform and project geometry; fragment, or pixel, shaders compute the color of each rasterized fragment; and later additions such as geometry, tessellation, and compute shaders extend programmability to creating primitives, subdividing surfaces, and arbitrary parallel computation that need not produce an image at all. With the arrival of real-time ray tracing, additional shader types describe what happens when a ray is generated, hits a surface, or misses entirely.
The throughline from Cook’s shade trees to today’s GLSL and HLSL is the same idea: appearance and geometry are described as programs, not fixed formulas, and the renderer runs those programs at massive parallelism. Cook’s 1984 paper is the primary source for the concept, and the published shading language specifications are the authoritative description of how shaders are written and executed on contemporary hardware.