This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
Fix rendering of fill outlines that have a different color than the fill itself - #9699
Merged
Merged
Conversation
jfirebaugh
reviewed
Aug 3, 2017
Contributor
There was a problem hiding this comment.
Related issues: #8760, #6927, mapbox/mapbox-gl-js#4601.
| draw(parameters.programs.fillOutline, | ||
| gl::Lines{ 2.0f }, | ||
| parameters.depthModeForSublayer( | ||
| unevaluated.get<FillOutlineColor>().isUndefined() ? 2 : 0, |
Contributor
There was a problem hiding this comment.
It looks like this condition is the opposite of gl-js? Am I reading that right?
Member
Author
There was a problem hiding this comment.
You're right. However, upon further inspection, we're using different formulas to compute the depth mode:
JS:
const farDepth = 1 - ((1 + this.currentLayer) * this.numSublayers + n) * this.depthEpsilon;
const nearDepth = farDepth - 1 + this.depthRange;Native:
const float nearDepth = ((1 + currentLayer) * numSublayers + n) * depthEpsilon;
const float farDepth = nearDepth + depthRangeSize;I'll ticket this as a separate change that we'll have to make.
kkaefer
force-pushed
the
fix-colored-outline-rendering
branch
2 times, most recently
from
August 4, 2017 15:51
b70ba6d to
19a32ec
Compare
Member
Author
|
This change also fixes #8760. It requires mapbox/mapbox-gl-js#5099 to be merged simultaneously. |
kkaefer
force-pushed
the
fix-colored-outline-rendering
branch
from
August 4, 2017 16:37
19a32ec to
8bf13ab
Compare
jfirebaugh
approved these changes
Aug 4, 2017
…n the fill itself
kkaefer
force-pushed
the
fix-colored-outline-rendering
branch
from
August 7, 2017 08:06
8bf13ab to
b0fd292
Compare
This was referenced Aug 7, 2017
Closed
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.
Fixes #9690.
We're rendering polygon outlines in the same color as the polygon in order to achieve an antialiasing effect. In this case, the rendering order works like this:
When the outline color didn't match the fill color, we did it this way:
This seems to be the part that broke:
This change restores usage of sublayer 0 for mismatched fill/outline color, and sublayer 2 for identical fill/outline color. It also changes the depth mode to prevent writing to the depth buffer when rendering outlines.
Remaining tasks: