Game Development Reference
In-Depth Information
Flares can also be caused by bright light passing through partially
transparent materials such as glass or reflected off shiny surfaces
such as polished metal and water.
7.4.9 Color Correction
Color correction does as its name suggests. It takes certain colors occurring
in an image and changes them to another color. For example, a hill covered
in green grass could be made to look like a hill of dead brown grass
by replacing the color green with brown.
In games, color correction can be used for rendering night vision effects,
changing most of the colors to green as shown in Figure 7.30 . Each R, G,
B value is matched with a replacement R, G, B value. At any time, color
correction, as with all these effects, can be turned off. Using this method
you could simulate the well-known Splinter Cell game play where the main
character can use his night vision goggles in dark environments, which
changes what the player sees on the screen at a press of a button.
7.4.10 Edge Detection
An edge detection algorithm scans an image for areas where pixels
in close proximity contrast in color. Because the difference between
individual pixels would produce erratic effects, the algorithm must
determine if a pixel is on the edge of an area of similar color by looking
at its surrounding pixels. This creates a picture that looks like a sketched
outline.
The optimal approach to edge detection is the Canny edge detection
algorithm. Further technical details about it can be found at http://
pages.drexel.edu/~weg22/can_tut.html .
The edge detection algorithm in Unity outlines all objects with a black line
as shown in Figure 7.30 .
7.4.11 Crease
Creasing is a nonphotorealistic effect that increases the visibility of game
world objects by drawing a line around the silhouette, much like in comic
book images. In a busy game environment with many objects, such as
buildings and trees, drawn from similar colors and tones, objects can become
difficult to distinguish. By applying creasing at differing depths, the line can
distinguish between near and far objects.
The example from Unity shown in Figure 7.30 has drawn a line around the
top edge of the mountains, thus distinguishing them even more from
the skybox.
Search Nedrilad ::




Custom Search