Fog Node

The Fog node can be used to add realism to your world. It provides atmosphere, creating a mist or a heavy fog depending on the fields specified. This node is a bindable node.

The fields for this node are:

  • color specifies the color of the fog
  • fogType specifies how the fog's density increases with distance. Allowed values are "LINEAR" and "EXPONENTIAL". "LINEAR" fog increases linearly with distance, this provides some degree of depth perception, however the "EXPONENTIAL" fog provides more natural results.
  • visibilityRange defines a distance at which the objects are totally obscured by the fog. Objects which are further away from the user than visibilityRange will have their color changed to color. Objects closer to the user will have their color blended with the color specified , the amount of blending is relative to the distance. A value of 0 means no fog.

    Syntax: 
  • Fog { 

      color 1 1 1  
      fogType "LINEAR"  
      visibilityRange 0


    The position of this node does not affect its scope, i.e. the fog affects all shapes being drawn. The Fog node does not affect the Background, i.e. regardeless of the Fog field values the Background is always visible. To obtain a more realistic effect the Background should be the same color as the Fog.

    In the VRML example provided, the Spheres are placed ten meters apart in the Z axis and a white Background is used.