Draping GIS Features on Terrain
A common need is to display conventional 2D GIS features (points, lines,
polygons) on a 3D terrain. The process of projecting a 2D feature on a
3D surface is known as "draping". For very simple features, or a very
flat terrain, this is almost trivial, but for complex features on uneven
terrain, it is difficult to draw the features perfectly.
- Point features are the simplest. There are many ways to indicate a
point on the ground: As a 3D object, as a 2D /3D text label, or as a 2D icon
/ 3D billboard. Regardless of representation, the height of the terrain at
the 2D point is used to compute the 3D point.
simplest approach is to convert each 2D point on the polyline to a 3D point
using the height of the terrain, then draw the resulting 3D polyline as a
series of line segments. That is only sufficient if the terrain is flat, or
the input polyline has vertices at each inflection point of the terrain.
- More sophisticated is to tessellate each segment of the incoming
polyline, and drape each resulting vertex independently. If draping on a
regular grid, a reasonable approximation is to use the grid's horizontal
spacing as the tessellation distance. This handles most cases of uneven
terrain. The example to the right shows a single segment, tessellated and
draped in this fashion.
- A small optimization of the above is to detect and omit vertices of
collinear segments, so that they do not have to be drawn.
- The simplest approach with polygons is again to naively drape each input
vertex, resulting in a 3D polygon. Since the result could be non-planar, it
is advisable to decomposed the polygon, before or after the drape, into
- That is only sufficient if no polygon crosses an uneven part of the
terrain. Otherwise, they will intersect, with the polygon lost under the
- In theory, it should be possible to split geometry of the 2D polygon
into a large set of fragments, along the edges of the underlying geometry
(grid or TIN). Then, each fragment could be draped individually, conforming
to the terrain. However, this is complex and expensive in computation,
memory and graphics bandwidth. There are no known implementations of such
Problems with Draping Geometry
- Z-buffer fighting. If the feature (point, line, or polygon) is
exactly on the terrain surface, it can conflict with the rendering of the
terrain surface itself.
- LOD problems. For terrain systems which use LOD (of any kind), a
feature draped on one level of detail may intersect the terrain whenever the
The most common solution to these problems is to raise the feature
geometry by some offset, such as a few meters. This is usually
visually acceptable if the viewpoint will remain must higher above the
terrain than the offset. If the camera is very low, the offset must be
small so that the feature does not appear to "float" above the terrain.
If the camera is very high, the offset must be large for Z-buffer precision.
Some software (such as Google Earth) deals with this by using a dynamic
offset, raising the feature geometry as the viewpoint elevation increases.
alternative to draping geometry is to draw the features into the 2D texture
map of the terrain, either directly into the base texture, or separate with
multitexturing. This completely avoids much of the complexity and drawbacks
of draping geometry, with no tessellation needed, no offsets and no Z-buffer
- However, the quality is limited to the resolution of the texture.
Sometimes this is acceptable, but often the texture resolution (due to
memory or graphics card limitations) is much less than the screen
resolution, resulting in blocky (aliased) or blurry feature edges.
- The example the right (from Enviro)
shows a single triangle, rendered as a 1024*1024 'additive' texture. Note
how the polygon conforms exactly to the uneven terrain, since it is not
independent of it.
Efficient and Accurate Rendering of Vector Data on Virtual Landscapes
- Proposes a solution which extrudes the vector data to polyhedra and
uses them to create a mask in the stencil buffer, similar to how a
stencil buffer can be used for shadow volumes. It makes use of the
EXT_stencil_two_side. It is algorithmically complex, but claims
to avoid the limitations of conventional geometry and texture approaches
to feature draping.