Graphics Reference
In-Depth Information
The Fragment Processing Part of the Pipeline
OK, a moment ago we called it “pixel-processing,” but the fact is that it is really
called “fragment-processing.” What is a pixel ? A pixel, in GLSL terminology,
is a set of appearance information (usually red, green, blue, alpha, z-depth,
etc.) that is about to be writen to the framebufer. Then what is a fragment ? A
fragment is a pixel-to-be; that is, it is a pixel's worth of information necessary
to compute that pixel's red, green, blue, alpha, z-depth, etc. The operation is
called “fragment processing” because its job is to take all that information and
produce the pixel appearance. We will now see how that operation fits in with
the entire graphics pipeline.
The graphics pipeline takes the vertices in screen space and constructs
the regions you defined in your grouping with the appearance you specified
in the OpenGL rendering commands. This is described in the somewhat sim-
plified diagram of the rendering pipeline shown in Figure 1.3. This takes as its
input the output of the last step of the vertex pipeline in Figure 1.1.
Looking at this as we did at the vertex operation, we ask about the inputs
and outputs for each stage. We start with the output of the vertex operation:
vertices in screen coordinates with groupings, colors, depths, and texture
coordinates. (Normals are not considered here; the fixed-function pipeline
does not need them for fragment processing because lighting is computed per-
vertex and only the resultant color intensities are interpolated per-fragment.)
The first rendering stage takes the ordered vertices and creates the edges of the
primitive. The colors, depths, and texture coordinates at the vertices are inter-
polated to define these same properties along the edges and are then interpo-
lated left-edge-to-right-edge for each fragment.
The next rendering stage processes
fragments. It takes that “pre-information”
we just talked about and creates the appear-
ance information that will be writen into the
framebuffer.
In the final stage of the graphics pipe-
line, the color of the pixel is integrated into
the framebuffer by functions such as depth
testing, blending, and masking that assem-
ble the final framebuffer content. These pro-
cesses might ignore the pixel (depth test-
ing, masking) or might change the color of
the pixel (blending). The final output of this
stage is the actual color in the framebuffer.
Figure 1.3. A simplified view of the OpenGL render-
ing pipeline.
Search WWH ::




Custom Search