Global Fog
Manual     Reference     Scripting   
Reference Manual > Image Effect Scripts > Global Fog

Global Fog

The Global Fog image effect creates camera-based exponential fog. All calculations are done in world space which makes it possible to have height-based fog modes that can be used for sophisticated effects (see example).


Example of global fog, demonstrating both distance and height based fog

Example of "cheating" at atmospheric effects using global fog

As with the other image effects, this effect is only available in Unity Pro and you must have the Pro Standard Assets installed before it becomes available.

Properties

Fog ModeThe available types of fog, based on distance, height or both
Start DistanceThe distance at which the fog starts fading in, in world space units.
Global DensityThe degree to which the Fog Color accumulates with distance.
Height ScaleThe degree to which the fog density reduces with height (when height-based fog is enabled).
HeightThe world space Y coordinate where fog starts to fade in.
Global Fog ColorThe color of the fog.

Hardware support

This effect requires a graphics card with pixel shaders (2.0) or OpenGL ES 2.0. Additionally, depth texture support is required. PC: NVIDIA cards since 2004 (GeForce 6), AMD cards since 2004 (Radeon 9500), Intel cards since 2006 (GMA X3000); Mobile: OpenGL ES 2.0 with depth texture support; Consoles: Xbox 360, PS3.

All image effects automatically disable themselves when they can not run on end-users graphics card.

Page last updated: 2011-09-19