Graphics Reference
In-Depth Information
plane has the smallest depth value, while the far clipping
plane has the largest. The linear interpolation calculation
based on the depth value of the endpoint of a line seg-
ment or fragment gives the depth for a given pixel.
In the final phase of pixel processing, these pixels
are sent to the final stage of the rendering pipeline after
they are computed, but before they are writen to the
framebuffer. These final stages handle several opera-
tions, including masking, depth testing, and alpha
blending. The integer depth value is used in depth test-
ing, and pixels are ignored if their depth exceeds the
depth of that pixel already in the depth buffer. If the
aliased depth values of two pixels are the same, only
one of them can be used. This can lead to unusual sur-
face behaviors such as uneven boundaries between
objects that intersect at a very shallow angle; this is
called z-fighting, . This is illustrated in Figure 1.10, which shows two quads that
differ in depth by only a very small amount; you can see that there is no con-
sistent calculation of depth priority for the polygons. Blending uses the alpha
value for each pixel, from the color seting, material deinition, or alpha com-
ponent of the texture, and should be familiar to you. Masking is handled by
scissors testing, alpha testing, stencil comparison, or other logical operations.
So the overall geometry and rendering processing includes many steps,
but OpenGL organizes them in a reasonable and manageable order and gives
the programmer the tools to do sound basic computer graphics while work-
ing at a relatively high level. The success of OpenGL in making high-quality
computer graphics accessible to the general computing environment is one of
the true success stories in computing—but it has gone about as far as it can
go, and this topic is about the next step in making ever-beter graphics widely
accessible.
Figure 1.10. An illustration of z -ighting,
with the area where two polygons inter-
sect having depth aliasing problems.
Homogeneous Coordinates in the Fixed-Function Pipeline
Homogeneous coordinates are often treated lightly, if at all, in a beginning
graphics course, but it can be very important to understand them in more
advanced work because they affect the way OpenGL works. Homogeneous
coordinates refers to vectors in 4-dimensional real space whose fourth coor-
dinate is often unitary. The components of a vertex have the name conven-
tions ( x , y , z , w ), and a vertex in standard form has w = 1. You may have
used 2D or 3D vertices in your graphics programs, but internally in OpenGL
Search WWH ::




Custom Search