deck.gl: Mitering bug: PathLayer produces uneven strokes if the path has acute angles
Deck.gl verson: 46add427dd7d2f132f5699e38edcc90802f3fc30 (dev
branch)
Steps to reproduce
- Create a
PathLayer
as follows:
const path = [[-81.29868341618506,41.1053559416184],[-80.97694,41.10014],[-80.82915,41.10922],[-80.84265,41.11511],[-80.76570077085131,41.05483762281574]]
const layer = new PathLayer({
data: [{path}],
opacity: 1,
miterLimit: 1,
strokeWidth: 6e3
})
- Zoom in on Ohio
Expected result
Smooth path.
Actual result
Uneven-width path. See screenshot above.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 16 (7 by maintainers)
@dcposch the PathLayer is already using pre-allocated typed arrays.
Unfortunately the current deck.gl layers are designed to be projection-agnostic, which means we do not know which side of the vertex is going to be an acute angle when we generate the attributes. I’m doing some experiments on this.
I can see your third suggestion having cool use cases, though utilizing depth test will disable opacity blending, thus breaking some other scenarios. Seems like this could be done easily by subclassing the layer and overriding the shader.
I think this issue is closed based on fixes from @Pessimistress
@dcposch That’s good feedback and I understand where you are coming from. At this point let me confirm that geospatial is absolutely the primary use case for deck.gl and any support for other use cases should not compromise this. That said, I’d like to see more concrete examples of things that will be technically significantly easier if we did this.
@contra Really value your input especially since you’ve been an active user since the start. Apart from my comment in this ticket, do you find the messaging around deck.gl unclear? Is there anything you feel should be dropped at this point from the current releases? Or is this mainly forward looking comment? I would hate to muddy the waters.
All I can say is that we are building some pretty amazing “hybrid” apps internally on top of deck.gl (unfortunately not something I can share more about at this point) and we are also finding that deck.gl’s “reactive” programming model, and the ease of packaging WebGL visualizations as reusable layers extends well to other use cases. There is of course a debate about these topics here internally as well, so your input is timely!
@dcposch Yeah, I’d agree with you on that. It would clean up a lot of complexity if deck.gl focused on geospatial displays and dropped support for everything else. Also curious if anyone is using this for non-geospatial use cases - if so I’d imagine they would use something different.
As to the technical challenges, it involves:
project
/project64
modules that depend on uniforms generated by the above viewport to handle all cases