WebGL / introduce a stroke-pattern-start-offset style property#16976
Conversation
|
📦 Preview the website for this branch here: https://deploy-preview-16976--ol-site.netlify.app/. |
7b7ef9e to
1428bcb
Compare
Adapted the webgl-line example and webgl-line-pattern rendering test as well.
Stroke is now transparent between symbols; also avoid leaks with neighbouring pixels on the Y axis as well
1428bcb to
cafd628
Compare
3d74a93 to
33e9650
Compare
|
This is ready for review, thanks in advance! |
|
It starts getting noticeable at about zoom level 24, but I guess it depends also on the line length. If I draw the line across the whole world it starts at about zoom level 15. |
|
Let me see if I can tweak the logic a bit further to obtain a better precisin |
on linestring segments. This lets us avoid visual artifacts when zooming on a line above zoom levels 20+. The shader builder can now take a "pattern length" expression which lets us work with smaller numbers than the full actual distance from start.
33e9650 to
f4a6f4c
Compare
|
@M393 I tried improving the logic a bit but in the end the issue is when a line segment is extremely long. So in my tests depending on the length of the segment the zoom level where this glitch happens is between 15 and 23. This might be possible to address by adding even more complexity to the shaders, but for now I think I'll stick to this solution. |
Having join angles of 0 or 2PI was provoking glitches because of divide-by-zero in shaders
f4a6f4c to
0c5f3ad
Compare
|
thank you for the review! |


This PR introduces a
stroke-pattern-start-offsetflat style property (only supported in WebGL).Also fixes:
To do: