Table of Contents

Mask maps and generators

Mask maps

Mask maps are greyscale images, such as that shown below, that are used in game engines to mask user-defined quantities such as grass coverage, vehicle accessibility, tiberium density, etc. A mask map is typically an 8-bit greyscale image.

:l3dt:algorithms:masks:maskexample.png
An example mask map, for grass coverage.

Mask generators

In L3DT, mask generators are objects that create a mask maps. They do this by calculating a 'score' at each pixel using a set of parameters and weightings for terrain altitude and slope (gradient), water depth and salinity, and land type coverage. The parameters in a mask generator parameters may be viewed and edited using the mask editor window, shown below:

The 'mask editor' window.

Minimum, maximum and ramp settings

For each of the altitude, gradient, water depth and salinity parameters, there is defined a minimum and maximum value, as well as a 'ramp' for each, and a weighting for the overall parameters.

The meaning of the minimum, maximum and ramp values shall now be explained using the altitude settings in the above example image:

Parameter weighting

This section is under construction! FIXME

Land type settings

This section is under construction! FIXME

Further calculation details

For each mask parameter, a score between 0 and 1 is generated. The total score is calculated from the product of the scores of each mask parameter, and is then rescaled to a range of 0…255 for storage as an 8-bit image.