ArticleslgStudy

computer science

Heightmap

Heightmap is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Heightmap rather than just read about it. In short: In computer graphics, a heightmap or heightfield is a raster image used mainly as Discrete Global Grid in secondary elevation modeling. Each pixel stores values, such as surface elevation data, for display in 3D computer graphics.

Heightmap — main illustration
Heightmap — illustration

Key takeaways

  • Heightmap belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Heightmap to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Heightmap from memory before moving on to harder problems.

Reference excerpt

In computer graphics, a heightmap or heightfield is a raster image used mainly as Discrete Global Grid in secondary elevation modeling. Each pixel stores values, such as surface elevation data, for display in 3D computer graphics. 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 or "height" from the "floor" of a surface and sometimes visualized as luma of a grayscale 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 formats such as Daylon Leveller, GenesisIV and Terragen 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, 2563 = 16,777,216 heights can be represented (2564 = 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 systems, where they are called digital elevation models.

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. Another method is to reconstruct heightmaps from real world data, for example using synthetic aperture radar.

Use Heightmaps are widely used in terrain rendering software and modern video games. 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 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 voxels rendered with ray casting. In most newer games, the elements represent the height coordinate of polygons in a mesh.

Rendering software Terragen – terrain renderer Picogen – terrain renderer and heightmap creation tool Materialize – Free PBR (Physically Based Rendering) creation tool

Generating 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 Digital elevation model Draw distance Range imaging Texture splatting

References

External links POV-Ray : Documentation : 2.4.1.5 Height Field :3DGrayscale - Understanding 3D Heightmaps

Illustrations

Heightmap: A heightmap created with Terragen
A heightmap created with Terragen
Heightmap: The same heightmap converted to a 3D mesh and rendered with Anim8or
The same heightmap converted to a 3D mesh and rendered with Anim8or
Heightmap: Height map of planet earth at 2km per pixel, including oceanic bathymetry information, normalized as 8-bit grayscale
Height map of planet earth at 2km per pixel, including oceanic bathymetry information, normalized as 8-bit grayscale

Worked examples

Example 1 — a first encounter with Heightmap

Start with the simplest possible case. Write down what Heightmap claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Heightmap before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Heightmap ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Heightmap

In research
Heightmap appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Heightmap in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Heightmap is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer graphics data structures, Digital elevation models, so understanding it makes those chapters shorter.
In everyday life
Look for Heightmap outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Heightmap in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Heightmap means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Heightmap out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Heightmap in simple terms?

In computer graphics, a heightmap or heightfield is a raster image used mainly as Discrete Global Grid in secondary elevation modeling. Each pixel stores values, such as surface elevation data, for display in 3D computer graphics.

Why does Heightmap matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Heightmap?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Heightmap.

Tags

  • Computer graphics data structures
  • Digital elevation models

Keep exploring