raster-tile-source: add per-tile fade on new tileset loaded to avoid flicker for raster timeseries#13535
raster-tile-source: add per-tile fade on new tileset loaded to avoid flicker for raster timeseries#13535jo-chemla wants to merge 4 commits intomapbox:mainfrom
Conversation
Reworked the implementation to look more like the existing parent/child fading procedure, so passing `u_per_tile_fade_mix / perTileFadeMix` as a uniform computing and storing per-tile the `perTileFadeEndTime` instead of start
replace perTileFadeEndTime by perTileFadeStartTime to test Some wip to try debugging why still tiles flicker Showing tile bounds, it appears tiles are actually marked for expiration
|
After further testing, it looks like the source cache aggressively discards all loaded tiles when This also means tile fading logic could be kept as-is with no modification, at least if tiles get rendered in the order of the cache (or any other deterministic ordering), with older tiles being still drawn as background via fragShader while still in cache, at least before fade finishes, while newer ones gets loaded. Edit: After further digging, I realized |
|
One final feedback after digging through the repo commits and prs: it seems that raster-tile-source smooth fading between (not only parent but also) older/sibling tiles was present in earlier mapbox versions. This smooth per-tile transition from old to new raster tile source on Just pushed some final experiments as to how to retrieve Would love some pointer from the mapbox team to fix this regression! |
Launch Checklist
@mapbox/map-design-team@mapbox/static-apisif this PR includes style spec API or visual changes.@mapbox/gl-nativeif this PR includes shader changes or needs a native port.@mapbox/gl-nativeif this PR disables any test because it also needs to be disabled on their side.gl-nativeto groom in the MAPSNAT JIRA queue if this PR includes shader changes or features not present in the native side or if it disables a test that's not disabled there.This is a draft PR trying to fix issue when switching raster-tile-source urls from eg one date to another, to avoid flicker as described in issue thread #13044 (comment)
The above thread also includes screencast of the issue occuring I also include right below.
2025-08-12.-.15-24-06.mp4
Made a new debug example to test the implementatino, available after
npm i && npm test && npm run devhere http://localhost:9966/debug/test-rastertile-fade.htmlThis PR includes shader changes, so @mapbox/gl-native
The idea is to keep the previous tile texture in memory and shader uniform for a given fade duration amount, before displaying the new tile that has been loaded. I've hacked my way and think I've almost nailed it and wanted to get some feedback before wrapping it up. Inspiration is taken from how fading occurs between tile and parent lower-res tile during loading - but code could have been closer after a second pass.
The PR was tested on windows, hence had to add stylistic eslint rule
'@stylistic/linebreak-style': ["error", "windows"],EDIT: just signed the CLA to proceed, wanted to make sure I will also be in position to contribute the same code I've designed to the maplibre repo. Any insights about that?