OpenGL Pipeline

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

OpenGL Rendering Pipeline

The OpenGL graphics pipeline is also known as the OpenGL state machine. Its
main function is to generate, or render, a 2D image, given a virtual camera, 3D objects,
light sources, lighting models, textures and more.
The pipeline processes two types of data: vertex data, such as vertices, lines and
polygons, and pixel data, such as pixels, images and bitmaps. Data may either be
accumulated in display lists, which allow for greater optimization and data reuse, or
processed immediately through the pipeline.
In the first stages of the rendering process, vertex and pixel data are processed
separately and are later combined together during rasterization.
Bear in mind that all geometric primitives are eventually described by vertices, so
the pipeline uses evaluators to convert all geometric data into corresponding vertices.
After the evaluator stage, the second stage is the per-vertex operations stage, which
includes the conversion of vertices into primitives, lighting calculation and coordinate
projection.
Before the primitives are rasterized, they go through the primitive assembly
stage which handles clipping, perspective division, viewport operations and culling.
While geometric data takes one path through the OpenGL rendering pipeline,
pixel data takes a different route. In the pixel operations stage pixels from an array in
system memory are first unpacked from a variety of formats and then processed by a
pixel map.
The results are either written into texture memory or send to the rasterization step.
An application may wish to apply texture images onto geometric objects to make them
look more realistic, so, if several texture images are used, it's wise to put them into
texture objects so that you can easily switch among them.
Rasterization is the conversion of both vertex and pixel data into fragments. Each
fragment corresponds to a pixel in the frame buffer and is described by color, depth, line
width, point size and anti-aliasing calculations.
Before fragments are sent to frame buffer to be displayed, they go through the
per-fragment operations stage, which does options processing such as texture mapping
and fog calculation.
In conclusion, you could say that the OpenGL rendering pipeline is like a
manufacturing assembly line with each stage adding something to the previous one.
Because of this pipeline architecture, all of these stages can work in parallel within a
graphics processing unit, which consequently performs billions of geometry calculations
per second.

You might also like