feat: add optional GeoTIFF importer #10

Merged
moldybits merged 4 commits from feat/import-geotiff into main 2026-05-16 16:06:19 -04:00
Showing only changes of commit 101303cd5c - Show all commits
+34 -55
View File
@@ -1,63 +1,42 @@
# Feature Inventory # Feature Inventory
This is a first-pass inventory from the VistaPro 2/3 manuals, MakePath guide, screenshots, and public descriptions. This is a normalized reconciliation of the VistaPro manuals, MakePath guide, screenshots, and current OpenVistaPro implementation.
## Terrain sources Status counts by normalized feature family:
- Implemented: 7
- Partial: 7
- Planned: 6
- VistaPro landscape files. Notes:
- USGS DEM elevation data. - “Implemented” means the current codebase has a working, tested slice for that family.
- NASA/planetary or other gridded elevation datasets. - “Partial” means the codebase covers part of the family but not the full manual-described workflow.
- Fractal landscape generation. - “Planned” means the family is still absent or only mentioned as roadmap context.
- User-supplied two-dimensional integer height arrays, up to historical limits around 1024x1024.
## Scene controls ## Normalized feature families
- Camera and target X/Y/Z positioning. | Feature family | Manual / reference evidence | OpenVistaPro status | Implementation evidence | Gap / next step |
- Lens/range controls. |---|---|---|---|---|
- Bank, heading, and pitch. | Terrain sources and compatibility boundary | VistaPro 2 manual: Load Landscape / Save Landscape; VistaPro 3 manual: Load, Save, Exp/Imp menus and DEM/PCX/Targa24 references. | Partial | `src/import.rs`, `src/cli.rs` (`supported_importers()`), `README.md` importer status. | OpenVistaPro intentionally keeps the clean internal model separate and does not claim legacy VistaPro format compatibility. |
- Sea level and water planes. | Project-owned plain-text heightfields (`ovp-text`) | Clean-room project fixture format, not part of the legacy manuals; used to model the import boundary safely. | Implemented | `src/import.rs` (`import_ovp_text`), tests in `src/import.rs`, fixture in `tests/fixtures/open/`. | No gap for the MVP slice; this is the project-owned test/import path. |
- Lake and river controls. | SRTM / HGT terrain import | VistaPro manuals describe loading DEM-like landscape data; the open equivalent is the SRTM/HGT family. | Implemented | `src/import.rs` (`import_hgt` behind `hgt`), `README.md`, tests in `src/import.rs`. | Still only the open SRTM slice; broader compatibility formats remain separate. |
- Timber/tree line, tree drawing, and tree density. | GeoTIFF terrain import | Modern open terrain source, not a legacy VistaPro format. | Implemented | `src/import/geotiff.rs` behind `import-geotiff`, tests in that module. | Deliberately narrow subset: tiny synthetic single-band raster support only. |
- Snow line. | Fractal / synthetic terrain generation | VistaPro overview calls out fractal landscapes and generated terrain. | Partial | `src/terrain.rs` (`plane`, `radial_hill`), `src/app_state.rs` presets. | Current terrain generation is only deterministic fixtures, not a true fractal/noise terrain engine. |
- Haze/fog distance. | Camera and target placement | VistaPro 2 / 3 manuals: “Setting Camera and Target”; screenshot workflow uses camera/target gadgets. | Implemented | `src/scene.rs` (`Camera`), `src/app.rs` (camera position/target controls), `src/app_state.rs`. | Only the core position/target slice exists; there is no map-click placement UI yet. |
- Sky/stars options. | Lens / range / orientation controls | VistaPro manuals describe lens/range, bank, heading, and pitch controls. | Partial | `src/scene.rs` (`Camera.fov_degrees`), `src/render.rs` perspective renderer. | No explicit bank/heading/pitch model or legacy lens/range UI yet. |
- Light direction and custom lighting. | Water / sea level, tree line, snow line, haze | Manuals repeatedly mention tree line, snow line, water level, haze, and atmospheric tuning. | Implemented | `src/scene.rs`, `src/app.rs` sliders, `src/colormap.rs`, `src/render.rs`. | Rivers/lakes are still missing, but the core elevation-band controls are present. |
- Vertical exaggeration. | Rivers and lakes | VistaPro manuals explicitly mention rivers and lakes as adjustable landscape features. | Planned | Not yet represented in `Scene` or renderer code. | Add hydrology controls/data model before claiming this family. |
- Color maps/palettes. | Light direction and custom lighting | Manuals discuss sunlight placement and lighting experiments. | Partial | `src/scene.rs` (`Light`), `src/render.rs`, `src/app.rs` (light state exists in the scene model even if UI is minimal). | The current model is much simpler than VistaPros lighting workflow and lacks richer light controls. |
- Texture image loading, including PCX in the Windows manual. | Vertical exaggeration | VistaPro manuals describe vertical scaling / scene exaggeration controls. | Planned | No dedicated field or control in the current scene model. | Add an explicit vertical-scale parameter and render integration. |
| Color maps / palettes / texture image loading | VistaPro 3 manual includes loading PCX images, adding texture, and saving/loading color maps. | Partial | `src/colormap.rs` fixed bands, `src/render.rs` uses scene thresholds. | No color-map editor, no palette import/export, and no PCX/texture loading yet. |
| Preview / final render workflow | VistaPro manuals describe rough preview rendering and full render output. | Implemented | `src/render.rs` (`render_top_down`, `render_perspective`), `src/cli.rs` (`render`), tests in `src/render.rs`. | The preview/final split is still simplified, but the core render outputs are working. |
| Render quality presets / smoothing / detail tradeoffs | VistaPro manuals describe quality menus and poly/detail tradeoffs. | Planned | No dedicated quality preset system in current code. | Add explicit quality presets or a render-quality profile object. |
| Scene file save/load (`.ovp.toml`) | Not a VistaPro legacy format; this is the clean-room OpenVistaPro scene format. | Implemented | `src/scene_file.rs`, `src/cli.rs` (`scene export`), tests in `src/scene_file.rs`. | No gap for the project-owned scene format slice. |
| Script language parser | MakePath guide and VistaPro manual describe scripts and “Run Script” workflows. | Partial | `src/script.rs` parser, tests in `src/script.rs`, `README.md` script section. | Parser exists, but script execution is intentionally deferred. |
| Script execution and animation frames | MakePath guide says scripts should render full animations and VistaPro can run scripts from the Script menu. | Planned | No script runner or frame-sequencing engine exists yet. | Add execution semantics once the command model is stable. |
| MakePath-style path generation and motion models | MakePath guide describes spline nodes, previewing a path, and vehicle models (jet, glider, dune buggy, motorcycle, helicopter, cruise missile, custom). | Planned | No path generator or motion-model layer exists yet. | This is a separate planner/animation feature, not just a script parser. |
| UI shell, menus, dialogs, and numeric gadgets | VistaPro screenshots/manuals show dense menus, dialogs, map tools, and numeric gadgets. | Partial | `src/app.rs`, `src/app_state.rs`, `src/bin/openvistapro_app.rs`. | Current UI is an egui CPU-preview shell with a small control set, not the legacy menu hierarchy. |
| Legacy image / landscape export formats | VistaPro manuals mention saving rendered images and landscapes in formats like IFF/IFF24/RGB and DEM/binary landscape files. | Planned | Current output is PNG plus project-owned `.ovp.toml` scenes. | Add separate compatibility/export work only after the clean internal pipeline is stable. |
## Rendering and quality ## Current reconciliation summary
- Wire/topographic preview workflow. OpenVistaPro already covers the core clean-room pipeline: terrain grids, open importers, scene state, preview/final rendering, project-owned scene files, and a small script parser. The remaining VistaPro-specific gaps cluster around legacy compatibility, richer scene controls, script execution, MakePath-style animation tooling, and the old dense UI/menu workflow.
- Progressive/final render action.
- Quality menu/settings for smoothing/detail/performance tradeoffs.
- Save rendered images; historical formats included IFF/IFF24/RGB on Amiga and PC-era formats on Windows.
- 24-bit output was a differentiator in user examples.
## Scripting and animation
- Script files list camera/target positions and commands.
- Scripts are landscape-independent enough to rerun against different terrain/settings.
- Commands include camera coordinates, vertical scale, and render actions.
- VistaPro could generate simple linear camera-to-target paths.
- MakePath Flight Director created spline paths over a topographic map and exported VistaPro scripts.
- MakePath vehicle models included jet, glider, dune buggy, motorcycle, helicopter, cruise missile, and custom vehicles.
## UI surfaces observed in screenshots
- Main workspace with topographic map/preview on the left and dense control panels on the right.
- Pull-down menus: Project, Load, Save, Exp/Imp, Script, Image, Quality, and related dialogs.
- File dialogs and confirmation/progress dialogs.
- Numeric/text gadgets for direct value editing.
- Multiple lower control panels for color-map/palette editing, fractal settings, lighting, and scene/environment settings.
- Color-map editor with vertical channel/range sliders and palette swatches.
- Map/radar-like view for camera/target placement.
## Modernization opportunities
- Replace dense fixed control panels with an immediate-mode or dockable UI.
- Use modern terrain formats: GeoTIFF/COG, DEM, HGT/SRTM, PNG/RAW heightmaps.
- Use WGPU for cross-platform rendering.
- Add reproducible scene files in human-readable formats such as RON/TOML/JSON.
- Provide CLI rendering for tests and batch workflows.
- Keep compatibility import/export separate from the clean internal model.