2.7 KiB
2.7 KiB
Architecture Notes
Current Rust module structure
Start simple, then split into crates when module boundaries stabilize.
src/terrain.rs: height grid, bounds, sampling, and deterministic terrain fixtures.src/terrain_gen.rs:TerrainGenerationSpec,TerrainGenerationSettings, andDeterministicTerrainGeneratorfor the seeded terrain-generation pipeline;cargo test terrain_genexercises the determinism/seed note and the first shippedfractalpreset.src/import.rs: importers for open/safe formats (ovp-text, feature-gated HGT, feature-gated ESRI ASCII Grid, and feature-gated GeoTIFF viasrc/import/geotiff.rs); historical compatibility later. Each importer yields the same internalHeightGridplusTerrainSourceMetadata, keeping source formats out of renderer code.src/scene.rsandsrc/scene_file.rs: camera, light, atmosphere, water/vegetation thresholds, and.ovp.tomlpersistence.src/render.rs: deterministic CPU top-down renderer plus CPU perspective demo renderer; WGPU renderer later.src/script.rsandsrc/script_exec.rs: parse and execute project-owned OpenVistaPro script commands.src/path.rs: MakePath-inspired camera keyframe interpolation.src/colormap.rs: palettes and elevation/biome color mapping.src/cli.rsplussrc/main.rs: CLI entry point forinfo,scene export,render, andscript run.src/app_state.rs,src/app.rs, andsrc/bin/openvistapro_app.rs: optionalappfeature shell built witheframe/egui.
Suggested technology choices
- Rust 2021 or newer.
clapfor CLI.serdeplusron/toml/serde_jsonfor scene files.imagefor PNG output and texture loading.nalgebraorglamfor vector/matrix math.wgpupluswinit/eguifor the eventual interactive app.- GeoTIFF support uses the pure-Rust
geotiff-readercrate behind the optionalimport-geotifffeature, so default builds stay free of native dependencies.gdalis intentionally not used; any future GDAL-backed path would be a separate, opt-in feature because native GDAL setup can be heavy.
Development strategy
- Build a deterministic CPU terrain renderer as a reference implementation.
- Add parsers/importers around open formats using tiny test fixtures.
- Add a scriptable CLI so CI can verify output dimensions/hashes/metadata.
- Add interactive UI only after terrain/scene/render core is testable.
- Add GPU renderer and advanced effects once CPU behavior is understood.
Compatibility strategy
OpenVistaPro should preserve workflow concepts first. Direct legacy file compatibility is out of scope for the current clean-room pipeline; the supported export surfaces are project-owned .ovp.toml scenes and PNG renders. Any future compatibility work needs a separately reviewed plan.