Skip to content
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

Closed
ansis opened this issue Mar 25, 2015 · 5 comments
Closed

port sprite scaling #1124

ansis opened this issue Mar 25, 2015 · 5 comments

Comments

@ansis
Copy link
Contributor

ansis commented Mar 25, 2015

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.

@ansis
Copy link
Contributor Author

ansis commented 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
Copy link
Member

kkaefer commented 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
Copy link
Member

kkaefer commented 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
Copy link
Contributor Author

ansis commented 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 only doing bilinear interpolation when the user is dragging/rotating the map, not when it's standing still.

We're doing it when the map is standing still for

  • patterns
  • icons aligned with lines (oneway arrows)
  • every icon in perspective view

@jfirebaugh
Copy link
Contributor

Not going to do this: mapbox/mapbox-gl-native#3164.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants