Repository navigation
cvc/lod: pyramid builders for mesh/volume/image LOD ladders - #485
Merged
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #483 (base
feat/lod-qem-simplify). The BUILDER half the roadmap namedcvc::lod::pyramid_builder.What
cvc::lod::selectconsumes a monotoneworld_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 viacvc::simplify; rung k targetssrc_tris * mesh_ratio^kand carries the measured world error.build_volume_pyramid— integer-factor downsampling viacvc::vol_downsample; per-rung error = the coarser voxel's world size (bbox.XSpan(dim)).build_image_pyramid— box-average mips via a newimage::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-rungsimplifysetup, 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.cvch5HDF5 store (/cvc/geometry|volumes|images+/cvc/lod_index), then the scene-rendererLodGraphicsNode+ per-frame rung selection.