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

Example

const scene = new THREE.Scene();
scene.fog = new THREE.Fog(0xcccccc, 10, 15);

See

Implements

Constructors

Properties

Methods

Constructors

  • The color parameter is passed to the Color constructor to set the color property

    Parameters

    • color: ColorRepresentation
    • Optional near: number

      Expects a Float

    • Optional far: number

      Expects a Float

    Returns Fog

    Remarks

    Color can be a hexadecimal integer or a CSS-style string.

Properties

color: Color

Fog color.

Remarks

If set to black, far away objects will be rendered black.

far: number

The maximum distance at which fog stops being calculated and applied.

Remarks

Objects that are more than far units away from the active camera won't be affected by fog.

Default Value

1000

isFog: true

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

Remarks

This is a constant value

Default Value

true

name: string

Optional name of the object

Remarks

(doesn't need to be unique).

Default Value

""

near: number

The minimum distance to start applying fog.

Remarks

Objects that are less than near units from the active camera won't be affected by fog.

Default Value

1

Methods

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

    Returns Fog

  • Return Fog data in JSON format.

    Returns any