FogExp2 - Verge3D User Manual - Soft8Soft
Description: Learn how to use FogExp2 in your interactive 3D apps made with Verge3D

# FogExp2

This class defines exponential squared fog. This for gives a clear view near the camera and a faster than exponentially densening fog farther from the camera.

## Constructor

### FogExp2(color : Color, density : 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

### # .isFogExp2 : Boolean

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

### # .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 red, far away objects will be rendered red.

### # .density : Float

Defines how fast the fog will grow dense.

Default is `0.00025`.

## Methods

### # .clone() → FogExp2

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

## Puzzles

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

## Source

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