Graphics pipeline
Encyclopedia
In 3D computer graphics
3D computer graphics
3D computer graphics are graphics that use a three-dimensional representation of geometric data that is stored in the computer for the purposes of performing calculations and rendering 2D images...

, the terms graphics pipeline or rendering pipeline most commonly refers to the current state of the art method of rasterization
Rasterisation
Rasterisation is the task of taking an image described in a vector graphics format and converting it into a raster image for output on a video display or printer, or for storage in a bitmap file format....

-based rendering
Rendering (computer graphics)
Rendering is the process of generating an image from a model , by means of computer programs. A scene file contains objects in a strictly defined language or data structure; it would contain geometry, viewpoint, texture, lighting, and shading information as a description of the virtual scene...

 as supported by commodity graphics hardware
Graphics hardware
Graphics hardware is a hardware that enable to produce and show computer graphics. It works in conjuntion with graphics software. Examples of graphics hardware are display devices, graphics cards and motion capture hardware....

. The graphics pipeline typically accepts some representation of a three-dimensional primitives as an input and results in a 2D raster image as output. OpenGL
OpenGL
OpenGL is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex three-dimensional scenes from simple primitives. OpenGL...

 and Direct3D
Direct3D
Direct3D is part of Microsoft's DirectX application programming interface . Direct3D is available for Microsoft Windows operating systems , and for other platforms through the open source software Wine. It is the base for the graphics API on the Xbox and Xbox 360 console systems...

 are two notable 3d graphic standards, both describing very similar graphic pipeline.

Generations of graphics pipelines

Graphics pipelines constantly evolve. This article describes them as can be found in OpenGL
OpenGL
OpenGL is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex three-dimensional scenes from simple primitives. OpenGL...

 4.2 and Direct3D
Direct3D
Direct3D is part of Microsoft's DirectX application programming interface . Direct3D is available for Microsoft Windows operating systems , and for other platforms through the open source software Wine. It is the base for the graphics API on the Xbox and Xbox 360 console systems...

 11.

Transformation

This stage consumes data about polygons with vertices, edges and faces that constitute the whole scene. A matrix controls the linear transformations (scaling, rotation, translation, etc.) and viewing transformations (world and view space) that are to be applied on this data.

Per-vertex lighting

Geometry in the complete 3D scene is lit according to the defined locations of light sources, reflectance, and other surface properties. Current hardware implementations of the graphics pipeline compute lighting only at the vertices
Vertex (geometry)
In geometry, a vertex is a special kind of point that describes the corners or intersections of geometric shapes.-Of an angle:...

 of the polygons being rendered. The lighting values between vertices are then interpolated during rasterization. Per-fragment
Fragment (computer graphics)
In computer graphics, a fragment is the data necessary to generate a single pixel's worth of a drawing primitive in the frame buffer.This data may include, but is not limited to:* raster position* depth...

 (i.e. per-pixel
Pixel
In digital imaging, a pixel, or pel, is a single point in a raster image, or the smallest addressable screen element in a display device; it is the smallest unit of picture that can be represented or controlled....

) lighting can be done on modern graphics hardware as a post-rasterization process by means of a shader
Shader
In the field of computer graphics, a shader is a computer program that is used primarily to calculate rendering effects on graphics hardware with a high degree of flexibility...

 program.

Viewing transformation or normalizing transformation

Objects are transformed from 3-D world space coordinates into a 3-D coordinate system based on the position and orientation of a virtual camera. This results in the original 3D scene
Scene
- Arts and media :* Scene , an element of a larger fictional work such as a play* Scene , a part of action in a single location in a TV or movie, composed of a series of shots* Scene , a BBC drama anthology for teenagers...

 as seen from the camera’s point of view
Point of view shot
A point of view shot is a short film scene that shows what a character is looking at . It is usually established by being positioned between a shot of a character looking at something, and a shot showing the character's reaction...

, defined in what is called eye space or camera space. The normalizing transformation is the mathematical inverse of the viewing transformation, and maps from an arbitrary user-specified coordinate system (u, v, w) to a canonical coordinate system (x, y, z).

Primitives generation

After the transformation, new primitives
Geometric primitive
The term geometric primitive in computer graphics and CAD systems is used in various senses, with the common meaning of the simplest geometric objects that the system can handle . Sometimes the subroutines that draw the corresponding objects are called "geometric primitives" as well...

 are generated from those primitives that were sent to the beginning of the graphics pipeline.

Projection transformation

In the case of a Perspective projection, objects which are distant from the camera are made smaller (sheared). In an orthographic projection, objects retain their original size regardless of distance from the camera.

In this stage of the graphics pipeline, geometry is transformed from the eye space of the rendering camera into a special 3D coordinate space called "Homogeneous Clip Space", which is very convenient for clipping. Clip Space tends to range from [-1, 1] in X,Y,Z, although this can vary by graphics API(Direct3D or OpenGL). The Projection Transform is responsible for mapping the planes of the camera's viewing volume (or Frustum) to the planes of the box which makes up Clip Space.

Clipping

Geometric primitives that now fall outside of the viewing frustum
Viewing frustum
In 3D computer graphics, the viewing frustum or view frustum is the region of space in the modeled world that may appear on the screen; it is the field of view of the notional camera. The exact shape of this region varies depending on what kind of camera lens is being simulated, but typically it is...

 will not be visible and are discarded at this stage. Clipping
Clipping (computer graphics)
Any procedure which identifies that portion of a picture which is either inside or outside a picture is referred to as a clipping algorithm or clipping.The region against which an object is to be clipped is called clipping window.-Examples:...

 is not necessary to achieve a correct image output, but it accelerates the rendering process by eliminating the unneeded rasterization and post-processing
Post-processing
Post-processing may refer to:* Differential GPS post-processing* Video post-processing, methods used in video processing and 3D graphics* Finite element model data post-processing...

 on primitives that will not appear anyway.

Viewport transformation

The post-clip vertices are transformed once again to be in window space. In practice, this transform is very simple: applying a scale (multiplying by the width of the window) and a bias (adding to the offset from the screen origin). At this point, the vertices have coordinates which directly relate to pixels in a raster.

Scan conversion or rasterization

Rasterization is the process by which the 2D image space representation of the scene is converted into raster format and the correct resulting pixel values are determined. From now on, operations will be carried out on each single pixel. This stage is rather complex, involving multiple steps often referred as a group under the name of pixel pipeline.

Texturing, fragment shading

At this stage of the pipeline individual fragments (or pre-pixels) are assigned a color based on values interpolated from the vertices during rasterization or from a texture in memory.

The graphics pipeline in hardware

The rendering pipeline is mapped onto current graphics acceleration hardware such that the input to the graphics card (GPU) is in the form of vertices. These vertices then undergo transformation and per-vertex lighting. At this point in modern GPU pipelines a custom vertex shader
Shader
In the field of computer graphics, a shader is a computer program that is used primarily to calculate rendering effects on graphics hardware with a high degree of flexibility...

 program can be used to manipulate the 3D vertices prior to rasterization. Once transformed and lit, the vertices undergo clipping and rasterization resulting in fragments. A second custom shader program can then be run on each fragment before the final pixel values are output to the frame buffer for display.

The graphics pipeline is well suited to the rendering process because it allows the GPU to function as a stream processor
Stream processing
Stream processing is a computer programming paradigm, related to SIMD , that allows some applications to more easily exploit a limited form of parallel processing...

 since all vertices and fragments can be thought of as independent. This allows all stages of the pipeline to be used simultaneously for different vertices or fragments as they work their way through the pipe. In addition to pipelining vertices and fragments, their independence allows graphics processors to use parallel processing units to process multiple vertices
Vector processor
A vector processor, or array processor, is a central processing unit that implements an instruction set containing instructions that operate on one-dimensional arrays of data called vectors. This is in contrast to a scalar processor, whose instructions operate on single data items...

or fragments in a single stage of the pipeline at the same time.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK