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

Improve webgl coordinate precision. #1005

Merged
merged 1 commit into from
Jul 11, 2019
Merged

Improve webgl coordinate precision. #1005

merged 1 commit into from
Jul 11, 2019

Conversation

manthey
Copy link
Contributor

@manthey manthey commented Jun 11, 2019

For line, point, polygon, and contour features, this uses a localized origin for the view matrix to reduce jitter at high zoom levels.

Using global coordinates runs into the limitations of float precision, which manes that small movements are functionally rounded by that precision. When panning at high zoom levels this manifests as jitter where the features jump between discrete locations instead of panning smoothly. The default is to use the first coordinate of the data of the feature for the origin. For features that span a large area, this will not help the jitter far from that coordinate (but won't be any worse that before this PR). The origin function is exposed on the style object, so if a large area feature is needed, the application can bind geo.event.pan to recompute the origin upon significant changes in the map center at high zoom values.

Resolves #831.

@manthey manthey force-pushed the view-matrix-precision branch 2 times, most recently from d0aa6a3 to 204eb15 Compare June 24, 2019 13:01
For line, point, polygon, and contour features, this uses a localized
origin for the view matrix to reduce jitter at high zoom levels.

Using global coordinates runs into the limitations of float precision,
which manes that small movements are functionally rounded by that
precision.  When panning at high zoom levels this manifests as jitter
where the features jump between discrete locations instead of panning
smoothly.  The default is to use the first coordinate of the data of the
feature for the origin.  For features that span a large area, this will
not help the jitter far from that coordinate (but won't be any worse
that before this PR).  The origin function is exposed on the style
object, so if a large area feature is needed, the application can bind
geo.event.pan to recompute the origin upon significant changes in the
map center at high zoom values.

Resolves #831.
@manthey manthey force-pushed the view-matrix-precision branch from 204eb15 to e11e3b6 Compare July 11, 2019 18:31
@manthey manthey merged commit 64929d6 into master Jul 11, 2019
@manthey manthey deleted the view-matrix-precision branch July 11, 2019 18:49
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.

Improve view matrix precision for WebGL features
2 participants