Skip to content

port sprite scaling #1124

Closed
Closed

Description

@ansis

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.

Activity

  1. ansis commented on Mar 26, 2015

    @ansis
    ContributorAuthor

    @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?

  2. kkaefer commented on Mar 26, 2015

    @kkaefer
    Member

    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.

  3. kkaefer commented on Mar 26, 2015

    @kkaefer
    Member

    Secondly, we're only doing bilinear interpolation when the user is dragging/rotating the map, not when it's standing still.

  4. ansis commented on Mar 26, 2015

    @ansis
    ContributorAuthor

    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
  5. jfirebaugh commented on Dec 2, 2015

    @jfirebaugh
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions