Fog

The fog message can be used to create effects ranging from a gentle haze to a thick mist. You can control how dense the fog is and what color it is - make it blue for underwater scenes, black for nighttime scenes, red for evil toxic miasmas ...

The fog message takes 6 parameters:

fog ( type r g b onsetDistance opaqueDistance )

type: lin, exp, or exp2. This controls how the fog is simulated. the lin setting, for linear, makes the fog get denser evenly over distance. The exp setting, exponential, makes it get exponentially thicker over distance, which is closer to how fog looks in the real world. exp2 is a doubly-exponential setting for exaggerated effect. linear fog is faster, but exponential is a little more realistic.

r g b: the color of the fog, in red, green, and blue values. Each color value is from 0 to 1.

onsetDistance: the distance at which the fog begins, measured in feet.

opaqueDistance: the distance at which the fog is completely opaque.

 

example:

environment (volume(infinite), fog (lin .7 .7 1 10 100))

this fog is linear, and a light blue-gray color. Everything closer than 10 feet is clear, and the fog gets denser from 10 feet to 100 feet away. Everything more than 100 feet away is completely hidden by fog.

 

NOTE: fog doesn't do much unless you have objects in the scene.

SPEED HINT: if you use fog, you can set the far clip plane to the opaque distance of the fog, since everything further away will obscured by the fog anyway!

NOTE: this type of fog is not textured and doesn't move, unlike real fog.


(c) Ben Chang