DepthBuffer
The depth buffer, also known as the z-buffer, is a piece of graphics hardware or software used in 3D computer graphics to determine which objects are closer to the viewer and should be drawn on top of others. It is a 2D array that stores a depth value for each pixel on the screen. When a 3D scene is rendered, each pixel is processed. For each potential pixel to be drawn, its depth value is compared to the depth value currently stored in the depth buffer at that pixel's location. If the new pixel is closer to the viewer (i.e., has a smaller depth value), it overwrites the existing value in the depth buffer and is drawn on the screen. If it is farther away, it is discarded.
This process ensures that objects that are occluded by other objects are not rendered, a technique known