From Cradle to Viewport
Before any pixels appear on the screen, you geometric data must pass through an obstacle course of manipulations and challenges called the graphics pipeline. The pipeline roughly follows these stages:
- A geometric model is loaded or generated by your application and uploaded to the GPU in VBOs.
- The application asks the GPU to draw the model.
- The vertex shader transforms the model, passing it through a series of coordinate systems that are convenient for performing various operations, like lighting.
- Primitives that reside or extend offscreen are clipped so only their visible portions continue on through the pipeline.
- The GPU transforms the vertices into pixel coordinates within the viewport.
- The fragment shader decides the colors of the fragments between the surviving vertices.
- Fragments are tested to see if their colors should be written to the framebuffer. One typical test rejects any fragments that are behind fragments nearer to the viewer.
- Fragment colors either replace or combine with colors already written to the framebuffer.
Read on to learn more about these stages.