Frustum culling

Also known as: view frustum culling

On this page 7

Frustum culling is a visibility optimization that removes objects lying completely outside the camera’s view frustum, the truncated pyramid that bounds everything the camera can see, before they are sent to the GPU. In Real-time 3D, it is one of the first and cheapest culling stages, and it is also called view frustum culling.

Because a typical game or interactive scene contains far more objects than the camera sees in any frame, frustum culling often eliminates half or more of the scene from rendering. It saves draw calls, vertex processing and CPU submission time without changing the final image, since culled objects would have been clipped away anyway.

How frustum culling tests objects

Frustum culling works by testing a simple bounding volume around each object against the six planes of the frustum: near, far, left, right, top and bottom. Each plane is stored as a normal vector and a distance, typically extracted directly from the combined view-projection transformation matrix.

For each plane, the engine computes the signed distance from the bounding volume to the plane. If the volume lies entirely on the outer side of any single plane, the object is rejected. If it lies inside all six planes, it is fully visible, and if it straddles a plane, it is treated as intersecting and is drawn, leaving the GPU clipper to trim the excess geometry.

The table below shows the three possible test outcomes and what the renderer does with each.

Test resultConditionRenderer action
OutsideFully behind at least one planeSkip the object entirely
InsideIn front of all six planesDraw; children need no further tests
IntersectingCrosses one or more planesDraw, or test children in a hierarchy
Outcomes of a frustum test

The test is conservative by design: it may keep an object that turns out to be invisible, but it must never discard an object that contributes pixels, because that would cause visible popping.

Bounding volumes and their trade-offs

The choice of bounding volume balances test speed against tightness of fit. A loose volume is cheap to test but keeps more invisible objects, while a tight volume rejects more objects at a higher cost per test.

VolumeTest costFit qualityTypical use
Bounding sphereVery low, one dot product per planeLoose for long objectsCharacters, props, particles
Axis-aligned bounding boxLow, nearest corner per planeGood for static geometryLevel chunks, terrain tiles
Oriented bounding boxModerate, projected extentsTight for rotated objectsVehicles, long rotated meshes
Sphere then boxLow on averageTight where it mattersMixed scenes with many objects
Bounding volumes used in frustum culling

For an axis-aligned box, an efficient technique tests only the positive vertex, the corner farthest along the plane normal; if even that corner is outside, the whole box is outside. Many engines first run a cheap sphere test and only perform the box test on objects that pass.

Frustum culling compared with other culling methods

Frustum culling removes what is outside the view, but it cannot detect objects hidden behind other objects or polygons facing away from the camera. Real-time renderers therefore combine it with occlusion culling and backface culling, each operating at a different level.

MethodWhat it removesGranularityWhere it runs
Frustum cullingObjects outside the view volumeObject or clusterCPU or compute shader
Occlusion cullingObjects hidden behind othersObject or clusterCPU, GPU queries, Hi-Z buffer
Backface cullingTriangles facing awayTriangleFixed-function GPU stage
Distance cullingObjects beyond a set rangeObjectCPU, often with level of detail
ClippingTriangle parts outside the viewTriangle fragmentGPU after the vertex shader
Culling methods in a real-time pipeline

The usual order is frustum culling first, because it is cheapest and shrinks the set that the more expensive occlusion stage must evaluate. Level of detail selection then runs on the surviving objects.

Scaling frustum culling to large scenes

Testing every object individually costs time proportional to the object count, so large scenes organize objects in a spatial hierarchy such as a bounding volume hierarchy, octree or quadtree. When a parent node is fully outside, its entire subtree is skipped; when it is fully inside, its children are accepted without further tests.

Modern engines also move culling onto the GPU. A compute shader tests thousands of instances or meshlet clusters in parallel and writes the survivors into an indirect draw buffer, which removes CPU bottlenecks in GPU-driven rendering and works well with GPU instancing.

The following decision table summarizes common strategies by scene type.

Scene typeRecommended strategyReason
Small scene, under a few hundred objectsFlat loop with spheresHierarchy overhead is not worth it
Large static worldOctree or bounding volume hierarchyRejects whole regions at once
Many instanced objectsCompute shader cullingParallel tests and indirect draws
Shadow-casting lightsSeparate light frustum testsShadows need objects off camera
Choosing a frustum culling strategy

Common mistakes and edge cases

Most frustum culling bugs appear as objects popping in or vanishing at the screen edges. They usually come from incorrect bounds or planes rather than from the test itself.

  • Stale bounding volumes: skinned or animated meshes move outside bounds computed in the bind pose, so limbs disappear near the screen edge.
  • Wrong plane normalization: planes extracted from the matrix must be normalized before sphere tests, or distances are scaled incorrectly.
  • Culling shadow casters with the camera frustum: an object off screen can still cast a visible shadow, so shadow mapping needs its own frustum.
  • Ignoring vertex shader displacement: wind, waves or other deformation can push geometry beyond its original bounds.
  • Reversed depth or infinite far planes: plane extraction must match the projection convention used by the engine.

A practical safeguard is a debug view that freezes the culling camera while the user flies around, which makes it easy to see exactly which objects are kept and which are rejected.

Understanding it simply

Imagine looking through a window. Anything outside the window frame cannot be seen, so there is no point in painting it. Frustum culling applies the same idea to a 3D game or interactive scene: before drawing each frame, the computer checks which objects fall inside the camera’s view and simply ignores the rest.

To keep this check fast, the computer does not inspect every detail of an object. It wraps each one in a simple invisible ball or box and only checks whether that shape is in view. The result is the same picture with much less work, which helps the game run smoothly.

Applied in practice

A team builds an open-world driving game with a city of about 40,000 objects, including buildings, lamps, trees and parked cars. Early profiling shows the CPU spending most of each frame submitting draw calls, and the frame rate falls below 30 frames per second.

The engineers store all static objects in a bounding volume hierarchy with axis-aligned boxes and move the tests for parked cars and trees into a compute shader that writes indirect draw commands. With a typical 70-degree field of view, only about 15 percent of objects survive frustum culling in an average frame, and occlusion culling removes many more behind buildings.

Draw submission time drops by more than half, and the game holds a steady 60 frames per second on the target hardware. A bug report about trees vanishing at screen edges is traced to vertex shader wind displacement, fixed by enlarging those bounding boxes slightly.