A computer chip, representing z-buffering.

Deciding which surfaces are in front.

What z-buffering is

Z-buffering is a technique used in 3D computer graphics to determine which surfaces are visible, by keeping track of the depth of each pixel. In a 3D scene, objects can be in front of or behind one another, and only the nearest surface at each point should be seen. The z-buffer stores depth information so the renderer can decide which surface is in front at every pixel.

The problem of hidden surfaces

When a 3D scene is rendered onto a flat image, multiple surfaces may project onto the same pixel, but only the closest one should actually be visible; the others are hidden behind it. Figuring out which surface wins at each pixel is the hidden-surface problem. Z-buffering is a common way to solve it by comparing depths.

Tracking depth per pixel

The z-buffer, also called a depth buffer, stores a depth value for each pixel, representing how far away the surface currently drawn there is. As surfaces are rendered, their depth at each pixel is compared with the stored value. If a surface is closer than what is already recorded, it replaces it; if it is farther, it is ignored. This keeps the nearest surface visible.

Deciding what is visible

By maintaining depth information and updating it as surfaces are drawn, z-buffering ensures that, at each pixel, the closest surface is the one shown. Surfaces that are behind others are correctly hidden. This per-pixel depth comparison is a straightforward and effective way to handle the visibility of overlapping surfaces in a 3D scene.

Where z-buffering is used

Z-buffering is widely used in 3D rendering, including in games and other real-time graphics, to handle which surfaces appear in front. Its simplicity and effectiveness have made it a standard approach to the hidden-surface problem. Understanding z-buffering clarifies how a renderer correctly shows a 3D scene where objects overlap in depth.

Why it matters

Z-buffering is a fundamental technique in 3D computer graphics. Understanding what it is - tracking pixel depth to decide which surfaces are visible - clarifies how renderers handle objects in front of and behind each other. For anyone interested in how 3D graphics work, it is a valuable concept to understand.

See also: What is rasterization? Explained, What is ray tracing? Explained.

Sources

Published date reflects the original event date (2026-10-06). This article is original Skillo editorial written from the sources above; facts were verified in September 2026.

Skillo Staff

Skillo Staff

All stories by: Skillo Staff

Leave a Reply