Repository navigation
fix(core): orient GlobeView meter offsets east, north and up (1/2) - #10914
Merged
Merged
Conversation
[Medium impact] The PR appears safe to merge with no new blocking findings. SummaryCorrects globe meter offsets to point east, north and up in GLSL and WGSL.
No new actionable issues found. Tests were inspected but not run. Reviews (8) · Last reviewed commit: "Merge branch 'master' into fix/globe-ori..." · Reviewed by Greptile |
ibgreen
reviewed
Oct 26, 2026
ibgreen
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the current head. CI passes, the prior review comments are resolved, and I found no remaining code blocker. This looks ready for approval once the reported merge conflict with master is resolved.
ibgreen
approved these changes
Oct 26, 2026
29 of 30 tasks
chrisgervang
reviewed
Nov 2, 2026
Collaborator
|
Do we have a before/after image of the scenegraoh layer? |
project_get_orientation_matrix returned columns pointing west and south. project_position_to_clipspace and project_normal rotate meter offsets by it, so below zoom 12 GlobeView turned every offset half a turn about the local up direction: SimpleMeshLayer and ScenegraphLayer meshes, ColumnLayer angles, and IconLayer and TextLayer with billboard: false. They turned back at the zoom-12 switch to WebMercatorViewport. The meter-offsets projection negated x and y to compensate, so it was already correct. The matrix now returns east, north and up columns, and the meter-offsets projection no longer negates. At the poles, east is +x, the limit of east along longitude 0, so a meter-offset origin exactly at a pole now matches its neighbours instead of being turned half a turn. The WGSL version passed its select() arguments in the wrong order: away from the poles x was always +x, and at the poles normalize(vec3(0.0)) gave NaN, including for normals that SimpleMeshLayer and ScenegraphLayer project before setting geometry.position. It now matches the GLSL. The CPU mirrors of the frame in @deck.gl/extensions and deck-gpu-layers follow the new convention; their results are unchanged away from the poles. Co-Authored-By: Claude Opus 5.5 <[email protected]>
At a pole, project_get_orientation_matrix returns the limit of east along the longitude that up retains: GlobeViewport.projectPosition leaves a tiny horizontal component, so an origin at [90, 90] has east +y. Only an up exactly on the polar axis takes +x. Say so in the shader comments, the project docs, the upgrade guide and the deck-gpu-layers mirror, and test both poles at nonzero longitudes on WebGL and WebGPU. WGSL test literals now use exponent notation so that those tiny components survive. The GlobeView SimpleMeshLayer test now finalizes its Deck in a finally block. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…device A Deck created without a device builds its own WebGL device in the shared headless page, which broke uniform block layouts for later test files (ScreenGridLayer, BrushingExtension, ArcLayer and others). Use the shared 1x1 test device, center the view on each expected location, and keep the mesh below the camera. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ibgreen
force-pushed
the
fix/globe-orientation-matrix
branch
from
November 4, 2026 18:15
61d2db6 to
33058af
Compare
ibgreen
approved these changes
Nov 4, 2026
Member
Author
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.

Follow up of #10252. Part 1 of 2: this PR orients globe meter offsets, and #10915 orients their normals.
Since #10791,
GlobeViewportappliespositioneast, north and up. The shader'sproject_get_orientation_matrixbuilds its x axis asnormalize(vec3(uz.y, -uz.x, 0)), which points west, so its frame is west/south/up. Below zoom 12, offsets passed toproject_position_to_clipspaceare turned half a turn:SimpleMeshLayerandScenegraphLayermeshes face backwards untilGlobeViewswitches to Web Mercator and they flip. In WGSL,select()has its arguments swapped, so east is always +x and the poles give NaN.Change List
project_get_orientation_matrix: return east, north and up columnsproject_get_orientation_matrix: fix swappedselect()arguments-xy@deck.gl/extensions,deck-gpu-layersframe mirrors: match the shaderGlobeViewto compensate must remove that rotationVerified with headless unit tests on WebGL2 and WebGPU (the new tests fail on master) and the globe render tests (no golden changes).
Note
Medium Risk
Modifies shader coordinate orientation for GlobeView meter offsets, which fixes backwards geometry but may alter rendering for applications that applied compensating rotations.
Overview
Corrects the orientation frame of
project_get_orientation_matrixin both GLSL and WGSL shaders so that tangent vectors point east, north, and up (ENU) instead of west, south, and up inGlobeView.This aligns meter offsets in
GlobeViewwithMapView, eliminating mesh reversals below zoom 12 and removing the compensatory negation of horizontal coordinates in meter-offset projections. It also preserves longitude components at the poles to avoid cosine rounding issues on the GPU, and updates corresponding CPU projection utilities in@deck.gl/extensionsand@deck.gl/proposals.Comprehensive tests are added for WebGL and WebGPU shader projections across orientations and zoom transitions, along with migration guidance in the v9.4 upgrade guide.
Reviewed by Cursor Bugbot for commit c391f2a. Bugbot is set up for automated code reviews on this repo. Configure here.