Map 3D: cull placements first, and models placed up to 64 times #500

Closed
github-bot wants to merge 1 commit from github-bot/gh-500 into master AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-27 19:38 UTC · original
holdmysocks:six-map3d-manycull → master · +66 −27 · 2 files · 1 commits · closed without merging

#485 and #491 cull the meshes of models placed at most 8 times. Models placed more often (street furniture, trees, repeated building parts) still draw every mesh, and the view selects placements in a widened frustum, so some of their placements, and sometimes all of them, lie just outside the view.

What changes:

  • Placements first. In each pass a model's placements are tested on the model's bounding sphere: against the view's sides in the opaque, fallback, decal and see-through passes, and against the cascade's box in shadows. A model none of whose placements is seen draws nothing in that pass.
  • Meshes against what is left. Each mesh is then tested only against the placements that passed, so a model placed many times costs fewer tests.
  • Higher limit. The per-mesh cull now covers models placed up to 64 times. SIXNG_MAP_CULL_INST sets another limit; 0 turns the cull off.
  • Counts. Meshes of a model skipped outright count in meshes culled for the opaque, fallback and shadow passes.

Results: to follow from the second PC (A/B against master at the same four city views, with the limit at 8, 64 and 512).

**@⁠holdmysocks** on GitHub · 2026-11-27 19:38 UTC · [original](https://github.com/holdmysocks/SixNG/pull/500) `holdmysocks:six-map3d-manycull` → `master` · +66 −27 · 2 files · 1 commits · closed without merging #485 and #491 cull the meshes of models placed at most 8 times. Models placed more often (street furniture, trees, repeated building parts) still draw every mesh, and the view selects placements in a widened frustum, so some of their placements, and sometimes all of them, lie just outside the view. What changes: - **Placements first.** In each pass a model's placements are tested on the model's bounding sphere: against the view's sides in the opaque, fallback, decal and see-through passes, and against the cascade's box in shadows. A model none of whose placements is seen draws nothing in that pass. - **Meshes against what is left.** Each mesh is then tested only against the placements that passed, so a model placed many times costs fewer tests. - **Higher limit.** The per-mesh cull now covers models placed up to 64 times. `SIXNG_MAP_CULL_INST` sets another limit; 0 turns the cull off. - **Counts.** Meshes of a model skipped outright count in `meshes culled` for the opaque, fallback and shadow passes. Results: to follow from the second PC (A/B against master at the same four city views, with the limit at 8, 64 and 512).
In each pass a model's placements are first tested on its bounding sphere (models load in a widened frustum, so some lie just outside the view); a model with none seen draws nothing, and its meshes are tested only against the placements left. The per-mesh cull now covers models placed up to 64 times; SIXNG_MAP_CULL_INST sets another limit and 0 turns it off.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 19:41:59 +00:00
Author
Owner

@⁠holdmysocks on GitHub · 2026-11-27 20:21 UTC · original

Closing: measured on the second PC this saves only 1 to 17 draws per frame. Testing placements first culls many more meshes, but they lie inside draws that were already joined, and no model placed 9 to 512 times had meshes to cull at the city views (props placed that often draw through the map cells). At the wide view the higher limit added about 1 ms of CPU time for tests that cull nothing. Images matched.

**@⁠holdmysocks** on GitHub · 2026-11-27 20:21 UTC · [original](https://github.com/holdmysocks/SixNG/pull/500#issuecomment-7227425963) Closing: measured on the second PC this saves only 1 to 17 draws per frame. Testing placements first culls many more meshes, but they lie inside draws that were already joined, and no model placed 9 to 512 times had meshes to cull at the city views (props placed that often draw through the map cells). At the wide view the higher limit added about 1 ms of CPU time for tests that cull nothing. Images matched.
github-bot closed this pull request 2026-11-27 20:26:58 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.