Scene Graph

A scene graph is the hierarchical data structure that organizes all objects in a 3D scene — geometry, lights, cameras, characters, effects, and their spatial relationships — into a tree (or directed acyclic graph) that the engine traverses for rendering, physics, and interaction. It is the foundational organizational abstraction of every 3D engine and interactive application.

In a scene graph, each node represents an entity with a transform (position, rotation, scale) relative to its parent. A car's body is a parent node; its wheels are children. Rotating the car rotates the wheels with it. This hierarchical transform propagation enables complex articulated objects, character rigs (where a skeleton's bone hierarchy drives mesh deformation via skeletal rigging), and environmental composition where buildings contain rooms that contain furniture.

Scene graphs enable critical performance optimizations. Frustum culling uses the graph's spatial hierarchy to quickly reject entire subtrees of objects that are outside the camera's view. Occlusion culling eliminates objects hidden behind others. Level of detail (LOD) systems swap high-detail models for simpler ones based on camera distance. Unreal Engine's Nanite system pushes this further with virtualized geometry that streams triangle-level detail based on screen-space contribution, effectively making the scene graph's LOD management operate at the micropolygon level.

Modern game engines use entity-component-system (ECS) architectures alongside or instead of traditional scene graphs. In ECS, entities are lightweight IDs, components are pure data (position, mesh, physics body), and systems process components in cache-friendly batches. This data-oriented design delivers better performance for scenes with thousands of dynamic objects. Unity's DOTS and Bevy (Rust) exemplify this approach. The scene graph and ECS aren't mutually exclusive — most engines maintain both: a logical hierarchy for authoring and a flat, data-oriented layout for runtime performance.