• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Fog

Fog is a surprisingly useful feature that can increase the realism of your scenes and improve their performance by allowing you to reduce the amount of detail required in the distance. In the real world, distant objects seem to fade slightly because the light reflected from them has to travel farther through the earth's atmosphere (see Chapter 3, "Entering the Third Dimension" for details). Depending on the atmospheric conditions, this fading effect can be quite extreme. This fog effect is sometimes called "depth cueing" (since it gives the brain a visual cue as to the depth of an object in the scene) and it is implemented in Java 3D by simply blending the fog color with the objects in the scene based on distance from the viewer. The farther away a particular pixel on the screen is from the viewpoint (in terms of Z-depth), the more it gets blended with the fog color.

Like VRML, Java 3D supports two basic types of fog. Linear fog has a constant density, so that an object that's twice as far away appears to be twice as "fogged" (see Tables 15.6, Table 15.7, Table 15.8). Exponential fog has a density value that can be set by your application (see Tables 15.9, Table 15.10, Table 15.11). In general, linear fog is useful for depth cueing, while exponential fog is better for simulating atmospheric effects (see Chapter 9, "Customizing Light, Back-ground, Fog, and Sound," to learn more about linear and exponential fog types used by VRML).


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint