Vizard 7 » Reference » Scenes » Adding fog
7.6

Adding fog

Fog can add significantly to the experience of depth within a world. You can add fog either in your script, or through Inspector.

 

There are four main properties for fog:

Property

Description

mode

Fog can be rendered either in a linear or exponential relationship to the distance from the observer.

color

Sets the color of the fog.

range

Sets the beginning and ending distances of the fog from the observer.

density

Sets the density of the fog.

You can add fog within your script using the <scene>.fog command. The fog equations used depend on the parameters supplied. If range values are given, then linear fogging is enabled in which no fog appears before start distance from the observer and 100% density is reached at end distance from the observer. If a density is given, then an exponential drop-off function is used as continuous from 0 to infinity.

# Set fog color to gray
viz.MainScene.fogColor([0.5,0.5,0.5])

# Use linear fog that start from 1 meter in front of the user
# And at 10 meters in front of the user
viz.MainScene.fog(1,10)

# Use exponential fog
viz.MainScene.fog(0.2)

See also

In this section:

Scene basics

Scene Command Table

Other sections:

Viewpoints & windows basics

Window basics

Tutorial: 360 panoramas