In
computer graphics
Computer graphics deals with generating images with the aid of computers. Today, computer graphics is a core technology in digital photography, film, video games, cell phone and computer displays, and many specialized applications. A great deal ...
, a fragment is the data necessary to generate a single
pixel
In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a raster image, or the smallest point in an all points addressable display device.
In most digital display devices, pixels are the s ...
's worth of a drawing primitive in the
frame buffer.
This data may include, but is not limited to:
*
raster position
*
depth
* interpolated attributes (color,
texture coordinates, etc.)
*
stencil
Stencilling produces an image or pattern on a surface, by applying pigment to a surface through an intermediate object, with designed holes in the intermediate object, to create a pattern or image on a surface, by allowing the pigment to reach ...
*
alpha
* window ID
As a scene is drawn, drawing primitives (the basic elements of graphics output, such as points, lines, circles, text etc.) are
rasterized into fragments which are textured and combined with the existing frame buffer. How a fragment is combined with the data already in the frame buffer depends on various settings. In a typical case, a fragment may be discarded if it is farther away than the pixel that is already at that location (according to the
depth buffer
A depth buffer, also known as a z-buffer, is a type of data buffer used in computer graphics to represent depth information of objects in 3D space from a particular perspective. Depth buffers are an aid to rendering a scene to ensure that th ...
). If it is nearer than the existing pixel, it may replace what is already there, or, if
alpha blending is in use, the pixel's color may be replaced with a mixture of the fragment's color and the pixel's existing color, as in the case of drawing a translucent object.
In general, a fragment can be thought of as the data needed to
shade the pixel, plus the data needed to test whether the fragment survives to become a pixel (depth,
alpha, stencil, scissor, window ID, etc.).
In computer graphics, a fragment is not necessarily opaque, and could contain an alpha value specifying its degree of transparency. The alpha is typically normalized to the range of
, 1 with 0 denotes totally transparent and 1 denotes totally opaque. If the fragment is not totally opaque, then part of its background object could show through, which is known as
''alpha blending''.
See also
*
Graphics pipeline
In computer graphics, a computer graphics pipeline, rendering pipeline or simply graphics pipeline, is a conceptual model that describes what steps a graphics system needs to perform to render a 3D scene to a 2D screen. Once ...
*
Vertex
Vertex, vertices or vertexes may refer to:
Science and technology Mathematics and computer science
*Vertex (geometry), a point where two or more curves, lines, or edges meet
*Vertex (computer graphics), a data structure that describes the position ...
References
{{DEFAULTSORT:Fragment (Computer Graphics)
Computer graphics