Skip to content

grid renderer for interactivity #147

Closed

Description

@ansis

Rasterize features to a grid of ids that can be used to enable interaction.

We need to pass an id attribute to the shader.
Shader attributes can't be optional. Either we:

  • have a second set of shaders for grid rendering
  • set the a_id pointer to any data during normal rendering

The first option means more shaders to maintain. The second option is potentially slower, but I need to measure this. We could also generate shaders (this might be necessary for bluesky #146).

performance:

  • render only on move end
  • render only a single tile, lazily?
  • interweave grid rendering?

Initial attempt in gl-interaction

Activity

  1. kkaefer commented on Oct 23, 2013

    @kkaefer
    Member

    We should use an rtree instead. See #35.

  2. ansis commented on Oct 23, 2013

    @ansis
    ContributorAuthor

    I'm curious, what would be the advantage of using an rtree?

    It seems like it would be way more complex. The rtree will narrow down the features by bounding box, but you'll need to iterate over all of them to find if they actually intersect. The intersection calculations would have to consider styles (sizes, widths, offsets, etc). Since the bounding box may change with zoom level, you need to consider that too. On top of that, you'd need to keep the original geometries. By reusing the renderer we get all of this automatically, and performance seems good.

  3. ansis commented on Oct 23, 2013

    @ansis
    ContributorAuthor

    The idea would be to transfer one pixel on each mousemove. While its a bit scary that readPixels is synchronous, it is (for me at least) < 1ms if you're only reading 1 pixel. Its < 10 ms if continuously repainting.

    Tom had a negative reaction to the grid approach too, which probably means I'm missing something here

  4. added a commit that references this issue on Oct 24, 2016
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