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.
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.
EXT_stencil_wrap
and
EXT_stencil_two_side
. It is algorithmically complex, but claims
to avoid the limitations of conventional geometry and texture approaches
to feature draping.