Skip to content
This repository has been archived by the owner on Apr 10, 2018. It is now read-only.

Lines and fills in style #9

Closed
mourner opened this issue Apr 10, 2014 · 2 comments
Closed

Lines and fills in style #9

mourner opened this issue Apr 10, 2014 · 2 comments

Comments

@mourner
Copy link
Member

mourner commented Apr 10, 2014

Another issue previously discussed in mapbox/mapbox-gl-js#244 and GL chat, cc @kkaefer @ansis @edenh

Currently we specify fill outlines with stroke color property (which are always 1px width), and we use the same fill buffers used for fills to draw outlines (with line strips).

In the proposed spec, we would have the ability to specify both fill and line renderer types for one layer, and customize line width too. But that means that we will have to handle fill buckets very differently — buffers will be much bigger because outlines should be tessellated — triangles and not just vertex coords, we'll handle stuff like line joins, draw as triangles and not line strips etc., which should degrade performance significantly, particularly in building-dense areas.

As we have a script that processes user-friendly styles into renderer-friendly styles, we could make things easier by looking at widths of lines through different classes for each layer and whether they're accompanied by fills, and generate different bucket types for renderer consumption to optimize rendering and buffer sizes, e.g.:

  • just <=1px line — outline (line strips, will make all lines faster)
  • fill with <=1px line — fill (the same as we handle fills now)
  • just >1px line — line (tesselated buffer, same as we handle lines now)
  • =1px line with fill — strokedfill (special bucket that shares tesselated line with fill coords?)

I suppose the last one should be a special case and not just 2 independent buckets because line width would affect fill area coords.

@ansis
Copy link
Contributor

ansis commented Jun 20, 2014

@mourner can this be close now that we have v3?

Fills with wide strokes still need to be created as separate layers. I think we've decided this is more honest about how the renderer works.

1px lines drawn with lines aren't possible right now, but I think this is ok. The performance difference shouldn't be that big, and 1px lines are pretty uncommon in styles.

@mourner
Copy link
Member Author

mourner commented Jun 20, 2014

Sure.

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

No branches or pull requests

2 participants