Repository navigation
Spike: high-zoom precision via per-tile reference point (superseded by #559) - #558
Closed
kylebarron wants to merge 4 commits into
Closed
kylebarron wants to merge 4 commits into
kylebarron wants to merge 4 commits into
Conversation
Captures the float32 quantization root cause and the split-precision / per-tile reference-point fix for the tile path.
…512) Computes the centroid of projectedCorners per tile so RasterLayer can use it to split mesh vertex positions into a float32 offset plus a float64 origin, preserving precision at high zoom. Pure data addition; no consumer reads the new field yet.
kylebarron
commented
May 19, 2026
| * and a float64 origin to preserve precision at high zoom. Computed once | ||
| * per tile as the centroid of {@link RasterTileMetadata.projectedCorners}. | ||
| * | ||
| * See `dev-docs/specs/2026-05-19-high-zoom-precision-design.md` for the |
Member
Author
There was a problem hiding this comment.
Before merging the PR, I think this is core enough to warrant a top-level dev-doc explainer. Perhaps it should be something like "projection handling" explaining not just high zoom precision handling, and in the future could be expanded with globe view information.
kylebarron
commented
May 19, 2026
| * See `dev-docs/specs/2026-05-19-high-zoom-precision-design.md` for the | ||
| * reasoning. | ||
| */ | ||
| referencePointMeters: Point; |
Member
Author
There was a problem hiding this comment.
Are we sure this is always going to be in meters?
When provided, vertex positions are stored as float32 offsets from the reference point instead of absolute EPSG:3857 meters, eliminating the ~1 m quantization that causes high-zoom jitter on the GPU. No consumer passes the prop yet; default (null) is the prior behavior.
kylebarron
commented
May 19, 2026
| props.reprojectionFns.inverseReproject !== | ||
| oldProps.reprojectionFns?.inverseReproject; | ||
|
|
||
| const refChanged = |
Member
Author
There was a problem hiding this comment.
spell out referencePointChanged
…512) Folds tile.referencePointMeters (float64) into the modelMatrix translation and passes it down to RasterLayer, so vertex positions in the GPU buffer are small float32 offsets instead of full-magnitude 3857 meters. Eliminates sub-meter jitter at z16+ on high-resolution imagery.
Member
Author
4 tasks
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 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 branch: lots of jitter, and in particular per tile independent jitter so we have little gaps between tiles. Jitter noticeably starts above ~z16
Screen.Recording.2026-05-20.at.1.28.10.PM.mov
What this tried
Attack the high-zoom jitter (#512) by keeping mesh vertex magnitudes small: store each vertex as an offset from a per-tile reference point (the tile centroid in EPSG:3857 meters) instead of an absolute coordinate, then add the reference back via the layer transform. Iterations on this branch (and follow-on experiments in the session that produced it):
modelMatrix.translation.coordinateOrigin(let deck.gl's auto-offset subtract it).coordinateOrigin = viewport.center, per-tile shift inmodelMatrix.translation.Why it didn't work
+305in tile A,−305in tile B) makes the two tiles run different float32 arithmetic chains for the same physical point. The sub-pixel disagreement gets amplified by GPU rasterization coverage rounding into visible 1-px seams — whichmaindoes not have (it stores the same absolute value in both tiles, so they're bit-identical). The seam is structural to any per-tile encoding, regardless of where the reference shift lives.shaderCoordinateOrigin) is itself float32 at ~10² world-unit magnitude, leaving a ~1 m floor — indistinguishable frommain.What actually fixed it (#559)
Render the mesh in common space with an identity model matrix and
coordinateOrigin = [0,0,0](soshaderCoordinateOriginis exactlyMath.fround(viewport.center)and the camera-relative subtraction is Sterbenz-exact), plus fp64 attribute pairs for the vertex positions. Absolute common-space coords keep shared boundary vertices bit-identical → no seams. Full write-up in #559.Related: #512