3.3 KiB
3.3 KiB
Smooth Cesium preview vehicle cruise
Goal
Improve perceived smoothness of vehicle cruise in the Cesium preview for
nantaizi-lake-innovation-valley while the scene model is visible, especially
when Follow passes through scrub-heavy areas.
The initial preview-layer optimization helped but did not solve the root cause:
closing Scene helps a lot, and the current nantaizi GLB contains about 707
scrub bush nodes. The root fix is allowed to reduce scrub bush instance density
while preserving the flat scrub ground cover and existing preview controls.
Requirements
- Optimize
scripts/lib/cesium-preview.jsso vehicle animation does less per-frame work during cruise without reducing default visual clarity. - Preserve existing controls and behavior:
- Play/Pause still drives
viewer.clock.shouldAnimate. - Speed slider still maps m/s to clock multiplier.
- Vehicle selection still chooses the follow target.
- Scene/routes/vehicles/FPS/diagnostics toggles still work.
- Follow mode still tracks the selected vehicle.
- Play/Pause still drives
- Keep the preview layer dependency-free and browser-native; no build step, npm dependency, module system, or hard-coded area filenames.
- Reduce scrub edge bush instance density in
blender/generate_scene.pyto lower Cesium render load in scrub-heavy Follow views. Preserve deterministic sampling, scrub ground polygons, scrub tree sampling, and scene stats fields. - Regenerate or copy the updated preview JS into
outputs/nantaizi-lake-innovation-valley/cesium-preview.jsonly if needed for local manual verification; do not commit generated outputs. - Rebuild
nantaizi-lake-innovation-valleyblender,cesium,previewoutputs for manual validation. This task intentionally changes generated GLB structure, so full parity-identical output is not expected.
Acceptance Criteria
scripts/lib/cesium-preview.jshas a small, reviewable optimization that reduces per-frame allocations or render overhead for vehicle cruise.blender/generate_scene.pyreduces nantaizi scrub bush node count by at least 50% while keeping scrub polygons present.- Vehicle controls listed in Requirements continue to work by inspection and/or local smoke check.
- Blender/Cesium rebuild for
nantaizi-lake-innovation-valleycompletes and generated metadata still includes scrub counts. node --check scripts/lib/cesium-preview.jspasses.python3 -m py_compile blender/generate_scene.pypasses.- If local output preview JS is updated for testing, it remains ignored and is not committed.
Out Of Scope
- Full scene geometry/material optimization beyond scrub edge bush density.
- Reducing tree count or changing road/building/water assets.
- Replacing Cesium or adding profiling libraries.
- Visual design changes to the preview UI.
Technical Notes
- User confirmed closing
Sceneimproves smoothness, so the scene render load is a real contributor. - Current route data is small:
nantaizi-lake-innovation-valleyhas 9 route segments and the preview uses at most 5 vehicles. - Current nantaizi GLB has 1271 nodes; about 707 are scrub bush nodes. Lowering
scrub edge sampling from
0.82m / 180 per patchto1.8m / 60 per patchshould reduce nantaizi bush samples to about 266 while leaving scrub ground cover intact.