-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix rendering of symbol layers under solid fill layers #2074
Comments
Not as far as I know. Looking back at git history suggests that this existed in your original layer-by-layer branch. https://github.com/mapbox/mapbox-gl-js/blame/aaa7e63bc88bada9b967062826161decf1106c94/js/render/draw_symbol.js#L29 |
When rendering we draw all solid fills top down. We then render everything else bottom-up. We use the depth buffer to drop all fragments that are behind solid fills. This is faster than rendering everything bottom-up because we can drop fragments. Depth testing is disabled for symbols because it breaks We can enable depth testing for We can enable depth testing for If we really want to obey layer order for |
The "highlight features under the mouse pointer" example demonstrates this bug well |
A hacky workaround is to set the fill layer's opacity to |
I'm starting to think we should just not bother with a two-pass implementation. Currently, the only layers we draw in the opaque pass are opaque, non-patterned fills. And since we'd eventually like to figure out how to antialias fills without a separate |
@jfirebaugh was the original reason for the two-pass approach to allow for the depth buffer optimization @ansis described above? I.e.:
|
Yes, precisely, the two pass approach is intended to minimize overdraw. |
I think enabling depth testing for symbols and setting mapbox-gl-js/src/render/painter.js Lines 280 to 284 in ab7d06a
That should make all fragments in the layer have the same value which should make the depth clipping work correctly. I can't remember why they were made different but I don't think that is necessary. If |
It looks like depth testing is disabled for symbol rendering. Is there a good reason?
@scothis
The text was updated successfully, but these errors were encountered: