In
computer graphics
Computer graphics deals with generating images with the aid of computers. Today, computer graphics is a core technology in digital photography, film, video games, cell phone and computer displays, and many specialized applications. A great deal ...
, a heightmap or heightfield is a
raster image
upright=1, The Smiley, smiley face in the top left corner is a raster image. When enlarged, individual pixels appear as squares. Enlarging further, each pixel can be analyzed, with their colors constructed through combination of the values for ...
used mainly as
Discrete Global Grid
A discrete global grid (DGG) is a mosaic that covers the entire Earth's surface.
Mathematically it is a space partitioning: it consists of a set of non-empty regions that form a partition of the Earth's surface. In a usual grid-modeling strate ...
in
secondary elevation modeling. Each pixel stores values, such as surface
elevation
The elevation of a geographic location is its height above or below a fixed reference point, most commonly a reference geoid, a mathematical model of the Earth's sea level as an equipotential gravitational surface (see Geodetic datum § ...
data, for display in
3D computer graphics
3D computer graphics, or “3D graphics,” sometimes called CGI, 3D-CGI or three-dimensional computer graphics are graphics that use a three-dimensional representation of geometric data (often Cartesian) that is stored in the computer for t ...
. A heightmap can be used in
bump mapping to calculate where this 3D data would create shadow in a material, in
displacement mapping to displace the actual geometric position of points over the textured surface, or for terrain where the heightmap is converted into a 3D mesh.
A heightmap contains one
channel interpreted as a distance of
displacement
Displacement may refer to:
Physical sciences
Mathematics and Physics
*Displacement (geometry), is the difference between the final and initial position of a point trajectory (for instance, the center of mass of a moving object). The actual path ...
or "height" from the "floor" of a surface and sometimes
visualized as
luma of a
grayscale
In digital photography, computer-generated imagery, and colorimetry, a grayscale image is one in which the value of each pixel is a single sample representing only an ''amount'' of light; that is, it carries only intensity information. Graysc ...
image, with black representing minimum height and white representing maximum height.
When the map is rendered, the designer can specify the amount of displacement for each unit of the height channel, which corresponds to the “contrast” of the image.
Heightmaps can be stored by themselves in existing grayscale image formats, with or without specialized
metadata,
or in specialized
file format
A file format is a Computer standard, standard way that information is encoded for storage in a computer file. It specifies how bits are used to encode information in a digital storage medium. File formats may be either proprietary format, pr ...
s such as
Daylon Leveller,
GenesisIV and
Terragen
Terragen is a scenery generator program for Microsoft Windows and Mac OS X developed and published by Planetside Software. It can be used to create renderings and animations of landscapes.
History
Released in stages (tech preview and bet ...
documents.
One may also exploit the use of individual color channels to increase detail. For example, a standard RGB 8-bit image can only show 256 values of grey and hence only 256 heights. By using colors, a greater number of heights can be stored (for a 24-bit image, 256
3 = 16,777,216 heights can be represented (256
4 = 4,294,967,296 if the alpha channel is also used)). This technique is especially useful where height varies slightly over a large area. Using only grey values, because the heights must be mapped to only 256 values, the rendered terrain appears flat, with "steps" in certain places.
Heightmaps are commonly used in
geographic information system
A geographic information system (GIS) is a type of database containing geographic data (that is, descriptions of phenomena for which location is relevant), combined with software tools for managing, analyzing, and visualizing those data. In a ...
s, where they are called
digital elevation model
A digital elevation model (DEM) or digital surface model (DSM) is a 3D computer graphics representation of elevation data to represent terrain or overlaying objects, commonly of a planet, moon, or asteroid. A "global DEM" refers to a discre ...
s.
Creation
Heightmaps can be created by hand with a classical paint program or a special terrain editor. These editors visualize the terrain in 3D and allow the user to modify the surface. Normally there are tools to raise, lower, smooth or erode the terrain. Another way to create a terrain is to use a terrain generation algorithm. This can be for example a 2D
simplex noise function or by
diffusion-limited aggregation
Diffusion-limited aggregation (DLA) is the process whereby particles undergoing a random walk due to Brownian motion cluster together to form aggregates of such particles. This theory, proposed by T.A. Witten Jr. and L.M. Sander in 1981, is a ...
. Another method is to
reconstruct heightmaps from real world data, for example using
synthetic aperture radar
Synthetic-aperture radar (SAR) is a form of radar that is used to create two-dimensional images or three-dimensional reconstructions of objects, such as landscapes. SAR uses the motion of the radar antenna over a target region to provide fine ...
.
[Kirscht, Martin, and Carsten Rinke]
"3D Reconstruction of Buildings and Vegetation from Synthetic Aperture Radar (SAR) Images."
MVA. 1998.
Use
Heightmaps are widely used in
terrain rendering software and modern
video game
Video games, also known as computer games, are electronic games that involves interaction with a user interface or input device such as a joystick, game controller, controller, computer keyboard, keyboard, or motion sensing device to gener ...
s. Heightmaps are an ideal way to store digital terrain elevations; compared to a regular polygonal mesh, they require substantially less memory for a given level of detail. Most modern 3D computer modelling programs are capable of using data from heightmaps in the form of
bump,
normal, or
displacement
Displacement may refer to:
Physical sciences
Mathematics and Physics
*Displacement (geometry), is the difference between the final and initial position of a point trajectory (for instance, the center of mass of a moving object). The actual path ...
maps to quickly and precisely create complex terrain and other surfaces.
In the earliest games using software rendering, the elements often represented heights of columns of
voxel
In 3D computer graphics, a voxel represents a value on a regular grid in three-dimensional space. As with pixels in a 2D bitmap, voxels themselves do not typically have their position (i.e. coordinates) explicitly encoded with their values. ...
s rendered with
ray casting.
In most newer games, the elements represent the height coordinate of
polygons in a mesh.
Rendering software
*
Terragen
Terragen is a scenery generator program for Microsoft Windows and Mac OS X developed and published by Planetside Software. It can be used to create renderings and animations of landscapes.
History
Released in stages (tech preview and bet ...
– terrain renderer
*
Picogen – terrain renderer and heightmap creation tool
* Materialize – Free PBR (
Physically Based Rendering) creation tool
Generating software
{{main, Scenery generator#Software
Trivia
Although the terms heightmap and heightfield are often indistinguishable from each other, there is still a small difference in the terms. Heightmap comes from the mathematical term 'map' and heightfield comes from the mathematical term 'vector field'. Heightmap is the more correct description because most heightfields are not a (vector) field in mathematical terms but they are always a map (in mathematical terms as well as in the visual representation).
See also
*
3D scanner
3D scanning is the process of analyzing a real-world object or environment to collect data on its shape and possibly its appearance (e.g. color). The collected data can then be used to construct digital 3D models.
A 3D scanner can be based on m ...
*
Range imaging
Range imaging is the name for a collection of techniques that are used to produce a 2D image showing the distance to points in a scene from a specific point, normally associated with some type of sensor device.
The resulting range image has pix ...
*
Digital elevation model
A digital elevation model (DEM) or digital surface model (DSM) is a 3D computer graphics representation of elevation data to represent terrain or overlaying objects, commonly of a planet, moon, or asteroid. A "global DEM" refers to a discre ...
References
External links
POV-Ray : Documentation : 2.4.1.5 Height Field
Computer graphics data structures