Occlusion culling is the rendering optimization that skips objects fully hidden behind other geometry before the GPU spends time drawing them. In real-time 3D, where a frame must be finished in about 16.7 ms at 60 frames per second, it removes work that the depth test would otherwise discard pixel by pixel after the cost of vertex processing, rasterization and draw call submission has already been paid.
It is the most demanding member of the visibility culling family. Frustum culling removes what lies outside the camera view and backface culling removes triangles facing away, but only occlusion culling asks the harder question: is this object visible through everything in front of it.
How occlusion culling decides visibility
Every occlusion culling system tests a conservative bounding volume of an object, usually an axis-aligned box or sphere, against a representation of the geometry already known to be in front. If the bounding volume is completely covered by occluders, the object and all of its triangles are skipped. The test must be conservative: a culling error that hides a visible object produces popping, which players and viewers notice immediately.
The occluders themselves are usually simplified. Large walls, terrain and buildings serve as occluder geometry, often as low-polygon proxies, while small props act only as occludees. Choosing good occluders matters more than the algorithm, because thin or fragmented geometry hides very little even when it covers much of the screen.
| Technique | How it works | Main trade-off |
|---|---|---|
| Precomputed visibility | Baked potentially visible sets per cell of the level | Near-zero runtime cost, static scenes only |
| Portals and cells | Rooms linked by openings, visibility traced through portals | Excellent indoors, manual authoring |
| Hardware occlusion queries | GPU counts visible samples of a bounding box | Accurate, but results arrive one or more frames late |
| Software rasterized depth | CPU rasterizes occluders into a small depth buffer | No GPU latency, uses CPU time |
| Hierarchical Z-buffer | GPU tests bounds against a depth mip pyramid | Fast and GPU-driven, needs previous depth |
Precomputed and runtime approaches
Precomputed approaches divide a level into cells and compute offline which objects can possibly be seen from each cell, a structure known as a potentially visible set. The runtime cost is a simple lookup, which is why this method dominated early first-person games and remains popular on mobile hardware. Its limitation is that moving occluders are ignored, so an opening door or destructible wall breaks the precomputed answer.
Runtime approaches rebuild visibility every frame. Modern engines commonly render the main occluders or reuse the previous frame’s depth, build a hierarchical Z-buffer by downsampling to the farthest depth per tile, and test thousands of bounding boxes in a compute shader. This fits GPU-driven rendering, where culling results feed indirect draw calls without a CPU round trip.
Reusing the previous frame introduces temporal error: an object that becomes visible this frame may be culled once. Engines solve this with a two-pass scheme, drawing objects visible last frame, building depth, then testing the remaining objects against the fresh depth and drawing the newly revealed ones.
Occlusion culling compared with related culling methods
Occlusion culling is one stage in a culling pipeline, and each stage removes a different kind of invisible work. The cheapest tests run first, so occlusion tests only consider objects that already survived the frustum test.
| Method | What it removes | Relative cost | Order |
|---|---|---|---|
| Frustum culling | Objects outside the camera view | Very low | First |
| Distance culling | Objects too far away to matter | Very low | Early |
| Occlusion culling | Objects hidden behind other objects | Medium | After frustum |
| Backface culling | Triangles facing away from the camera | Fixed-function, nearly free | During rasterization |
| Early depth test | Hidden fragments before shading | Hardware, per pixel | During rasterization |
Level of detail complements occlusion culling rather than replacing it. LOD reduces the cost of visible but distant objects, while occlusion culling removes the cost of invisible objects entirely. A dense city benefits from both; an open plain benefits mostly from LOD.
When occlusion culling pays off
The benefit depends on the depth complexity of the scene, meaning how many surfaces lie behind one another along a typical view ray. Interiors, cities and forests can hide most of their content at any moment, while flight simulators and open landscapes hide little. In scenes with low depth complexity, the culling cost can exceed the savings.
| Scene type | Recommendation | Reason |
|---|---|---|
| Indoor levels | Portals or precomputed visibility | Walls hide most rooms |
| Dense cities | Runtime GPU occlusion culling | Buildings occlude large areas, scenes change |
| Open terrain | Frustum culling and LOD first | Few large occluders |
| Mobile games | Baked visibility | Low CPU and GPU budgets |
| Virtual production stages | Runtime culling with care | Camera moves unpredictably on set |
Limitations and common mistakes
The most common failure is visible popping, caused by overly aggressive culling, late query results or occluder proxies larger than the real mesh. Another is culling shadow casters: an object hidden from the camera may still cast a visible shadow, so shadow passes need their own visibility tests from the light’s point of view.
- Keep occluder proxies inside the visible mesh, never larger, to avoid false culling.
- Profile culling cost against draw call savings on the target hardware, not on a workstation.
- Rebake precomputed visibility after level edits, or stale data will hide new openings.
- Exclude transparent objects from the occluder set, because they do not block what lies behind them.
A plain-language summary
Occlusion culling means not drawing what nobody can see. If you stand in a room, you cannot see the furniture in the next room through the wall, so the computer does not bother drawing it.
Skipping that hidden work frees time for what is actually on screen, which keeps games and interactive scenes smooth and responsive. It works like a stage crew that only lights the part of the set the audience can actually see.
An example from practice
A small team is building a first-person game set in a multistory office building with about 4,000 props per floor. Profiling on a mid-range console shows the CPU submitting over 6,000 draw calls per frame, and the frame time sits near 22 ms, well above the 16.7 ms target for 60 frames per second.
The team marks walls, floors and elevator shafts as occluders, adds portals at doorways and enables GPU occlusion culling for moving objects. In a typical corridor view, draw calls fall to roughly 1,200, and the frame time drops to about 13 ms. The game reaches a stable 60 frames per second without simplifying any visible art.