Skip to main content
Back to Articles
ArticleMethods and Cartography
October 16, 2025/7 min read

How to Configure Hillshade

Hillshade is a common terrain visualization technique in GIS. It simulates terrain brightness under sunlight from a DEM so relief is easier to read. This post explains how to configure hillshade in iXGIS.

Raster

What Is Hillshade?

Hillshade is a common terrain visualization technique in geographic information systems (GIS). It uses a digital elevation model (DEM) to simulate the light and shadow produced by sunlight over terrain, making elevation changes easier to see.

Core Principle

Hillshade applies a simplified lighting model to a DEM. For each pixel, the system estimates the local surface orientation from surrounding elevation changes, determines whether the surface faces toward or away from the light source, and then calculates brightness.

The calculation can be summarized as:

DEM (elevation raster)
-> calculate local slope and aspect
-> compute surface normal N
-> compute light vector L from sun parameters
-> calculate brightness I
-> convert to grayscale Gray

The core brightness formula is:

I=clamp(max(0,NL)×LightIntensity+AmbientIntensity, 0, 1)I = \operatorname{clamp}\Big(\max(0,\,N \cdot L) \times \text{LightIntensity} + \text{AmbientIntensity},\ 0,\ 1\Big)

For an 8-bit grayscale output:

Gray=255×IGray = 255 \times I

Formula Terms

  • NN: the unit normal vector of the terrain surface, representing slope orientation.
  • LL: the unit light-direction vector, representing the incoming sunlight direction.
  • NLN \cdot L: the dot product, or cosine of the angle between the surface and the light; larger values mean the slope faces the light more directly.
  • max(0,NL)\max(0, N \cdot L): back-facing slopes may produce negative values, which are usually clipped to 0 to indicate no direct light.
  • LightIntensity: direct-light intensity, used to control highlight contrast.
  • AmbientIntensity: ambient-light intensity, used to preserve detail in shadowed areas and prevent them from becoming completely black.
  • II: normalized brightness, usually in the range [0,1][0,1].
  • GrayGray: final display grayscale value, usually in the range [0,255][0,255].

In simple terms:

  • Direct light determines where terrain is bright and how bright it is.
  • Ambient light determines whether details remain visible in shadow.
  • Together they form the final hillshade effect.

Parameter Overview

The parameters can be grouped into three categories:

  1. Where the light comes from: LightDirection, ZenithAngle
  2. How strong the light and shadow are: LightIntensity, AmbientIntensity
  3. How visible the terrain relief appears: ElevationFactor, Extrusion

Light Direction: Azimuth and Altitude

These two parameters define the light vector LL:

L=(sinAzcosZ, cosAzcosZ, sinZ)L = (\sin A_z \cos Z,\ \cos A_z \cos Z,\ \sin Z)

Where:

  • AzA_z: solar azimuth
  • ZZ: solar altitude

In the parameter settings:

  • LightDirection (Azimuth): the solar azimuth, indicating the direction from which light comes. For example, 315° means light from the northwest.
  • ZenithAngle (Altitude): this parameter actually represents solar altitude. Lower values produce longer shadows; higher values produce shorter shadows.

Visual effects:

  • Changing LightDirection mainly changes shadow direction.
  • Changing ZenithAngle mainly changes shadow length and perceived relief strength.

Brightness: Ambient and Direct Light

These parameters control the relationship between highlights and shadows:

Ilight=max(0,NL)×LightIntensity+AmbientIntensityI_{light} = \max(0, N \cdot L) \times \text{LightIntensity} + \text{AmbientIntensity}
  • LightIntensity: direct-light intensity. Higher values make light-facing slopes brighter and increase contrast.
  • AmbientIntensity: ambient-light intensity. Higher values soften shadows and preserve shadow detail.

Adjustment guidance:

  • To emphasize relief, increase LightIntensity and moderately lower AmbientIntensity.
  • To preserve shadow detail, increase AmbientIntensity.

Geometric Scale: Elevation-to-Planar Conversion

ElevationFactor handles differences between elevation units and horizontal coordinate units.

Examples:

  • If both horizontal coordinates and elevation are in meters, it is usually set to 1.
  • If horizontal coordinates are longitude/latitude degrees and elevation is in meters, a conversion factor is required; otherwise slope calculations will be distorted.

This parameter controls whether the calculated slope orientation is geometrically realistic. If it is set incorrectly, terrain may look flattened or exaggerated.

Visual Exaggeration: Extrusion

Extrusion is a visual terrain-exaggeration factor used to strengthen relief expression.

In the calculation, it can be understood as:

Z=Z×ElevationFactor×ExtrusionZ' = Z \times \text{ElevationFactor} \times \text{Extrusion}

The two parameters have different roles:

  • ElevationFactor handles unit conversion.
  • Extrusion handles visual exaggeration.

Therefore:

  • ElevationFactor determines whether the calculation is realistic.
  • Extrusion determines whether the visual relief is strong enough.

As a rule of thumb:

  • For small-scale maps or coarse-resolution DEMs, increase Extrusion moderately, for example to 5-8, to enhance relief.
  • For high-resolution DEMs such as 10 m data, 1-2 is usually enough.

Parameter Summary

ParameterNameCommon Values*MechanismEffect and Recommendations
LightDirectionSolar azimuth (°, clockwise from north)0-360 (default 315° = northwest)Controls the incoming light direction and directly determines shadow direction.
  • Morning: 90° (east).
  • Noon from the south: 180°.
  • Common northwest lighting uses 315°, often useful for emphasizing south-facing slopes.
ZenithAngleSolar altitude (°, 0 = horizon, 90 = overhead)0-90 (default 45°)Controls the light angle relative to the ground, determining shadow length and relief strength.
  • Low angle (10°): long shadows and strong relief, but valleys may become too dark.
  • High angle (above 60°): shorter shadows and a softer overall effect.
LightIntensityDirect-light intensity0-1 (default 0.7-1.0)Lambertian coefficient; higher values increase light-dark contrast.
  • Focus on its ratio to AmbientIntensity.
  • Usually LightIntensity + AmbientIntensity is about 1.
  • To emphasize ridges, increase it to about 1.2 and reduce ambient light.
AmbientIntensityAmbient-light intensity0-1 (default 0.6-0.9)Adds non-directional soft light to shaded areas so they do not become fully black.
  • Useful for improving visibility in dark areas.
  • Too high makes shadows gray and reduces relief.
  • Too low makes contrast too strong and loses detail.
  • For a sunset side-light effect, lower it to about 0.3.
ElevationFactorElevation factor / elevation-to-planar conversion factor
  • Longitude/latitude DEM: about 1 / 111 km.
  • Horizontal and elevation units both in meters: 1.
Converts Z elevation into the same dimensional scale as X/Y to avoid distorted normal-vector calculations.
  • For Web Mercator / UTM with DEM elevation also in meters, use 1.
  • For longitude/latitude (°) plus elevation (m), multiply by about 0.000009.
ExtrusionExaggeration factor0-10 (default 1-5)Works with ElevationFactor to exaggerate terrain relief.
  • Higher values make peaks sharper and valleys deeper.
  • 0 means a completely flat hillshade effect.
  • 10 m DEMs often use 1-2; 90 m DEMs can use 5-8.

Four Preset Effects

For easier use, iXGIS provides four preset modes.

PresetLightDirectionZenithAngleLightIntensityAmbientIntensityExtrusion*Use Case
Morning Light90° (east)20-30°0.850.42Long shadows and strong contrast, emphasizing westward ridge shadows and a dawn atmosphere.
Noon180° (south)70-80°0.60.551.5Shortest shadows and soft relief; suitable as a basemap without dominating the view.
Sunset270° (west)15-25°0.90.352Opposite of morning light, creating a sunset effect with longer eastward valley shadows.
Night Light315° (northwest)60°0.30.71.5Weak direct light and stronger ambient light, suitable for dark basemaps or night-style maps.

Configure Hillshade

When using classified coloring for raster data, hillshade can be enabled. The global land-and-sea terrain raster is used here as an example.

The four effects are, in order: Morning Light, Noon, Sunset, and Night Light.

Topic

Methods and Cartography

Terrain representation, map visuals, and practical workflows

Continue Browsing

Back to Articles

Browse all articles, switch topic filters, or continue from the home page.

Browse All Articles