Skip to main content

Terrain Height Map

Verifies the image against terrain height map characteristics.

Parameter table

No parameter available.

Detailed description

This rule checks if the provided image can be classified as a terrain height map. A terrain height map is a grayscale image representing elevation data with varying intensities of pixels.

To assess whether an image is a terrain height map, we analyze the gradient magnitudes across the image. A true terrain height map should have smooth transitions in elevation, which reflect in low gradient magnitudes.

The specific criteria used to evaluate an image are:

  • The gradient magnitude of each pixel, calculated as the squared norm, should predominantly fall below the threshold of 0.03 (on a normalized scale of 0 to 1, relative to the maximum pixel intensity value).
  • A small percentage of gradients can exceed this threshold, but if more than 10% do, the image likely does not represent a realistic terrain height map.

Through this analysis, we can determine the likelihood of the image being a terrain height map. An image meeting these criteria is likely to be a good representation of terrain elevation.

Creator tips

  • When creating a terrain height map, ensure that the grayscale values accurately represent the elevation levels.

  • Use a smooth gradient that allows to represent the gradual change in topography. Sharp transitions in grayscale values might not represent a realistic height map.

  • To create more detailed and accurate terrain height maps, consider using specialized software like AwesomeBump. AwesomeBump is an open-source program that can convert images to height maps and normal maps, among other features. It can help in refining the texture to better suit the requirements of a height map.

Pay attention to the gradient magnitudes across your height map and adjust the texture accordingly to avoid sharp elevation changes unless they are a specific feature of your terrain.

Remember to test your height map in the context of your 3D application to ensure it behaves as expected when applied to a surface.

Examples

valuevaliddescription
mountainsThe image should represent a smooth transition in elevation, typical of a terrain height map.
sharpThe image should not feature abrupt elevation changes, uncharacteristic of a terrain height map.