Skip to content

cvc/lod: pyramid builders for mesh/volume/image LOD ladders - #485

Merged
transfix merged 1 commit into
masterfrom
feat/lod-pyramid-builder
Sep 30, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/lod-pyramid-builder

Conversation

@transfix

Copy link
Copy Markdown
Owner

Stacked on #483 (base feat/lod-qem-simplify). The BUILDER half the roadmap named cvc::lod::pyramid_builder.

What

cvc::lod::select consumes a monotone world_error_m[] ladder + per-rung sizes; this produces exactly that from a source asset, for all three renderable kinds:

  • build_mesh_pyramid — repeated QEM decimation via cvc::simplify; rung k targets src_tris * mesh_ratio^k and carries the measured world error.
  • build_volume_pyramid — integer-factor downsampling via cvc::vol_downsample; per-rung error = the coarser voxel's world size (bbox.XSpan(dim)).
  • build_image_pyramid — box-average mips via a new image::resized(box) path; per-rung error scales with the texel-doubling factor (the bake step multiplies by the raster's metres-per-texel).

rung 0 is the source verbatim, world_error_m[0]==0, and the ladder is forced monotone with a running max (select_rung's precondition). LOD stays a render proxy — nav/material/RF read rung 0.

Parallelism

Independent rungs are the embarrassingly-parallel unit and fan over app::computePool(). Mesh uses the pool at exactly one level (rungs or the per-rung simplify setup, never nested).

Also

image::resize_filter{nearest,box} + the box area-average downscale path (u8; other types fall back to nearest). resized(w,h) keeps its nearest default → no caller changes.

Test — cvc_lod_pyramid_test (4 cases, green)

Mesh ladder strictly coarsens with a monotone error column + verbatim rung 0; pooled == serial; volume ladder halves each axis with growing voxel-size error; image mip box-averages a 2×2 checker to mid-grey (nearest would keep 0/255).

Next: the per-bundle scene.cvch5 HDF5 store (/cvc/geometry|volumes|images + /cvc/lod_index), then the scene-renderer LodGraphicsNode + per-frame rung selection.

The BUILDER half the roadmap named cvc::lod::pyramid_builder. cvc::lod::select
consumes a monotone world_error_m[] ladder + per-rung sizes; this produces
exactly that from a source asset, for the three renderable kinds:

  * build_mesh_pyramid   -- repeated QEM decimation via cvc::simplify; each rung
                            targets src_tris * mesh_ratio^k and carries the
                            measured world error.
  * build_volume_pyramid -- integer-factor downsampling via cvc::vol_downsample;
                            per-rung error = the coarser voxel's world size.
  * build_image_pyramid  -- box-average mips via a new image::resized(box) path
                            (resized was nearest-only); per-rung error scales with
                            the texel-doubling factor (the bake step multiplies by
                            the raster's metres-per-texel).

rung 0 is the source verbatim, world_error_m[0]==0, and the ladder is forced
monotone with a running max (select_rung's precondition). Independent rungs are
the embarrassingly-parallel unit and fan over the app compute pool
(mesh rungs use it at one level -- rungs OR the per-rung simplify setup, never
nested). LOD stays a render proxy: nav/material/RF read rung 0, never a rung.

Also adds image::resize_filter{nearest,box} + the box (area-average) downscale
path to image::resized (u8; other types fall back to nearest). resized(w,h)
keeps its nearest default, so no caller changes.

Gate cvc_lod_pyramid_test (4 cases): mesh ladder strictly coarsens with a
monotone error column + verbatim rung 0; pooled == serial; volume ladder halves
each axis with growing voxel-size error; image mip box-averages a 2x2 checker to
mid-grey (nearest would keep 0/255).

Second of the LOD-pyramid series (base feat/lod-qem-simplify; next: the
scene.cvch5 HDF5 store, then the scene-renderer LodGraphicsNode).
@transfix
transfix changed the base branch from feat/lod-qem-simplify to master September 30, 2026 00:30
@transfix
transfix merged commit e2ab93f into master Sep 30, 2026
5 checks passed
@transfix
transfix deleted the feat/lod-pyramid-builder branch October 29, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant