Repository navigation
fix: cache ocean embellishments to reduce map panning lag - #1967
Conversation
✅ Deploy Preview for afmg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@barrulus, the solution is working fine, but I'm not sure I like how isolated it is. We may want to raster-render any layer (like we tried with reliefs), not just ocean bands. And this should be optional under performance settings. So I would prefer a generic 'rasterization' select in performance settings. If it's yes, then we do this caching (rasterization can be more clear name) for what we support. The rasterization module can be much more universal and work on pretty much any layer, not just on ocean bands. |
I think merge as is now, using the same mechanism to overall improve all relief work is a great idea, but it is a larger piece of work, this is a short win that will benefit people today |
|
Ok, let's get back to it later. We have a Draft open for Raster layers. |
Description
Ocean bands and waves repeatedly rasterize complex SVG masks during map movement, causing substantial panning lag in presets such as Atlas. Cache these layers as viewport-sized images so nearby pans can reuse the rendered artwork.
The cache refreshes for zoom, viewport coverage, coastline edits and rendering-quality changes. Original vectors remain available as a fallback and are restored in save/export clones, so
.mapfiles and SVG exports retain their original paths and masks. No dependencies or save-format changes.Refs #1966. This addresses ocean embellishments; Frostbite's separate settlement-icon filter cost remains.
Performance
Average animation-frame interval during the same 30-step pan (lower is better):
Measured with Chromium 155 / SwiftShader, seed 1966, 1600×900 viewport, political layers, Balance quality, DPR 1 and 3× zoom. Camera transforms were asserted before and after each drag. These software-rendering measurements show the relative improvement, not expected timings on a particular GPU.
Validation
.mapsave/reload, SVG export and the PNG export pipeline.Raster allocations are capped at approximately 16 megapixels per ocean layer. Very large or high-DPI views may use reduced on-screen resolution; an existing image can briefly scale while its replacement loads. Native vector saves and exports are unaffected.