geojs icon indicating copy to clipboard operation
geojs copied to clipboard

Polygon border draw order

Open jbeezley opened this issue 6 years ago • 4 comments

When drawing a polygon on top of another polygon with a border, the draw order is sometimes not consistent between the border and the interior. I assume this is caused by internally creating a line feature to draw the border of a polygon. In the attached image, all colors are fully opaque.

test

jbeezley avatar Dec 14 '17 13:12 jbeezley

Yes -- we draw all of the interiors, and then all of the borders. I'll have to think about an efficient solution to this.

manthey avatar Dec 14 '17 13:12 manthey

We should be able to use a z-value during the gl rendering to fix this.

manthey avatar Dec 15 '17 17:12 manthey

David if it is gl backend one efficient solution would be to disable depth write so whatever is drawn last will win.

aashish24 avatar Dec 15 '17 17:12 aashish24

That is the current problem -- we draw all of the interiors, then we draw all of the borders. The last drawn wins. In this case, it will still be more efficient to draw all of the interiors and then all of the borders, since the set up for each (especially borders) is complicated due to all of the possible options. If we map the z-values properly, it will add only a small rendering time penalty (and sometimes by not having to modify the drawing buffer, might actually speed things up), and fix the problem.

manthey avatar Dec 15 '17 17:12 manthey