70 · Performance · 3D (and 2D)

Frustum culling

Do not draw what the camera cannot see.

The camera only sees a pyramid-shaped volume (the frustum). Sending objects behind or beside the camera to the GPU is wasted work. Engines test each object's bounding box against the frustum and skip the ones outside. Your job is to keep bounds correct and to skip logic for off-screen things too.

←↑↓→ or WASD moveF culling on/offD-pad to explore

Try this: Explore with your flashlight and find the coins. With culling off all 220 objects are drawn, even the red ones behind you, and it lags. Turn culling on: only what is in the cone is drawn.

Coins 0Drawn 220

Culling off: all 220 objects are drawn, even the red ones nobody can see.

Prompt bit

Works for 2D or 3D in any engine (Unity, Unreal, Godot, web). Paste the short one for a quick fix, or the detailed one when you want it done properly.

Support frustum culling: give every renderer correct bounds, including animated and shader-displaced meshes, split huge meshes so parts can be culled, pause animation and AI for objects off screen longer than 0.5 s, and keep off-screen shadow casters that shade the view.

42 words · one sentence to paste as is

Where it's used

Common mistakes

Wrong bounds on skinned or shader-displaced meshes so objects vanish at the edge, merging the whole level into one mesh, updating off-screen animations and particles anyway, and culling shadow casters that should still cast shadows.

Writing this with an AI assistant? See our best AI coding assistants for game developers.

Missing a concept? Request one.

Related concepts

New concepts, in your inbox.

One short email when we add new concepts, plus our weekly roundup of AI tools for game devs. Unsubscribe any time.