Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

clip geometries before adding to buffer #229

Closed

Description

@ansis

Just something to think about

Clip geometries to tile edges before adding them to the buffers so that we can draw tiles without clipping them along their outside edges.

This would let us

  • do draw-time clipping with 2 stencil bits per source, without a limit on the number of different zoom levels tiles can be at
  • not clip geojson layers at all

it could be helpful for #206 #220 #163


Details:

We would only have to clip within the tile at draw time. For example, if a parent tile has only one loaded child, then the parent tile needs to be clipped to avoid double-drawing the child.

The clipping could be done with 2 stencil bits per source, with no limit on the number of zoom levels. It would need to be drawn in multiple passes just like the current clip mask. You calculate the values by iterate of tiles in increasing z level. For each tile there will be 0 to 3 parent tiles that share edges with this tile (a bit of mod math). Pick a value that is used by none of these tiles.

This means you could clip for 8bits/2bits = 4 different sources. Sources that aren't tiled, like geojson, wouldn't have to be clipped at all. Rasters could be clipped by providing different geometries at draw-time. Stencil clipping would only be used for tiled vector sources, so 4 is more than enough. If text is parsed and placed only after parsing non-text layers then each source would used 2 * 2bits #163

Activity

  1. kkaefer commented on May 22, 2014

    @kkaefer
    Member

    What are we doing with things that exceed the current clip area, like line caps?

  2. ansis commented on May 22, 2014

    @ansis
    ContributorAuthor

    Draw them over the edge of the tile. Since we're drawing layer-by-layer this should be fine, right?

  3. kkaefer commented on May 22, 2014

    @kkaefer
    Member

    Mostly, the issue I'm seeing is that in overlapping areas, we'll have antialiased edges stacked, which means that the fringes will appear darker because multiple lines are in that location. Same issue with non-opaque objects.

  4. added
    Core
    on Mar 10, 2017
  5. added
    archived
    on Nov 11, 2018
  6. stale commented on Nov 25, 2018

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

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

    Corearchived

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions