Documentation/Entity Types/Base/Fog.type

From NeoAxis Engine Wiki

Jump to: navigation, search
Go to higher level
Fog 001.jpg

Contents

Description

This type allows you to achieve the effect of fog in the game.

Like many objects in the game it has settings and properties.

The most important thing that you should know about the fog: it does not create a visible object, as you might have imagined. Fog is a sort of filter that applies to all objects to which the user looks at the moment.

There are two basic types of fog: linear and exponential. Linear fog increases uniformly at a distance, while the exponential increases uniformly exponentially (with each unit of distance increased the fog increases compared with the previous unit).

Linear type of fog

The first type of fog, which we will look at - Linear, is the easiest to understand.

In our example we set up a starting point (LinearStart) in 5 units (meters), and ending poin (LinearEnd) - 200. This means that at a distance of up to 5 units in front of the camera is no fog. Starting with 5 units and up to 200 fog is linearly amplified. In 200 units from the camera fog absorbs everything, and you will not see anything but fog.

Exponential type of fog

Another available type of fog - Exponentional. Here instead of asking the boundary of fog, we specify the density (ExpDensity). The mist will increase exponentially with increasing distance from the camera.

Customize

For adding fog effect need to do the following:

  • In the folder Base choose Fog and click on the editors workspace.
  • Specify the type of fog (Mode), and intensity (ExpDensity, LinearStart and LinearEnd).
  • Also set the color (Color).

Properties

Title Description
Color Responsible for the color of fog. It sets the color.
ExpDensity Responsible for the saturation of the fog. The higher the setting, the greater the density of the fog with increasing distance. The default setting is at 0.003. Works only for the exponential type of fog.
LinearEnd This parameter indicates at what distance from the camera the fog will be in full force. It only works for linear type of fog.
LinearStart This parameter indicates at what distance from the camera the fog will begin to increase linearly. It only works for linear type of fog.
Mode This parameter allows you to choose any of 3 types of fog - Linear (linear), Exp (exponential) and Exp2 (exponential squared).