A metaverse-scale scene cannot draw every object at full detail every frame — a persistent world has orders of magnitude more geometry than any GPU can rasterise at 60 FPS. This is the same real algorithm as the 3D version, redrawn top-down so the camera's frustum and the LOD rings are directly visible as geometry instead of hidden inside a 3D projection matrix. It runs on all 1200 world nodes, every frame:
View-frustum culling (2D wedge test):
facing = atan2(target.y − cam.y, target.x − cam.x)
toNode = atan2(node.y − cam.y, node.x − cam.x)
margin = atan(node.radius / dist) // angular size of the node
visible(node) = |wrap(toNode − facing)| ≤ fovHalf + margin
Level of detail (distance-based):
d = |cam − node|
tier(d) = HIGH if d < d_near
= LOW if d_near ≤ d < d_far
= IMPOSTOR if d_far ≤ d < d_max (d_max = d_far + 45)
= CULLED if d ≥ d_max
- Node count — how many objects populate the world grid; more nodes means more candidates for the wedge test each frame.
- Switch distances — the two radii (drawn as dashed rings around the camera) that define the LOD zones; drag them to see nodes swap between the 320-, 20- and 4-triangle stand-ins live.
- Field of view — the half-angle of the visibility wedge; widen it to approximate an ultra-wide lens, narrow it to a telephoto sliver.
- Orbit radius — how far the camera sits from the world's centre; also the radius auto-fly breathes around.
- LOD toggle — forces every visible node to full detail, so you can compare "Triangles drawn" with and without distance-based simplification.
- Frustum cull toggle — disables the wedge test, so every node behind and beside the camera counts as rendered too (watch "Rendered nodes" jump).
- Drag the map — rotates the camera around the world, the 2D equivalent of an orbit-camera drag. Auto-fly does the same rotation on a timer, with the orbit radius breathing in and out, so the visible/culled split keeps changing the way it would as an avatar moves through a real metaverse instance.
Real engines (Unreal Nanite, Unity LODGroup, Three.js LOD, most WebGL metaverse clients) combine exactly these two techniques, usually adding octree/BVH spatial partitioning so the culling test itself doesn't have to touch every object either — here it deliberately does, so the cost is visible in the stats panel below the map.