Optimize terrain rendering for large exports

This commit is contained in:
2026-10-04 21:47:08 +05:00
parent 3bdf987916
commit 79d0f53a79
8 changed files with 647 additions and 274 deletions

View File

@@ -50,6 +50,14 @@ The worker renders the map and panoramas. Open the private draft in your dashboa
Both the dashboard and draft show completed-work progress: downloading, reading/indexing terrain, loading models, building geometry, rendering panorama faces, rendering the surface map, and saving images. Percentages are not a time estimate. The terminal reports block/face counts as work advances. A large export can take longer on a Mac using software rendering.
The renderer compiles each block state's model transforms, textures and UVs once, then builds blocks synchronously into bounded typed buffers. Hidden faces use a compact bitset index. Meshes are split into 64 × 64-block regions so panorama cameras can cull distant/off-screen geometry while the surface map still covers the complete area. No terrain is downsampled by this optimization. Model loading and image uploads use bounded parallel requests, and panorama faces are encoded directly as WebP.
`MINEGEO_RENDER_BACKEND=auto` (the default) allows Chromium to use the GPU. If graphics initialization fails, the worker falls back to SwiftShader. To force the original software backend on a host with graphics driver issues, use `MINEGEO_RENDER_BACKEND=software` in `.env.local` and restart. The log names the actual graphics renderer; `auto` does not guarantee that the host has GPU acceleration.
Building logs now include blocks per second. Each job's local `render-report.json` records indexing/model/build times, emitted and hidden face counts, geometry bytes, mesh count and actual graphics backend; the worker prints this report when rendering finishes. Use those measurements to compare runs on the same Mac and export. An existing running worker must be restarted after pulling the optimizer to use the new builder.
Stopping the updated worker cancels its renderer and returns its job to the queue without using up a retry. The next worker renders that export from the beginning; completed published maps are unaffected.
If the worker stops renewing its lease, the page warns that it has stopped reporting. Renderer cancellation closes its browser, and `MINEGEO_RENDER_IDLE_SECONDS` (default 600) fails a renderer that reports no progress for that period. This is an inactivity limit, not a limit on total rendering time. Use a smaller export area or lower `MINEGEO_FACE_SIZE` if rendering one face exceeds it.
## Retry, cancel, and configure