Skip to content

five-on-it / apps/client/src/renderer/level-culling

apps/client/src/renderer/level-culling ​

The level's meshes, culled by hand before the scene looks at them. A city is thousands of placed pieces (main-riverbend has 8,007): left to itself the scene would weigh every one of them every frame, though the camera, looking steeply down, sees a few dozen metres of it. So the level's meshes are sorted once into cells of CELL metres by the ground they cover, and the scene is handed as candidates only those in the cells the camera's view rectangle reaches (view-rect.ts, widened for tall buildings), the few that span the whole level (its ground), and everything that is not the level (actors, effects, items), which it culls as ever. What does not move (everything but the light pieces, which a fast car knocks loose) has its world matrix frozen, so it is never worked out again.

Interfaces ​

Variables ​

Functions ​