I’m working on 2d map, where I have to render buildings (polygons with some fill and border colors). Three.js library used. I use shader where GLSL program handle rendering of all buildings as well as hover/select effects by changing the colors.
The problem with borders of buildings. The barycentric coordinates approach is used for rendering of borders: https://stackoverflow.com/a/18068177/3093329
In simple cases of square building I have to specify which diagonal lines (edges) have to be eliminated and it easy because it always the same. But in cases of more complex shapes of building I can't define these edges easily because they always are different:
So, is this approach the only one way how to render borders of polygons? How can I define which edges have to be eliminated in complex cases?