Overlaying a grid on to a height map What is the method used in overlaying a grid (agonostic of the grid type) on to a height map? It seems it's some sort of projection, but what are the technical details in how to implement it?

An example here is a hexagon grid overlayed onto the map in Civ5 that nicely handles spatial distance regardless of how high the height map is at a position -
Deferred decals are a common way to achieve this without re-rendering the same geometry. It also allows you to change the appearance, i.e. add some gap or smooth out the details.

The algorithm:


Draw a box around your height field, the size should be as tight as possible to avoid over draw. 
sample the depth buffer to get the world-space position of the current pixel (the height field / other geo)
Project your box down in world space
Use the projected box coordinate to sample from your overlay texture.