Occlusion culling

On this page 7

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.

TechniqueHow it worksMain trade-off
Precomputed visibilityBaked potentially visible sets per cell of the levelNear-zero runtime cost, static scenes only
Portals and cellsRooms linked by openings, visibility traced through portalsExcellent indoors, manual authoring
Hardware occlusion queriesGPU counts visible samples of a bounding boxAccurate, but results arrive one or more frames late
Software rasterized depthCPU rasterizes occluders into a small depth bufferNo GPU latency, uses CPU time
Hierarchical Z-bufferGPU tests bounds against a depth mip pyramidFast and GPU-driven, needs previous depth
Main occlusion culling techniques

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 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.

MethodWhat it removesRelative costOrder
Frustum cullingObjects outside the camera viewVery lowFirst
Distance cullingObjects too far away to matterVery lowEarly
Occlusion cullingObjects hidden behind other objectsMediumAfter frustum
Backface cullingTriangles facing away from the cameraFixed-function, nearly freeDuring rasterization
Early depth testHidden fragments before shadingHardware, per pixelDuring rasterization
Culling methods in a typical frame

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 typeRecommendationReason
Indoor levelsPortals or precomputed visibilityWalls hide most rooms
Dense citiesRuntime GPU occlusion cullingBuildings occlude large areas, scenes change
Open terrainFrustum culling and LOD firstFew large occluders
Mobile gamesBaked visibilityLow CPU and GPU budgets
Virtual production stagesRuntime culling with careCamera moves unpredictably on set
Deciding whether occlusion culling is worth it

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.