Fog

This class contains the parameters that define linear fog, i.e., that grows linearly denser with the distance.

Constructor

Fog(color : Color, near : Float, far : Float)

The color parameter is passed to the Color constructor to set the color property. Color can be a hexadecimal integer or a CSS-style string.

Properties

.isFog : Boolean

Read-only flag to check if a given object is of type Fog.

.name : String

Optional name of the object (doesn't need to be unique). Default is an empty string.

.color : Color

Fog color. Example: If set to black, far away objects will be rendered black.

.near : Float

The minimum distance to start applying fog. Objects that are less than 'near' units from the active camera won't be affected by fog.

Default is 1.

.far : Float

The maximum distance at which fog stops being calculated and applied. Objects that are more than 'far' units away from the active camera won't be affected by fog.

Default is 1000.

Methods

.clone() → Fog

Returns a new fog instance with the same parameters as this one.

Puzzles

Check out the add fog puzzle to enable the linear fog effect in a visual way.

Source

For more info on how to obtain the source code of this module see this page.