Terrain analysis

Generating hillshade

Compute a shaded relief with your choice of sun azimuth, altitude and z factor, show it on its own or blended into the colours, and export it.

Beginner5 min readChapter 17 of 35

You will learn

  • Compute hillshade and understand its values.
  • Choose sun azimuth, altitude and z factor.
  • Blend hillshade into other colourings and export it.

Prerequisites

Data for this tutorial

Nanda Devi massif, SRTM (real terrain) Download nanda-devi-srtm-1arcsec.tif

Format
GeoTIFF, 1 band, Int16, Deflate, tiled
CRS
EPSG:4326 (WGS 84, longitude/latitude)
Content
Elevations 2285 to 7801 m above the EGM96 geoid; lon 79.7276 to 79.9776, lat 30.2279 to 30.4779
In Orbis3D
Data panel ▸ Sample data ▸ Nanda Devi massif, SRTM (real terrain) ▸ Load
Licence
SRTM 1 arc-second, NASA/USGS, public domain

Synthetic samples are CC0 1.0; the SRTM sample is public domain. About the datasets

The task

You want a classic grey shaded relief of Nanda Devi, lit from the north-west, both as a view and as a raster for a map.

How hillshade is computed

Hillshade is the brightness of the ground under a distant sun: the cosine of the angle between the surface's normal and the direction of the sun. Orbis3D uses the slopes from Horn's method (as for slope):

hillshade = (sin(alt) − cos(alt) · (dz/dx · sin(az) + dz/dy · cos(az))) / √(1 + (dz/dx)² + (dz/dy)²)

The result runs from 0 (facing away from the sun, in shade) to 1 (facing the sun). Negative values (self-shadowed slopes) become 0. Cast shadows from neighbouring ridges are not part of hillshade; use Scene ▸ Lighting ▸ Cast shadows for those in the 3D view.

Steps

  1. Load Nanda Devi massif.
  2. Open Analysis ▸ Hillshade. The defaults are Sun azimuth 315° (north-west), Sun altitude 45°, Z factor 1 and Compute edges on.
  3. Click Show hillshade (or Compute hillshade). The terrain turns grey, lit from the north-west.

Hillshade of Nanda Devi with the sun in the north-west at 45°
Hillshade, sun azimuth 315° and altitude 45°.

  1. Change the sun: a lower altitude (for example 25°) gives more contrast; an azimuth of 315° keeps the illusion that ridges stand up. Lighting from the south (around 135°–225°) often makes valleys look like ridges.
  2. Raise the Z factor (for example 2) to strengthen the shading of gentle terrain.
  3. To combine the relief with colours, go to the Surface tab, choose Colour by ▸ Elevation (or slope) and set Blend over colours under Hillshade. Orbis3D uses this blend at 45 % by default.
  4. Export the hillshade with Export raster: as GeoTIFF it is a Byte raster from 1 (shade) to 255 (lit) with 0 as NoData, the same encoding as gdaldem hillshade.

Expected result

A grey relief with bright north-west-facing slopes and dark south-east-facing slopes. The mean illumination of Nanda Devi is 0.58 with the default sun.

Notes

  • The hillshade sun (Analysis or Surface tab) and the 3D sun (Scene ▸ Lighting) are separate. Match hillshade sun in the Scene tab aligns them.
  • Orbis3D's hillshade agrees with gdaldem hillshade to within one grey level in the test suite.

Common mistakes

  • Relief looks inverted. The sun is in the south. Use an azimuth between 270° and 360°.
  • Very flat result. The DEM is gentle or in feet. Raise the z factor or set the elevation unit.