raster-tile-source: add per-tile fade on new tileset loaded to avoid flicker for raster timeseries #13535
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Launch Checklist
@mapbox/map-design-team
@mapbox/static-apis
if this PR includes style spec API or visual changes.@mapbox/gl-native
if this PR includes shader changes or needs a native port.@mapbox/gl-native
if this PR disables any test because it also needs to be disabled on their side.gl-native
to 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 dev
here 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?