A real-time algorithm for constructing contour maps from grid DEM data is pre-sented. It runs completely within the pro grammable 3D visualization pipeline. The interpolation is paralleled by rasterizer units in the graphics card, and contour litw extraction is paralleled by pixel shader. During each frame of the rendering, we first make an elevation gradient map out of original terrain vertex data, then figure out the final contour lines with image-space processing, and directly blend the result on the original scene to obtain a final scene with contour map using alpha-blending. We implement this method in our globa 3D-digitalearth system with Direct3D®9.0c API and tested on some consumer level PC platforms. For arbitrary scene witl certain LOD level, the process takes less than 10 ms, giving topologically correct, anti-aliased contour lines.