11.3 Hillshade and 3D Visualisation
Shaded-relief rasters and how to render terrain convincingly in 2D and 3D.
Key takeaways
- Hillshade simulates lighting to give a flat raster the appearance of 3D relief.
- Multi-directional hillshade and relief-shading techniques add depth without distraction.
- Modern 3D visualisation uses meshes, textures, and GPU-accelerated rendering.
Introduction
A DEM is a flat raster of numbers, but human viewers perceive terrain better when it's shaded like a physical model. Hillshade is the classic technique; modern tools extend it with multi-direction lighting and full 3D rendering. This short lesson covers both.
Classical hillshade
Given elevation, slope, aspect, and a sun position (azimuth and altitude), hillshade computes the intensity of incident light per cell. Result: a grey-scale raster that looks like a physical relief model.
1gdaldem hillshade dem.tif hillshade.tif \
2 -z 1 -az 315 -alt 45 -compute_edgesParameters:
-z— vertical exaggeration (1 = true; higher for visual drama).-az— sun azimuth in degrees from north (315 = northwest is conventional).-alt— sun altitude above horizon (45° is standard).-compute_edges— handle raster edges.
The result overlays beautifully with any thematic map:
Hillshade (grey) + thematic layer at 70% opacity = terrain-aware mapWhy northwest illumination?
Convention: our brains interpret shading from above and to the left as a convex surface. Lighting from the southeast inverts the perceived relief (mountains look like valleys). Stick with an azimuth of 315° unless your map is specifically for Southern-Hemisphere perception or artistic effect.
Multi-directional hillshade
Real-world landscapes rarely have a single sun direction. Swiss-style shading uses multiple sun positions averaged together for softer, more realistic shading:
gdaldem hillshade -multidirectional dem.tif md_hillshade.tifOr manual: compute hillshade from two or three sun positions, blend with a weighted average.
Swiss hillshading
Eduard Imhof's Swiss cartographic tradition layers:
- A multi-directional greyscale hillshade.
- A soft blue/purple low-altitude tone.
- Subtle colour gradients.
- Warm lighting on ridges.
Modern digital emulations use the same recipes with tile-aware compositing.
Slope-shading
Symbolising elevation by slope class (flat areas white, steep areas dark) rather than directional lighting gives a lighting-neutral alternative. Useful for scientific publications where sun-direction is arbitrary.
Colour-ramped elevation
Beyond pure hillshade, colour ramps communicate elevation directly:
- Sequential ramp (low = blue, mid = green, high = brown) — hypsometric tint.
- Blended with hillshade for richer maps.
1gdaldem color-relief dem.tif color_table.txt color_dem.tif
2gdal_calc.py -A color_dem.tif -B hillshade.tif \
3 --calc="A*B/255" --outfile=composite.tif3D visualisation
For full 3D:
- QGIS 2.5D / 3D map view — quick exploratory 3D.
- Cesium — browser-based 3D globe.
- Deck.gl — WebGL layers, good for thematic data draped on terrain.
- Blender — high-quality renders for presentations.
- MapLibre 3D terrain — modern browser 3D with hillshade and terrain meshes.
Modern web 3D uses:
- Terrain meshes — triangulated grids from DEM.
- Textures — satellite imagery or thematic maps draped on the mesh.
- Heightmap tiles — terrain-rgb or quantized-mesh formats.
Resolution and exaggeration
Common mistake: using too much vertical exaggeration. A factor of 1.5–2× helps viewers perceive gentle terrain; 10× looks like alien landscape. In mountainous regions, 1.0× may be sufficient.
Remember the CRS unit: a metric DEM with a metric CRS needs no conversion. A DEM in degrees needs adjustment so vertical and horizontal units match at the map centre.
Exporting maps
For print, export at 300 DPI with the hillshade at 60–80% opacity and your thematic layer on top. For the web, use a pre-rendered hillshade tile layer (Mapbox Terrain v2, Natural Earth hypsometric) for performance.
Self-check exercises
1. Why is azimuth 315° the convention for hillshade illumination?
Humans interpret shading from upper-left (NW) as convex (mountains above the plane); shading from lower-right inverts the perception, making peaks look like pits. 315° azimuth with ~45° altitude matches this cognitive bias and produces "readable" terrain. Deviating breaks reader intuition.
2. You drape a choropleth over a hillshade and the colours look muddy. What's the fix?
(1) Reduce the choropleth opacity (70 % is a good start). (2) Use multiply / luminosity blend modes rather than plain overlay. (3) Ensure the hillshade is greyscale (not tinted). (4) Use a muted colour ramp for the choropleth — saturated colours over dark hillshade always look muddy. (5) Consider separating: put hillshade above thematic layer with "multiply" blend.
3. Your 3D globe shows terrain but the mountains look flat. What parameter would you adjust?
Vertical exaggeration (z-factor). In 3D viewers like Cesium or MapLibre, increase the exaggeration from 1.0 to 1.5–2.5 to emphasise relief without caricaturing. Too little and gentle terrain disappears; too much and geography looks cartoonish. Iterate visually.
Summary
- Hillshade is a lighting simulation that turns a DEM into readable terrain.
- NW-315° / 45° is the convention; multi-directional and Swiss shading improve realism.
- Colour ramps + hillshade = classic terrain cartography.
- Modern 3D uses meshes, textures, and GPU rendering in the browser.
Further reading
- Imhof, E. — Cartographic Relief Presentation.
- Patterson, T. — articles on Swiss-style cartography at
shadedrelief.com. - MapLibre terrain documentation.
- QGIS 3D plugin documentation.