Repository navigation
fix(extensions): FillStyleExtension pattern placement in GlobeView - #10658
Merged
Merged
Conversation
chrisgervang
commented
Sep 20, 2026
chrisgervang
marked this pull request as ready for review
September 20, 2026 21:08
[Medium impact] The PR appears safe to merge, with a non-blocking pattern jump when panning across 180°. Findings
SummaryFixes globe fill patterns by converting sphere positions into flat Mercator coordinates.
Reviews (12) · Last reviewed commit: "Merge branch 'master' into claude/fix-fi..." · Reviewed by Greptile |
chrisgervang
force-pushed
the
claude/fix-fill-style-globe-GveWO
branch
3 times, most recently
from
September 20, 2026 21:53
cdad5eb to
ae8efe9
Compare
chrisgervang
force-pushed
the
claude/fix-fill-style-globe-GveWO
branch
from
September 23, 2026 15:32
0d368b2 to
75da022
Compare
Base automatically changed from
claude/globe-flat-common-helpers-GveWO
to
master
September 25, 2026 17:34
chrisgervang
force-pushed
the
claude/fix-fill-style-globe-GveWO
branch
from
September 25, 2026 17:37
75da022 to
d1d9eea
Compare
chrisgervang
force-pushed
the
claude/fix-fill-style-globe-GveWO
branch
from
October 3, 2026 22:10
d1d9eea to
2eb21e3
Compare
chrisgervang
force-pushed
the
claude/fix-fill-style-globe-GveWO
branch
from
October 23, 2026 00:22
2eb21e3 to
35b6c24
Compare
Fill patterns tile a flat plane, but the shader used geometry.position.xy directly as the pattern coordinate. Under GlobeView that is the x/y of a sphere position (radius 256), so raster atlases and procedural patterns collapsed into a uniform near-transparent haze (centre alpha ~2/255 in the probe render) instead of alternating per polygon. The CPU side had the matching bug: uvCoordinateOrigin was taken from project.commonOrigin, which on the globe is also a sphere-space position. Fix, on top of the flat common-space helpers from the framework branch: - shader-module.ts: compute `vec2 fill_flatPosition = project_common_position_to_flat(geometry.position)` once in vs:DECKGL_FILTER_GL_POSITION and use it for both the procedural and the raster fill_uv. Identity for flat projections (no change on MapView / OrthographicView), absolute Mercator on the globe. - getPatternUniforms: `getFlatCommonOrigin(projectUniforms, viewport)` in place of commonOrigin, so the origin is [0, 0] on GlobeViewport where the flat position is absolute; the period reduction and fp64LowPart are kept. getPatternUnitScale needs no change: 'pixels' uses viewport.zoom, which GlobeViewport calibrates against Mercator, and 'meters' uses the constant Mercator FILL_UV_SCALE, which is the space fill_uv now lives in for both projections. Tests: - fill-pattern.spec.ts: polygon-pattern, polygon-pattern-mask (raster) and fill-pattern-size-units-pixels-zoom-8 (procedural) render under MapView and GlobeView via expandViewMatrix. The existing map goldens are passed through unchanged; +3 globe goldens (threshold 0.985, webgpu skipped). - fill-style.spec.ts: new #uvCoordinateOrigin test asserting [0, 0] on a GlobeViewport and the period-reduced commonOrigin (plus its fp64 low part) on a WebMercatorViewport at zoom 14. Docs: fill-style-extension.md gains a Remarks section on GlobeView support. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
…n on GlobeView Flatten the pattern coordinate with project_common_position_to_flat_wrapped around the camera, so a polygon that spans 180 degrees longitude on the globe no longer interpolates its pattern across a whole world width. Adds a side-by-side MapView/GlobeView render case centred on the antimeridian. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
…instead of Remarks Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
chrisgervang
force-pushed
the
claude/fix-fill-style-globe-GveWO
branch
from
October 23, 2026 00:24
ed129f1 to
1a03d35
Compare
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
ibgreen
approved these changes
Nov 3, 2026
ibgreen
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the flat pattern coordinates, matching origin handling and camera-relative antimeridian continuity, with raster/procedural render coverage and high-zoom origin assertions. No blocking findings. Current GitHub Actions test workflow passes. Review based on source and CI; tests were not run locally.
29 of 30 tasks
chrisgervang
added a commit
that referenced
this pull request
Nov 7, 2026
Collaborator
Author
|
Released in deck.gl 9.4.2, as #11056 on 9.4. |
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 #10657
Background
FillStyleExtensionusesgeometry.position.xyas the pattern coordinate andproject.commonOriginasuvCoordinateOrigin. UnderGlobeViewboth are sphere-space values, so every pattern collapses into a uniform, nearly transparent dot haze (center alpha about 2/255).polygon-pattern-globe: dots and cross-hatch atlas patterns on San Francisco polygons, zoom 11.5polygon-pattern-mask-globe: same withfillPatternMask: trueover a light blue fillfill-pattern-size-units-pixels-zoom-8-globe: procedural dots in pixel units at zoom 8fill-pattern-antimeridian-map-vs-globe:MapViewleft,GlobeViewright, hatched rectangle across 180°Standalone
GlobeView. Before images are the same cases rendered on master; after images are the new goldens and match theirMapViewtwins.Change List
fill-styleshader module: computefill_flatPositiononce inDECKGL_FILTER_GL_POSITIONwithproject_common_position_to_flat_continuous(geometry.position, cameraFlatX)and use it for the procedural and rasterfill_uv. On the globe the Mercator seam moves to the far side of the camera, so a polygon that spans the antimeridian stays continuous; flat maps are unchangedgetPatternUniforms: usegetFlatCommonOrigin, which yields[0, 0]onGlobeViewport; period reduction andfp64LowPartunchangedpolygon-pattern,polygon-pattern-maskandfill-pattern-size-units-pixels-zoom-8also render underGlobeViewviaexpandViewMatrix; 3 new-globegoldens, map goldens unchangedfill-pattern-antimeridian-map-vs-globe.png:MapView(left) andGlobeView(right) centred on 180°, a hatched rectangle from 150°E to 150°W. Look for evenly spaced hatching across the whole rectangle in both halvesuvCoordinateOriginonGlobeViewportand onWebMercatorViewportat zoom 14docs/whats-new.mdnotes GlobeView support; no Remarks added to the extension pageRan the render spec headless on WebGL, the unit spec,
tscand lint.Note
Low Risk
Low risk bugfix localized to the
FillStyleExtensionshader module and uniform calculation, with no impact on existing flat viewport behavior.Overview
Fixes pattern rendering in
FillStyleExtensionwhen usingGlobeView, ensuring hatch, dot, and texture atlas patterns project correctly onto the globe surface instead of collapsing into artifacts.In the vertex shader, vertex coordinates are now projected to flat continuous Mercator space via
project_common_position_to_flat_continuousinstead of reading 3D sphere coordinates fromgeometry.position.xy. On the CPU side,getPatternUniformsnow usesgetFlatCommonOriginso thatGlobeViewportresolves to[0, 0]rather than reusing the 3D sphericalcommonOrigin.Also adds unit tests verifying pattern coordinate origin calculations under both
WebMercatorViewportandGlobeViewport, along with render regression tests for map vs. globe rendering and antimeridian crossing.Reviewed by Cursor Bugbot for commit e8433f6. Bugbot is set up for automated code reviews on this repo. Configure here.