How to: Create fabulous computer graphics

Exposed: The inner workings of Canada's best (and most fun) new technologies.

How stuff works : The inner workings of Canada's best (and most fun) new technologies.

Computer graphics | Wireless | Sub-zero pints | Lobster hotel | Track email | Raft uphill | Universal remote

Anyone who grew up on Pac-Man and Space Invaders — or, shudder, Pong — sits in awe of the games their children now play, which feature realistic-looking three-dimensional characters, complicated story lines, even real-time interaction. That level of detail is possible because computers are more powerful than ever and can handle increasing amounts of data, but it's actually the graphics processing unit — or GPU — that does most of the grunt work. This tiny companion to a computer's motherboard is a single-chip processor that can have more than 160 million transistors. Sometimes referred to as a graphics card, a GPU actually does a variety of things, but as Adrian Hartog, chief technology officer at ATI Technologies Inc., explains, gamers will care about two of them: the vertex shader and the pixel shader.

The vertex shader is a piece of hardware that takes digital images received from a game and breaks them down into a series of very small surfaces, typically triangles, using mathematical algorithms. The vertex shader doesn't worry so much about drawing triangles, but rather with manipulating the position of the x, y and z vertex points that define a triangle's position. A triangle can be as small as one pixel. The more complex an object, the more triangles are needed to realistically map it. For example, an image of a person might be broken down into 10,000 triangles. Good thing ATI's Radeon X850 series of GPUs can handle up to 65,280 instructions.

A game filled with graphics built of triangles — even three-dimensional ones — would be pretty dull, so to make the game as realistic as possible these triangles have to be mapped with colours, textures such as hair or fur, and lighting effects. The built-in pixel shader engine does the processing of these attributes. The Radeon X850's pixel shader has up to 16 parallel pipelines processing this information, and can perform up to 43 billion operations per second. The programmable nature of both these shaders means developers can use default instructions to save time, but also create new ones as necessary. The end result is that every pixel drawn on your display reflects the realism of the world that the game developers are trying to model.