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

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

Implements

Constructors

Properties

Methods

Constructors

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

    Parameters

    • color: ColorRepresentation
    • Optionalnear: number

      Expects a Float

    • Optionalfar: number

      Expects a Float

    Returns Fog

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

Properties

color: Color

Fog color.

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

far: number

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.

1000

isFog

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

This is a constant value

true

name: string

Optional name of the object

(doesn't need to be unique).

""

near: number

The minimum distance to start applying fog.

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

1

Methods

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

    Returns Fog

  • Return Fog data in JSON format.

    Returns any