A shader is a program in computer graphics that runs on the GPU to compute the shape and color of a scene as it is drawn to the screen. The basic types are the vertex shader, which transforms vertex positions, and the fragment shader (pixel shader), which determines the final color of each pixel; lighting, materials, shadows and post-processing effects are mostly implemented as shaders.
Shaders are written in dedicated languages such as GLSL and HLSL. On the web, WebGL runs shaders written in GLSL and WebGPU runs shaders written in WGSL. Libraries such as Three.js ship common materials and lighting as prebuilt shaders, so developers can build 3D scenes without writing shaders themselves. Beyond graphics, compute shaders are also used for general-purpose computation on the GPU.