Map 3D: cull decal and see-through meshes one by one too #491

Manually merged
github merged 1 commit from github-bot/gh-491 into gh-pr/491/base 2026-11-27 19:26:01 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-27 18:49 UTC · original
holdmysocks:six-map3d-latecull → master · +45 −17 · 3 files · 1 commits · merged 2026-11-27 19:23 UTC

#485 culls the opaque, fallback and shadow meshes of models placed at most 8 times, one by one. Decal and see-through meshes were left out, and they make 680 to 1,550 draws a frame in the city views.

What changes:

  • Same test. Decal and see-through meshes of those models are tested against the view's sides, using their placements' transforms and the mesh's bounding sphere, like the opaque ones in #485.
  • Order kept. The lists are sorted as before (decals by layer, then far to near; see-through far to near by mesh), so layering does not change. Hidden meshes stay in the sorted list, but are not drawn.
  • No split draws. When a hidden mesh lies between two that would join into one draw (same pipeline, model and material, following on in the buffer), the draw still spans it.
  • Tick line. The culled figure gains a fourth count: meshes culled [main, fb, shadow, late] [..], where late is decal and see-through.

Results (RTX 3090, master vs this PR, four city views plus a 30 s fly, path off, 18 runs, no panics or validation errors; the cull, order and cells unit tests pass):

View Draws main (shadow) before → after Decal/see-through draws Late meshes culled CPU finish µs
s3 3200 (739) → 2822 (744) 1117 → 739 378 4981 → 4478
dtst 3142 (648) → 2683 (662) 1149 → 690 459 5176 → 4634
rs 4457 (991) → 3834 (979) 1553 → 930 623 6983 → 6022
wide 2101 (644) → 1680 (644) 680 → 259 421 3307 → 2766

The decal and see-through draws fall by exactly the number of meshes culled, so the cull never split a draw. Opaque, fallback and shadow draws are unchanged. Encoder finish time drops 500 to 960 µs in every view; GPU time moves within noise and VRAM is unchanged. In a 30 s fly from s3 the mean frame time falls from 21.4 to 19.4 ms (p99 41.9 to 38.3 ms, frames over 33 ms 4.9 % to 2.3 %).

Images: s3, dtst and rs match master exactly; wide differs in 19 isolated far pixels (0.002 %). No road markings, crossings, grime, glass or water go missing at the screen edges, and the fly shows no pop-in.

**@⁠holdmysocks** on GitHub · 2026-11-27 18:49 UTC · [original](https://github.com/holdmysocks/SixNG/pull/491) `holdmysocks:six-map3d-latecull` → `master` · +45 −17 · 3 files · 1 commits · merged 2026-11-27 19:23 UTC #485 culls the opaque, fallback and shadow meshes of models placed at most 8 times, one by one. Decal and see-through meshes were left out, and they make 680 to 1,550 draws a frame in the city views. What changes: - **Same test.** Decal and see-through meshes of those models are tested against the view's sides, using their placements' transforms and the mesh's bounding sphere, like the opaque ones in #485. - **Order kept.** The lists are sorted as before (decals by layer, then far to near; see-through far to near by mesh), so layering does not change. Hidden meshes stay in the sorted list, but are not drawn. - **No split draws.** When a hidden mesh lies between two that would join into one draw (same pipeline, model and material, following on in the buffer), the draw still spans it. - **Tick line.** The culled figure gains a fourth count: `meshes culled [main, fb, shadow, late] [..]`, where late is decal and see-through. Results (RTX 3090, master vs this PR, four city views plus a 30 s fly, path off, 18 runs, no panics or validation errors; the cull, order and cells unit tests pass): | View | Draws main (shadow) before → after | Decal/see-through draws | Late meshes culled | CPU finish µs | |---|---|---|---|---| | s3 | 3200 (739) → 2822 (744) | 1117 → 739 | 378 | 4981 → 4478 | | dtst | 3142 (648) → 2683 (662) | 1149 → 690 | 459 | 5176 → 4634 | | rs | 4457 (991) → 3834 (979) | 1553 → 930 | 623 | 6983 → 6022 | | wide | 2101 (644) → 1680 (644) | 680 → 259 | 421 | 3307 → 2766 | The decal and see-through draws fall by exactly the number of meshes culled, so the cull never split a draw. Opaque, fallback and shadow draws are unchanged. Encoder finish time drops 500 to 960 µs in every view; GPU time moves within noise and VRAM is unchanged. In a 30 s fly from s3 the mean frame time falls from 21.4 to 19.4 ms (p99 41.9 to 38.3 ms, frames over 33 ms 4.9 % to 2.3 %). Images: s3, dtst and rs match master exactly; wide differs in 19 isolated far pixels (0.002 %). No road markings, crossings, grime, glass or water go missing at the screen edges, and the fly shows no pop-in.
Decal and see-through meshes of models placed at most 8 times are tested against the view like the opaque ones. Their sort order is kept; a hidden mesh between two that would join stays inside the draw, so the cull never splits one. The tick line counts them as a fourth culled figure.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 18:52:14 +00:00
github-bot changed target branch from master to gh-pr/491/base 2026-11-27 19:26:00 +00:00
github manually merged commit cf354167bf into gh-pr/491/base 2026-11-27 19:26:01 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.