This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
Conversation
Contributor
|
This fix looks significant enough to warrant changelog entries (at least, for iOS). 🙇 |
Contributor
|
Working on the failing query test in mapbox/mapbox-gl-js#4604. |
jfirebaugh
force-pushed
the
8751-fill_outline-rendering
branch
from
April 18, 2017 21:21
9902294 to
6e12e5e
Compare
Contributor
|
@kkaefer Even with these changes, macosapp still isn't rendering correctly for me locally. |
This was referenced Apr 19, 2017
Member
Author
|
@jfirebaugh What GPU are you using locally? What's the maximum line width in your OpenGL implementation? |
Contributor
|
Intel Iris Graphics 6100, GL_ALIASED_LINE_WIDTH_RANGE = [1, 7], GL_SMOOTH_LINE_WIDTH_RANGE = [0, 7] |
2 tasks
Member
Author
|
Fixed in #9699 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


@jfirebaugh discovered in #8751 that we are using undefined behavior in the
fill_outlineshader: https://github.com/mapbox/mapbox-gl-js/blob/c0dcee76ed5c7d0559bf271ed85692b1b81c654c/src/shaders/fill_outline.fragment.glsl#L11It seems that some implementations correctly interpolate between 1.0 and 0.0 based on the
tvalue, but per the spec, it's undefined behavior.It also fixes outline rendering, which has regressed at some point.
Current behavior when drawing an outline with a color different from the fill color:
New (and correct) behavior:
We are drawing outlines as antialiased
GL_LINESaround the polygon. When the color is identical to the fill color, we are clipping the outline at the polygon bounds (see first image), but we can't do that when the color is different. Therefore, we either render the fill below or above the line. At some point, this regressed into rendering it always below (and in this case, it's clipped/covered by the fill).