ifcviewer-web: contribution-cull streaming + combined loaded/needed/total bar

Streaming picked candidates on raw frustum visibility, so viewAll over a big
federation (all models in-frustum) fetched every chunk — even fine chunks that
project to sub-pixel and the renderer never draws. Gate streaming on the SAME
contribution decision the render path already makes.

- New per-chunk contribution_visible_count: instances that passed frustum AND
  the contribution cull (projected radius >= min_radius_px), counted BEFORE HiZ
  — so it's stable while the camera is still (unlike the HiZ-post counters,
  which flip frame-to-frame and would thrash the loader) and shifts only on
  navigation, when the working set should. The candidate gate skips chunks with
  count 0: the network pulls only what's resolvable now; the rest stream in as
  you approach. Verified: fit view needs the geometry, zoomed-out needs 0.

- Loading UI reworked from per-model segments to a combined bar over the whole
  federation: dark track = not needed for this view, dim = needed-but-unloaded,
  bright = loaded. "loaded / needed" = how done THIS view is; "needed / total" =
  how much of the model the view requires — "Loading 45 / 90 MB for this view ·
  12% of 718 MB total". Driven by ViewportCore::streamingByteProgress + ifcv_bytes_*.
  Two fixes from testing: (1) show a distinct overhead phase while total==0
  ("Loading model data — X MB · Y/N models ready") so the metadata download
  isn't a dead-looking bar; (2) re-assert display:block every active frame so the
  bar REAPPEARS when navigation reveals new chunks (was only set in
  beginLoadProgress → stayed hidden after the first catch-up). Per-model exports
  kept for a future detailed view.

111/111 unit + 6/6 web smoke pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-07-01 16:28:44 +10:00
parent 001476c5a9
commit 5299f6c13c
6 changed files with 141 additions and 51 deletions
+7
View File
@@ -123,6 +123,13 @@ struct ModelGpuData {
uint32_t total_visible_vertices = 0;
uint32_t total_visible_draws = 0;
uint32_t frustum_visible_count = 0;
// Instances that passed frustum AND the contribution cull (projected
// radius ≥ min_radius_px), but BEFORE HiZ. Streaming gates on this so
// it only fetches chunks big enough on screen to actually draw —
// without coupling to HiZ occlusion (which flips frame-to-frame and
// would thrash the loader). Stable while the camera is still; changes
// only on navigation, which is exactly when the working set should.
uint32_t contribution_visible_count = 0;
// Opaque-first partition counts. The cull loop fills
// visible_draws_scratch with all opaque visible instances first,