Overlays

A 3D overlay can also be drawn - e.g. a 3D cockpit console in a flight simulator.

Depth buffering can cause objects from the main scene to hide parts of the overlay.
But disabling depth buffering can cause the overlay to be rendered incorrectly.


Avoid this by clearing just the depth buffer before drawing the overlay.

glClear(GL_DEPTH_BUFFER_BIT)