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.
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:
For an 8-bit grayscale output:
Formula Terms
- : the unit normal vector of the terrain surface, representing slope orientation.
- : the unit light-direction vector, representing the incoming sunlight direction.
- : the dot product, or cosine of the angle between the surface and the light; larger values mean the slope faces the light more directly.
- : 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.- : normalized brightness, usually in the range .
- : final display grayscale value, usually in the range .
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:
- Where the light comes from:
LightDirection,ZenithAngle - How strong the light and shadow are:
LightIntensity,AmbientIntensity - How visible the terrain relief appears:
ElevationFactor,Extrusion
Light Direction: Azimuth and Altitude
These two parameters define the light vector :
Where:
- : solar azimuth
- : 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
LightDirectionmainly changes shadow direction. - Changing
ZenithAnglemainly changes shadow length and perceived relief strength.
Brightness: Ambient and Direct Light
These parameters control the relationship between highlights and shadows:
- 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
LightIntensityand moderately lowerAmbientIntensity. - 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:
The two parameters have different roles:
ElevationFactorhandles unit conversion.Extrusionhandles visual exaggeration.
Therefore:
ElevationFactordetermines whether the calculation is realistic.Extrusiondetermines whether the visual relief is strong enough.
As a rule of thumb:
- For small-scale maps or coarse-resolution DEMs, increase
Extrusionmoderately, for example to 5-8, to enhance relief. - For high-resolution DEMs such as 10 m data, 1-2 is usually enough.
Parameter Summary
| Parameter | Name | Common Values* | Mechanism | Effect and Recommendations |
|---|---|---|---|---|
LightDirection | Solar azimuth (°, clockwise from north) | 0-360 (default 315° = northwest) | Controls the incoming light direction and directly determines shadow direction. |
|
ZenithAngle | Solar altitude (°, 0 = horizon, 90 = overhead) | 0-90 (default 45°) | Controls the light angle relative to the ground, determining shadow length and relief strength. |
|
LightIntensity | Direct-light intensity | 0-1 (default 0.7-1.0) | Lambertian coefficient; higher values increase light-dark contrast. |
|
AmbientIntensity | Ambient-light intensity | 0-1 (default 0.6-0.9) | Adds non-directional soft light to shaded areas so they do not become fully black. |
|
ElevationFactor | Elevation factor / elevation-to-planar conversion factor |
| Converts Z elevation into the same dimensional scale as X/Y to avoid distorted normal-vector calculations. |
|
Extrusion | Exaggeration factor | 0-10 (default 1-5) | Works with ElevationFactor to exaggerate terrain relief. |
|
Four Preset Effects
For easier use, iXGIS provides four preset modes.
| Preset | LightDirection | ZenithAngle | LightIntensity | AmbientIntensity | Extrusion* | Use Case |
|---|---|---|---|---|---|---|
| Morning Light | 90° (east) | 20-30° | 0.85 | 0.4 | 2 | Long shadows and strong contrast, emphasizing westward ridge shadows and a dawn atmosphere. |
| Noon | 180° (south) | 70-80° | 0.6 | 0.55 | 1.5 | Shortest shadows and soft relief; suitable as a basemap without dominating the view. |
| Sunset | 270° (west) | 15-25° | 0.9 | 0.35 | 2 | Opposite of morning light, creating a sunset effect with longer eastward valley shadows. |
| Night Light | 315° (northwest) | 60° | 0.3 | 0.7 | 1.5 | Weak 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.