Decouple layout and populating paint attribute buffers
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
Currently, the following two processes are always done together:
- _layout_ - i.e., parsing vector tile feature geometries into a "layout vertex array" for each layer. This includes, e.g., symbol placement (and collision detection), triangulating polygons with `earcut`, etc.
- _populating paint attribute buffers_ - when a layer has data-driven paint properties (i.e. feature-property-dependent), we populate a "paint vertex array" (or more than one, in GL Native), parallel to the layout array, containing paint attribute data for each vertex.
The principal reason for building these arrays in tandem is that it prevents us from having to keep track of which vertices belong to each vector tile feature. We _could_ track this, though, and it would allow us to update paint buffers without redoing layout, which might significantly improve runtime styling performance in the case where a user sets a paint property to a data-driven value. (E.g. https://github.com/mapbox/mapbox-gl-js/issues/4575)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the layout process for vector tile feature geometries and the parallel paint vertex array, including symbol placement, collision detection, and polygon triangulation with earcut. Determine how feature-to-vertex ownership could be tracked so paint buffers can be updated without rerunning layout; done means the two processes can run independently for data-driven paint changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100