fog

Note: This documentation is for the old 0.2.0 version of A-Frame. Check out the documentation for the current 0.5.0 version

The fog component obscures entities in fog given distance from the camera. The fog component applies only to the <a-scene> element.

Example

<a-scene fog="type: linear; color: #AAA"></a-scene>

Properties

Given the type of fog distribution, different properties will apply.

PropertyDescriptionDefault Value
typeType of fog distribution. Can be linear or exponential.linear
colorColor of fog. For example, if set to black, far away objects will be rendered black.#000

Linear Fog

Linear fog grows linearly denser with distance.

PropertyDescriptionDefault Value
nearMinimum distance to start applying fog. Objects closer than this won’t be affected by fog.1
farMaximum distance to stop applying fog. Objects farther than this won’t be affected by fog.1000

Exponential Fog

Exponential fog grows exponentially denser with distance.

PropertyDescriptionDefault Value
densityHow quickly the fog grows dense.0.00025

Excluding a Material from Fog

To not apply fog to certain entities, we can disable fog for certain materials.

<a-entity material="fog: false"></a-entity>