Monday, August 11, 2008

The Graphics Pipeline

Those of us who've hung around computer graphics for a while have heard the term graphics pipeline quite it bit. It's not used so much anymore because the concept doesn't apply to current ways of doing graphics, but I think it's still useful to understand and then forget.

Basically, the graphics pipeline is the set of steps that would carry a given work of computer graphics from the idea to the actual dots on paper or pixels on a screen. Generally, the low end of the pipeline, making actual dots or lighting pixels, would be pretty common to a variety of graphics software, while the high end would depend on what level of graphics you start with. One way to think of the pipeline might be:
  1. 3D computer models of characters and scenes
  2. 2D geometry (maybe from flattening the 3D model)
  3. 2D bitmap of pixels
  4. physical dots on paper or pixels on screen
This is a simplification, but the idea is that you start with some conceptual model of what your graphic is going to represent, and then it passes through all the stages of the pipeline to be ultimately printed or displayed. You could imagine, for example, a step 0 before the above sequence which consists of a script and some character designs. That script and character designs get turned into computer representations of scenes and actions, and those get further processed into colored pixels that get recorded on DVD, and voila! You have WALL-E or any of the dozens of other animated features now available. Simple, right?

It used to be that a 3D computer model would get turned into a bunch of 2D shapes, each with a color that simulates the shading of the 3D object with the desired lighting. Then these 2D shapes would get turned into actual areas of pixels, and these would get displayed or printed. It turns out, though, that it's more successful to go directly from 3D scene to pixels, without flattening the scene into 2D shapes first. The techniques are based on an approach called ray-tracing, where software computes the color of each pixel by imagining beams of light from each light source reflecting off the objects in the scene and reaching each pixel to determine its color.

If you're creating a graphic in Illustrator, for example, you're starting in the middle of the pipeline, around step 2, with 2D shapes. You arrange the shapes within the Illustrator composition, and they still get turned into pixels for display and printing. Even while you're editing in Illustrator, the software is continuously turning your picture into pixels to display it on your screen.

On the other hand, if you're manipulating digital photos in Photoshop, you're starting at the pixel level. The work of turning 3D scenes into pixels is already done by the digital camera. You can't easily edit the text on a sign in the picture, for example, though there are techniques for making it look that way.

So another way to think of the above pipeline is:
  1. Maya, 3D Studio Max, etc.
  2. Illustrator, etc.
  3. Photoshop, etc.
  4. physical pixels or printed dots
The graphics pipeline is really a way to think about various techniques of representing computer graphics, and how they relate to each other.

1 comment:

Peter Davis said...

Actually, it occurs to me that dealing with text is a good way to think of this. At the top of the pipeline, suppose you have text in Illustrator. You can edit it, make corrections, revise, etc.

Now imagine that you use Illustrator's Text->Convert to Outlines tool to convert all the characters in your text into shapes. These shapes no longer know that they're letters, so you can't simply edit the text to fix spelling mistakes, etc.

Now suppose you open this Illustrator file in Photoshop, and choose to rasterize everything. Now you don't even have letter shapes. You just have regions of colored pixels which look like letters.