-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
clean up matrix creation #3790
Merged
Merged
clean up matrix creation #3790
Conversation
This file contains 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
mourner
approved these changes
Dec 13, 2016
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful!
|
ansis
force-pushed
the
matrix-cleanup
branch
from
December 13, 2016 21:58
eb942a5
to
cb6a1de
Compare
Good to merge, pending a package.json conflict resolution. |
Needs rebase and moving shader changes here after |
This replaces a hardcoded shader approximation with a more correct, FOV-dependent one. `gl_Position.w - 0.5` is replaced with `gl_Position.w / tan(fov)` The `/ tan(fov)` is handled by multiplying `1 / tan(fov)` into `u_gamma` outside the shader. I think `- 0.5` was just chosen as something that looked right for the default fov.
`altitude` was a terribly-named variable that was used to indirectly control the fov. This should eliminate some confusion. `altitude` was equivalent to `cameraToCenterDistance / height`
Project the extrusion and compare it's projected pixel length with the actual pixel length and adjust antialiasing accordingly. The previous approach calculated the adjustment much more indirectly and had no intuitive explanation.
ansis
force-pushed
the
matrix-cleanup
branch
from
December 14, 2016 19:09
cb6a1de
to
ef5582d
Compare
This was referenced Dec 14, 2016
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This cleans up a bunch of matrix and antialiasing code.
altitude
and replaces it withfov
lineStretch
andlineAntialiasingMatrix
related prs:
mapbox/mapbox-gl-shaders#41
mapbox/mapbox-gl-test-suite#193
Launch Checklist
TODO:
@lucaswoj @mourner