openskills.info
Course Preview

Shader Programming

Shader programming writes GPU programs that transform vertices, shade fragments, and run compute work across many parallel invocations. Those programs define how geometry, materials, textures, and buffers become pixels or GPU-side results inside a real-time graphics pipeline.

itSoftware engineering

Recommended first:real-time-graphics-programming

Don't Panic - Shader Programming

A shader is host-supplied GPU code. The CPU still records the draw; the GPU runs your program across a swarm of invocations, each handling one vertex, one fragment candidate, or one compute work item.

Before programmable shading, consumer GPUs largely followed fixed transform and lighting rules. Shaders replaced that fixed script with languages such as GLSL, HLSL, WGSL, and Metal Shading Language. Compilers turn that source into modules (often SPIR-V or DXIL) that a pipeline object can bind. The languages differ in syntax and packaging, but they agree on the job: say what each stage does with its inputs and bound resources.

Two ideas carry most of the weight. First, stages divide responsibility: vertex work prepares varyings, fragment work shades pixels, compute work updates buffers and images off to the side. Optional tessellation and geometry stages exist when the pipeline enables them; they are not a tax you pay on every hello-triangle. Second, the interface is part of the program: locations, bindings, and texture formats must match what the API records, or a shader that compiles still draws the wrong thing.

Uniforms hold values that stay constant for a draw. Interpolation carries vertex outputs across a primitive to fragment inputs (smooth, flat, and friends). Get the color space wrong (sRGB bytes treated as linear light) and a correct Lambert term still looks muddy. Get the matrix space wrong and specular highlights slide off into nonsense while the silhouette stays perfect.

The surprise for many readers is that fragment shaders cannot relocate a pixel in window space, and that a beautiful lighting formula will not save a mismatched descriptor set. Capture the frame before rewriting the BRDF. Compile and validate first; then look at which module, sampler, and render target the capture actually used.

For a quick map of stages and qualifiers, use the Cheatsheet. For hands-on formulas, use the Practice reference and the Lambert exercise. For judgment about graphs, permutations, and when to stop tweaking algebra, open Field Notes. The Intro remains the full tour when you want every definition in one place, and the Landscape tab names the languages and tools you will meet while doing the work.

Where this skill leads

Relevant careers

See how this topic contributes to broader role-level skill maps.

Sources