|
| 1 | +# rtxpy Roadmap |
| 2 | + |
| 3 | +Evolution path from GPU ray-tracing geospatial engine to a real-time digital twin platform. |
| 4 | + |
| 5 | +Tracked in [#57](https://github.com/makepath/rtxpy/issues/57). |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Current State |
| 10 | + |
| 11 | +rtxpy is a geospatial visualization engine built on NVIDIA OptiX with: |
| 12 | +- Hardware-accelerated ray tracing (triangles, B-spline curves, heightfields) with OptiX 9.1 cluster acceleration |
| 13 | +- Interactive GLFW + Jupyter viewers with 30+ keyboard controls |
| 14 | +- Multi-GAS scene architecture with per-geometry transforms and visibility |
| 15 | +- GPU-accelerated GIS analysis (viewshed, hillshade, slope, aspect) |
| 16 | +- Data integration: Overture Maps, OSM, GTFS, NASA FIRMS, NOAA wind, DEMs (Copernicus, USGS 3DEP) |
| 17 | +- Keyframe animation, flyover tours, GIF/MP4 export |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## Phase 1 — Architecture |
| 22 | + |
| 23 | +Decompose the monolithic `InteractiveViewer` (6400+ lines, ~80 instance variables) into composed, testable subsystems. Approach: plain Python composition — no ECS, no scene graph trees, no event buses. Complexity is added only where profiling justifies it. |
| 24 | + |
| 25 | +### Viewer Decomposition via Composition ([#61](https://github.com/makepath/rtxpy/issues/61)) |
| 26 | + |
| 27 | +Extract subsystem classes from the monolithic `InteractiveViewer`: |
| 28 | + |
| 29 | +- **`CameraState`** — position, yaw, pitch, fov, speeds, `apply_input()`, `view_matrix()` |
| 30 | +- **`TerrainState`** — raster data, mesh cache, resolution management, basemap cycling |
| 31 | +- **`WindState`** — particle arrays, GPU buffers, `step()` simulation |
| 32 | +- **`OverlayManager`** — ordered overlay layers, compositing, alpha control |
| 33 | +- **`ObserverManager`** — observer slots, drone modes, viewshed state |
| 34 | +- **`GeometryLayerManager`** — geometry grouping, visibility cycling, chunk loading (see #62) |
| 35 | +- **`RenderSettings`** — shadows, AO, DOF, denoise, colormap, VE, sun position |
| 36 | +- **`InputState`** — held keys, mouse state, modifiers |
| 37 | +- **`HUDState`** — help overlay, minimap, FPS counter, title text |
| 38 | + |
| 39 | +`InteractiveViewer` holds these as composed objects. `_tick()` delegates to subsystem methods. Selective `@njit` acceleration applied only to proven CPU hotspots (wind particle updates, bilinear Z-sampling). |
| 40 | + |
| 41 | +### Geometry Layer Manager ([#62](https://github.com/makepath/rtxpy/issues/62)) |
| 42 | + |
| 43 | +Replace scattered geometry management variables with a `GeometryLayerManager`: |
| 44 | + |
| 45 | +- Flat layer grouping with ordered visibility cycling — matches OptiX's flat IAS model |
| 46 | +- `GeometryLayer` groups related GAS entries with shared visibility toggle |
| 47 | +- Chunk managers owned by their respective layers |
| 48 | +- Generic `cycle_index()` helper replaces 4 duplicated cycling implementations |
| 49 | +- No scene graph tree — OptiX IAS is inherently flat, hardware BVH already handles frustum culling |
| 50 | + |
| 51 | +### Declarative Key-Binding Map ([#63](https://github.com/makepath/rtxpy/issues/63)) |
| 52 | + |
| 53 | +Replace the 280-line if/elif chain in `_handle_key_press()`: |
| 54 | + |
| 55 | +- Dict-based `(key, shift) → action` dispatch table |
| 56 | +- Direct method calls to subsystem objects — no pub/sub event bus |
| 57 | +- REPL command queue stays as-is (already correct) |
| 58 | +- Help text auto-generation from binding table (stretch goal) |
| 59 | + |
| 60 | +### Main Loop Cleanup ([#64](https://github.com/makepath/rtxpy/issues/64)) |
| 61 | + |
| 62 | +Fix phase ordering and separate concerns in the main loop: |
| 63 | + |
| 64 | +- Move `glfw.poll_events()` before `_tick()` — fixes one-frame input lag |
| 65 | +- Split `_tick()` into clear input / simulation / render sections |
| 66 | +- Extract `_drain_command_queue()` and `_present_if_dirty()` methods |
| 67 | +- Separate render (ray trace + post-process) from present (readback + composite) in `_update_frame()` |
| 68 | +- No fixed-timestep accumulator (no physics), no Platform ABC (two backends don't justify it) |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +## Phase 2 — Rendering |
| 73 | + |
| 74 | +Modern material and effects pipeline. |
| 75 | + |
| 76 | +### PBR Materials |
| 77 | +- Metallic-roughness workflow (glTF PBR model) |
| 78 | +- Per-geometry material assignment |
| 79 | +- Material library: concrete, glass, vegetation, water, asphalt, terrain variants |
| 80 | + |
| 81 | +### Texture & UV Support |
| 82 | +- GLB/glTF texture loading (baseColor, normal, metallic-roughness) |
| 83 | +- UV coordinates via barycentric interpolation in closest-hit |
| 84 | +- Terrain texture splatting, satellite imagery draping |
| 85 | + |
| 86 | +### Render Graph |
| 87 | +- Configurable DAG of render passes (GBuffer → Shadow → AO → GI → Denoise → Tonemap → Composite) |
| 88 | +- Easy to add/remove passes per capability |
| 89 | + |
| 90 | +### Level of Detail |
| 91 | +- Distance-based terrain LOD (subsample far tiles) |
| 92 | +- Instanced geometry LOD, billboard imposters |
| 93 | +- Hybrid: cluster GAS close, simplified GAS far |
| 94 | + |
| 95 | +### Particle Systems |
| 96 | +- GPU particle simulation (CUDA compute kernels) |
| 97 | +- Emitters: point, line, area, volume |
| 98 | +- Applications: smoke/fire, rain/snow, traffic flow, pollution dispersion |
| 99 | + |
| 100 | +--- |
| 101 | + |
| 102 | +## Phase 3 — Simulation |
| 103 | + |
| 104 | +Time-evolving behavior. |
| 105 | + |
| 106 | +### Physics |
| 107 | +- Rigid body dynamics, fluid simulation on terrain |
| 108 | +- Structural load visualization |
| 109 | +- Integration: cuPhysics or bullet3 via CUDA interop |
| 110 | +- Fixed-timestep accumulator pattern added here when physics demands it |
| 111 | + |
| 112 | +### Animation System |
| 113 | +- Property animation: any component value over time |
| 114 | +- Skeletal animation (glTF), procedural animation (flag waving, tree sway) |
| 115 | +- Timeline editor |
| 116 | + |
| 117 | +### AI & Pathfinding |
| 118 | +- Navigation mesh generation from terrain + buildings |
| 119 | +- A*/Dijkstra pathfinding, agent simulation (pedestrians, vehicles, drones) |
| 120 | +- Crowd simulation, GTFS integration for transit agents |
| 121 | + |
| 122 | +### Environmental Simulation |
| 123 | +- Solar exposure accumulation, shadow analysis (hours of sun per location) |
| 124 | +- Noise propagation via ray tracing |
| 125 | +- Line-of-sight network analysis, flood inundation modeling |
| 126 | + |
| 127 | +--- |
| 128 | + |
| 129 | +## Phase 4 — Platform |
| 130 | + |
| 131 | +Accessibility beyond a single Python process. |
| 132 | + |
| 133 | +### Web Viewer |
| 134 | +- Server-side rendering + frame streaming (WebRTC / WebSocket + H.264) |
| 135 | +- Progressive resolution, thin browser client |
| 136 | +- Long-term: WebGPU client with scene serialization |
| 137 | + |
| 138 | +### Multi-User |
| 139 | +- Shared scene state, per-user camera/selection |
| 140 | +- Collaborative annotation, role-based access |
| 141 | + |
| 142 | +### API Layer |
| 143 | +- REST/GraphQL for scene management |
| 144 | +- Python client library (same interface as local accessor) |
| 145 | +- Webhook/event streams, batch rendering API |
| 146 | + |
| 147 | +### IoT & Sensor Integration |
| 148 | +- MQTT/AMQP subscriber → entity binding → visual update |
| 149 | +- Time-series storage and playback, alert rules |
| 150 | + |
| 151 | +--- |
| 152 | + |
| 153 | +## Phase 5 — Digital Twin |
| 154 | + |
| 155 | +Domain-specific capabilities. |
| 156 | + |
| 157 | +### BIM & CityGML |
| 158 | +- IFC, CityGML LOD1–3, 3D Tiles / Cesium ion import |
| 159 | +- Indoor/outdoor seamless navigation |
| 160 | + |
| 161 | +### Temporal Dimension |
| 162 | +- Time slider with historical scene states |
| 163 | +- Version-controlled snapshots, change detection |
| 164 | + |
| 165 | +### What-If Scenarios |
| 166 | +- Fork scenes, modify parameters, compare outcomes |
| 167 | +- Side-by-side comparison views, scenario libraries |
| 168 | + |
| 169 | +### Domain Verticals |
| 170 | +- **Urban Planning**: zoning, density, transit accessibility |
| 171 | +- **Disaster Response**: flood modeling, fire spread, evacuation routing |
| 172 | +- **Telecommunications**: RF propagation via ray tracing, tower placement |
| 173 | +- **Renewable Energy**: solar panel placement, wind farm siting |
| 174 | +- **Environmental Monitoring**: air quality, noise mapping, vegetation health |
| 175 | +- **Infrastructure Management**: utility networks, maintenance scheduling |
| 176 | + |
| 177 | +--- |
| 178 | + |
| 179 | +## Key Advantages |
| 180 | + |
| 181 | +- **Ray tracing as rendering primitive** — viewshed, shadows, AO, GI all share the OptiX pipeline; new analyses = new launch kernel |
| 182 | +- **GIS-native coordinates** — real DEMs with real CRS metadata, GeoJSON/Overture/OSM data flows directly in |
| 183 | +- **xarray accessor** — `dem.rtx.explore()` zero-boilerplate interface |
| 184 | +- **GPU-native data path** — xarray → CuPy → OptiX device buffers, no CPU round-trips |
| 185 | +- **Real-time data patterns** — GTFS-RT, FIRMS, NOAA wind already demonstrate fetch → transform → place → update |
| 186 | +- **Zarr persistence** — spatially chunked mesh store, foundation for LOD streaming and temporal versioning |
0 commit comments