This effect is commonly used in order to show to the player the field of view of enemy troops. It was a main element in the game mechanic of games like Commandos and Desperados.
The effect can also be modified in order to create a rudimentary torch light.
The shader uses a quad with its center located at the viewer's eyes, so the cone is drawn in that specific quad. That means it isn't projected on the level/terrain surface.
The shader is highly customizable, see below some of the variations that can be achieved.