You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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 only doing bilinear interpolation when the user is dragging/rotating the map, not when it's standing still.
Activity
ansis commentedon Mar 26, 2015
@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?
kkaefer commentedon Mar 26, 2015
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.
kkaefer commentedon Mar 26, 2015
Secondly, we're only doing bilinear interpolation when the user is dragging/rotating the map, not when it's standing still.
ansis commentedon Mar 26, 2015
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
jfirebaugh commentedon Dec 2, 2015
Not going to do this: mapbox/mapbox-gl-native#3164.