Graphics Reference
In-Depth Information
eighth-size, etc.) until an image with all dimensions equal to one results. If the
dimensions of the original image differ, smaller dimensions reach unit length
early—they remain unit length until the algorithm terminates.
Triangle rasterization generates pixel fragments in groups of four, called quad
fragments, with each group corresponding to a 2
2-pixel framebuffer region.
The sole purpose of rasterizing to quad fragments is to allow sample-to-sample
separations to be computed reliably and inexpensively. 8 Separations in 1D textures
are simple differences. Separations in 2D and 3D textures are correctly computed
as square roots of summed squares of differences, but conservative approxima-
tions such as sum of differences are sometimes employed to reduce computation.
Both left-to-right and top-to-bottom separations are computed. From these separa-
tions a single representative separation
×
1, the texture image
is sampled sufficiently—texture image interpolation is performed on the original
texture image and the resultant color is returned.
If
ρ
is computed. If
ρ ≤
1, interpolation of the original texture image may result in aliasing.
But interpolation of the first MIP-map image (half-size) will alias only if
ρ>
2,
and interpolation of the second MIP-map image (quarter-size) will alias only if
ρ>
ρ>
4. Thus, aliasing is always avoided when interpolation is performed on the
n th MIP-map image, where n =
.
While interpolating the n th MIP-map image in isolation avoids aliasing, it
introduces artifacts of its own, especially in dynamic 3D graphics, because screen-
adjacent pixels for which different values of n are computed will be colored by
different MIP-map images, and these discontinuities will move with object and
camera movements. An additional interpolation is required to avoid this. 9 Both the
n th and the ( n
log 2 ρ
1 ) th MIP-map images are interpolated ( n = 0 implies the original
texture image). Then these two interpolated values are themselves interpolated,
using
as the weighting factor. The term trilinear MIP mapping
is sometimes used to describe this common MIP-mapping algorithm, when it is
applied with 2D texture images, because interpolation is done in three dimensions:
two spatial and one between images. But this term is imprecise and should be
avoided because, for example, a 3D texture sampled at only one MIP-map level is
also trilinearly interpolated.
Texture mapping algorithms in modern GPUs are immensely complicated—
many important details have been simplified or even ignored in this short discus-
sion. For a concise but fully detailed description of texture mapping, or indeed of
any particular of GPU architecture, refer to the OpenGL specification. The latest
version of this specification is always available at www.opengl.org.
log 2 ρ−
log 2 ρ
38.6.2 Memory Basics
To understand how and why memory access complicates the implementation of
high-performance GPUs, and in particular their texture-mapping capability, we
now detour into the study of memory itself.
8. There are costs associated with quad-fragment rasterization too. See Fatahalian et al.
[FBH + 10] for an example.
9. This problem and its solution are a recurring theme in dynamic 3D graphics: Any
algorithm that can introduce frame-to-frame discontinuities is interpolated to avoid
them.
 
Search WWH ::




Custom Search