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

Make shaders clamp perspective ratio to reasonable ranges. #6365

Merged
merged 1 commit into from
Mar 20, 2018

Commits on Mar 20, 2018

  1. Make shaders clamp perspective ratio to reasonable ranges.

    This fixes issue #6363, but also guards against a class of bugs:
    
    We previously relied on the assumption that the perspective ratio was calculated with the same anchor point as the item we were drawing. If that assumption was violated, it was possible for overzoomed items far outside of the viewport to grow larger faster than they moved away from the viewport. They could eventually grow large enough to cover the viewport entirely, causing brief "flashes" during map animations.
    
    This commit does _not_ clamp the perspective ratios on the CPU side, to avoid extra work in the inner loop of very performance sensitive collision/projection code. On the collision side, anything far outside of the viewport should be collided/ignored anyway, and on the projection side, we have a filter requiring that the anchor of the label be within the viewport before the projection logic begins.
    ChrisLoer committed Mar 20, 2018
    Configuration menu
    Copy the full SHA
    e517016 View commit details
    Browse the repository at this point in the history