Skip to content
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 gamma scale #3797

Closed
wants to merge 2 commits into from
Closed

Clean up gamma scale #3797

wants to merge 2 commits into from

Conversation

lucaswoj
Copy link
Contributor

@lucaswoj lucaswoj commented Dec 14, 2016

Continued from mapbox/mapbox-gl-shaders#41

First commit fixes text blurriness at non-default FOVs and removes a magic constant.

Second commit changes how the line antialiasing adjustment is calculated. It now projects the extrusion and compares it's projected pitched pixel length with the length it would have in a non-pitched view. It drops u_extra and u_antialiasing_matrix.

@kkaefer @lucaswoj

cc @ansis

`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.
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
Copy link
Contributor

ansis commented Dec 14, 2016

merged as part of #3790

@ansis ansis closed this Dec 14, 2016
@ansis ansis deleted the clean-up-gamma-scale branch December 14, 2016 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants