Commit 9e3abdf
authored
Terrain LOD refactor: edge stitching, hybrid mesh LOD, performance fixes (#87)
* Terrain LOD refactor: edge stitching, hybrid mesh LOD, performance fixes
Major enhancements to the terrain LOD system:
- Replace tile skirts with boundary vertex stitching (_stitch_tile_boundary)
that interpolates Z from coarser neighbor's pyramid data, eliminating
T-junction cracks without extra geometry
- Hybrid LOD for placed geometry: chunk manager applies simplify_mesh()
during merge based on chunk LOD level (LOD 0=full, LOD 3=10% triangles)
- Extract update() into focused helper phases (A-E) reducing main method
from 324 to ~194 lines
- Fix critical NameError: add missing cache_key in _rebuild_vertical_exaggeration
- Add build retry budget (max 3 attempts) with logging for failed tile builds
- Rate-limit I/O prefetches (max 8/tick) to prevent thread pool flooding
- Early frustum culling before LOD/roughness computation (~40-60% fewer
evaluations for tiles behind camera)
- Single-pass future harvesting in _collect_completed_builds
- Pyramid cache eviction for levels above max_lod
- In-place simplify cache eviction (del loop vs dict rebuild)
- O(1) stale tile eviction via set lookup
- Simplified Z re-snapping: final_z = stored_z * ve
- GPU re-snap threshold bumped from 1K to 10K verts
- Float32 precision for compute_tile_roughness bilinear interpolation
- Remove dead _add_tile_skirt function and references
- Add get_metrics() structured API for programmatic LOD monitoring
- Rename _has_pending to _has_in_flight_work for clarity
- 114 tests (up from ~30), including edge stitching Z-value verification,
hysteresis dead zone coverage, retry budget, and mesh simplification
* general sync up
* Fix ocean-fill NaN replacement crashing on dask-backed rasters
Use the already-computed numpy array (base_np) instead of copying
the raw raster data, which may be a dask array that doesn't support
boolean mask assignment.
* quick fix for scenes1 parent 5e18e04 commit 9e3abdf
File tree
26 files changed
+7908
-1998
lines changed- cuda
- examples
- rtxpy
- analysis
- tests
- viewer
26 files changed
+7908
-1998
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
71 | 73 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
113 | 142 | | |
114 | 143 | | |
115 | 144 | | |
| |||
0 commit comments