In
3D computer graphics3D 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 refer to the current state of the art method of rasterization-based rendering as supported by commodity graphics hardware. The graphics pipeline typically accepts some representation of a three-dimensional scene as an input and results in a 2D raster image as output.
OpenGLOpenGL 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
Direct3DDirect3D is part of Microsoft's DirectX API. Direct3D is only available for Microsoft's various Windows operating systems and in the open source software Wine. It is the base for the graphics API on the Xbox and Xbox 360 console systems. Direct3D is used to render three dimensional graphics in...
are two notable graphics pipeline models accepted as widespread industry standards.
In this stage the 3D geometry provided as input is established in what is known as 3D world space—a conceptual orientation and arrangement in 3D space.
In
3D computer graphics3D 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 refer to the current state of the art method of rasterization-based rendering as supported by commodity graphics hardware. The graphics pipeline typically accepts some representation of a three-dimensional scene as an input and results in a 2D raster image as output.
OpenGLOpenGL 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
Direct3DDirect3D is part of Microsoft's DirectX API. Direct3D is only available for Microsoft's various Windows operating systems and in the open source software Wine. It is the base for the graphics API on the Xbox and Xbox 360 console systems. Direct3D is used to render three dimensional graphics in...
are two notable graphics pipeline models accepted as widespread industry standards.
Modeling transformation
In this stage the 3D geometry provided as input is established in what is known as 3D world space—a conceptual orientation and arrangement in 3D space. This could include transformations on the local object space of
geometric primitiveThe term geometric primitive in computer graphics and CAD systems is used in various senses, with common meaning of atomic geometric objects the system can handle . Sometimes the subroutines that draw the corresponding objects are called "geometric primitives" as well...
s such as
translationIn Euclidean geometry, a translation is moving every point a constant distance in a specified direction. It is one of the rigid motions . A translation can also be interpreted as the addition of a constant vector to every point, or as shifting the origin of the coordinate system...
and
rotationA rotation is a movement of an object in a circular motion. A two-dimensional object rotates around a center of rotation. A three-dimensional object rotates around a line called an axis. If the axis of rotation is within the body, the body is said to rotate upon itself, or spin—which implies...
.
Per-vertex lighting
Geometry in the complete 3D scene is lit according to the defined locations of light sources and reflectance and other surface properties. Current hardware implementations of the graphics pipeline compute lighting only at the vertices of the polygons being rendered. The lighting values between vertices are then interpolated during rasterization. Per-
fragmentIn 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...
(ie. per-
pixelIn digital imaging, a pixel is the smallest item of information in an image. Pixels are normally arranged in a 2-dimensional grid, and are often represented using dots or squares. Each pixel is a sample of an original image, where more samples typically provide more-accurate representations of the...
) lighting can be done on modern graphics hardware as a post-rasterization process by means of a
shaderIn the field of computer graphics, a shader is a set of software instructions, which is used primarily to calculate rendering effects on graphics hardware with a high degree of flexibility...
program.
Viewing transformation
Objects are transformed from 3D world space coordinates into a 3D coordinate system based on the position and orientation of a virtual camera. This results in the original 3D
scene- Music :* Scene , a noise album by Merzbow* Scenes , a music album by Marty Friedman* The Scene , 1970s British Mod Revival band* SCENE Music Festival, an annual festival held in downtown St...
as seen from the camera’s
point of viewPoint of view may refer to:* Point of view , the perspective of the narrative voice; the pronoun used in narration*Point of view the angle of painter vision* Point of view shot, a technique in motion photography...
, defined in what is called
eye space or
camera space.
Primitives generation
After the transformation, new primitives are generated from those primitives that were sent to the beginning of the graphics pipeline.
Projection transformation
In this stage of the graphics pipeline, geometry is transformed from the eye space of the rendering camera into 2D image space, mapping the 3D scene onto a plane as seen from the virtual camera.
Clipping
Geometric primitives that now fall outside of the
viewing frustumIn 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.
ClippingIn rendering, clipping refers to an optimization where the computer only draws things that might be visible to the viewer.-Examples:In 2D graphics for example, if the user of an image editing program is modifying an image of the Mona Lisa and has "zoomed in" the view to display only the top half of...
is not necessary to achieve a correct image output, but it accelerates the rendering process by eliminating the unneeded rasterization and
post-processingPost-processing may refer to:* Differential GPS post-processing* Video post-processing* Finite element model data post-processing...
on primitives that will not appear anyway.
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.
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
shaderIn the field of computer graphics, a shader is a set of software instructions, which 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 processorStream 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 verticesA vector processor, or array processor, is a CPU design wherein the instruction set includes operations that can perform mathematical operations on multiple data elements simultaneously. This is in contrast to a scalar processor, which handles one element at a time using multiple instructions. The...
or fragments in a single stage of the pipeline at the same time.
External links