Map 3D: draw neighbouring meshes of a model as one range #470

Manually merged
github merged 2 commits from github-bot/gh-470 into gh-pr/470/base 2026-11-27 07:06:02 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-27 06:53 UTC · original
holdmysocks:six-map3d-citydraws → master · +155 −20 · 3 files · 2 commits · merged 2026-11-27 07:02 UTC

Fewer draw calls per model in the 3D map, so busy city views take less CPU time.

  • Shared index range. A model's meshes already share one vertex buffer and one index buffer. Their indices now address the whole vertex buffer (base vertex 0), so neighbouring meshes can be drawn as one index range.
  • Main pass. Neighbouring meshes with the same material are joined into one draw. Strand hair is still drawn on its own.
  • Sun shadow pass. All neighbouring solid meshes are joined into one draw, whatever their material. Only cut-out meshes need their own material bound.
  • Draw log. SIXNG_MAP_DRAWLOG=1 prints the main and shadow draws per frame with each automation tick, plus the ten models with the most draws.
  • README updated.

Measured on a second PC (RTX 4080, rebaked map), with an 85 s hold and means over the last 30 s, before → after:

Pose CPU render (pass+finish+submit) Shadow draws
s3 12.1 → 7.8 ms 2775 → 1067
dtst 10.1 → 7.8 ms 3084 → 968
rs 11.9 → 9.9 ms 3932 → 1416
wide 6.0 → 5.6 ms 1463 → 812
  • Images match. No pixel differs by more than 16 levels at any pose, and at most 0.07 % of pixels differ at all. 300a also matches its earlier shot.
  • GPU main pass. It is 0.2–0.6 ms higher at three poses. That is within the run-to-run spread from different model counts after the memory trim.
**@⁠holdmysocks** on GitHub · 2026-11-27 06:53 UTC · [original](https://github.com/holdmysocks/SixNG/pull/470) `holdmysocks:six-map3d-citydraws` → `master` · +155 −20 · 3 files · 2 commits · merged 2026-11-27 07:02 UTC Fewer draw calls per model in the 3D map, so busy city views take less CPU time. - **Shared index range.** A model's meshes already share one vertex buffer and one index buffer. Their indices now address the whole vertex buffer (base vertex 0), so neighbouring meshes can be drawn as one index range. - **Main pass.** Neighbouring meshes with the same material are joined into one draw. Strand hair is still drawn on its own. - **Sun shadow pass.** All neighbouring solid meshes are joined into one draw, whatever their material. Only cut-out meshes need their own material bound. - **Draw log.** `SIXNG_MAP_DRAWLOG=1` prints the main and shadow draws per frame with each automation tick, plus the ten models with the most draws. - README updated. Measured on a second PC (RTX 4080, rebaked map), with an 85 s hold and means over the last 30 s, before → after: | Pose | CPU render (pass+finish+submit) | Shadow draws | |---|---|---| | s3 | 12.1 → 7.8 ms | 2775 → 1067 | | dtst | 10.1 → 7.8 ms | 3084 → 968 | | rs | 11.9 → 9.9 ms | 3932 → 1416 | | wide | 6.0 → 5.6 ms | 1463 → 812 | - **Images match.** No pixel differs by more than 16 levels at any pose, and at most 0.07 % of pixels differ at all. 300a also matches its earlier shot. - **GPU main pass.** It is 0.2–0.6 ms higher at three poses. That is within the run-to-run spread from different model counts after the memory trim.
With each automation tick, prints the main and shadow draw calls per frame
and the ten models with the most, to see where a busy view's draws go.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 06:55:44 +00:00
github-bot changed target branch from master to gh-pr/470/base 2026-11-27 07:06:00 +00:00
github manually merged commit b170fb9ae5 into gh-pr/470/base 2026-11-27 07:06:02 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.