Shader: a type of computer program (set of instructions) for programmable GPUs.

<aside> 💡

The same shader program/function/instruction is executed for variable input data.

👆 When you write shaders, that is a very important paradigm. It is (arguably?) **the central ‘**mental shift’ for someone coming from “ordinary”, sequential-data CPU programming.

</aside>

If a CPU (Central Processing Unit) is a sports car, then a GPU is a bus.

CPUs are typically more freely programmable and utilized than GPUs, which are designed to operate on bulk workloads of data through specific stages, standard/common to modern graphics tasks.

Thus, there are different types of shaders;

And, also—

Data for graphics/rendering is typically processed in stages from defining the geometry, then shading/colouring surfaces ← which makes for a logical, and more efficient, standardized system.

<aside> 💡

“Shader” is from their original utility, which was to ‘shade’ digital/virtual surface geometry.

</aside>

Your screen is a grid of ‘pixels’ (”picture elements”); emissive [light-emitting] units of RGB colour.

Your screen is a discretized output grid.

You might imagine (most, typical-) video games as complex, interactive descriptions of 3D worlds. They exist a system of systems; some framework like the static geometry of a level, and the fundamental programming/instructions/command which a virtual universe simulates.