489
tion value is usually γcorr = 1/2.2 = 0.455. These gamma encoding and decoding
curves are shown in Figure 10.62.
Gamma encoding can be performed by the 3D rendering engine to ensure
that the values in the fi nal image are properly gamma-corrected. One problem
that is encountered, however, is that the bitmap images used to represent tex-
ture maps are oft en gamma-corrected themselves. A high-quality rendering
engine takes this fact into account, by gamma-decoding the textures prior to
rendering and then re-encoding the gamma of the fi nal rendered scene so that
its colors can be reproduced properly on-screen.
10.4.6. Full-Screen Post Effects
Full-screen post eff ects are eff ects applied to a rendered three-dimensional
scene that provide additional realism or a stylized look. These eff ects are of-
ten implemented by passing the entire contents of the screen through a pixel
shader that applies the desired eff ect(s). This can be accomplished by render-
ing a full-screen quad that has been mapped with a texture containing the
unfi ltered scene. A few examples of full-screen post eff ects are given below:
z Motion blur. This is typically implemented by rendering a buff er of
screen-space velocity vectors and using this vector fi eld to selectively
blur the rendered image. Blurring is accomplished by passing a con-
volution kernel over the image (see “Image Smoothing and Sharpening
by Discrete Convolution” by Dale A. Schumacher, published in [4], for
details).
Figure 10.62. Gamma encoding and decoding curves. Image courtesy of http://www.wikipedia.org.
10.4. Visual Effects and Overlays