-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
port sprite scaling #1124
Comments
@kkaefer can you comment on why it's preferable to scale images when adding them to the sprite instead of just scaling them in gl? |
We're doing this in response to pixel ratio changes: When pixel ratio of the map changes (e.g. the user drags the window to a screen with different pixel density), we're scaling the existing sprite atlas immediately, and kick of loading the sprite for the new pixel ratio. This takes some time though; and meanwhile we're showing the old (scaled) sprite. However, we need the space so we can update the sprite atlas with more appropriate graphics once the new sprite image is in. |
Secondly, we're only doing bilinear interpolation when the user is dragging/rotating the map, not when it's standing still. |
How often do pixel density changes happen? It seems like something that happens rarely on the web and almost never on mobile. I'm not sure it's something we need to handle at all as long as the old images render at the right size. Or we could just blow everything away and reparse tiles.
We're doing it when the map is standing still for
|
Not going to do this: mapbox/mapbox-gl-native#3164. |
mapbox/mapbox-gl-native@48c55af
I'm not sure that scaling up images when adding them to the sprite atlas is the right approach. They'll get bilinearly interpolated again when they are sampled in gl. Doing this in two separate steps instead of letting gl handle the scaling might produce blurrier results.
The text was updated successfully, but these errors were encountered: