Repository navigation
[9.4-release] fix(extensions): FillStyleExtension pattern placement in GlobeView (#10658) - #11056
Conversation
[Medium impact] The change affects the FillStyleExtension pattern-rendering workflow. The PR appears safe to merge, with a non-blocking pattern jump when users pan across the antimeridian. Findings
SummaryBackports the
Reviews (1) · Last reviewed commit: "fix(extensions): FillStyleExtension patt..." · Reviewed by Greptile |
| float fill_cameraFlatX = project_common_position_to_flat(project.cameraPosition).x; | ||
| vec2 fill_flatPosition = project_common_position_to_flat_continuous(geometry.position, fill_cameraFlatX); |
There was a problem hiding this comment.
When the camera crosses ±180°, atan makes fill_cameraFlatX jump between roughly 512 and 0. The wrap then shifts every visible vertex's fill_flatPosition.x by 512. That is not generally a whole number of pattern repeats, so the pattern suddenly changes alignment inside the polygon. The new 45° hatch with a 13-pixel period is one example.
Preserve a continuous world-copy reference or compensate the pattern offset when the camera crosses this boundary.
Follow up of #10658, for #10972
Background
Backports #10658 to
9.4-release. Fixes FillStyleExtension pattern placement in GlobeView.Change List
-xtest/render/test-cases/fill-pattern.spec.ts. The 9.4 test still usesCOORDINATE_SYSTEM.CARTESIAN; master replaced it as part of the arbitrary-CRS work (feat(core): layer coordinateSystem supports arbitrary CRS #10874), which isn't in 9.4. So the import keepsCOORDINATE_SYSTEMand adds_GlobeView as GlobeView.getFlatCommonOrigin,project_common_position_to_flat_continuous) shipped in 9.4.1 (feat: flat common-space helpers for non-flat projections + view-matrix render tests #10657).Verified locally on 9.4:
test/modules/extensions/fill-style.spec.tspasses (5 tests), and thefill-patternrender tests pass under WebGL with the new globe goldens (14 passed, 1 skipped).Note
Low Risk
Targeted shader and uniform calculation update for GlobeView projection in FillStyleExtension, well covered by unit and visual regression tests.
Overview
Enables
FillStyleExtensionpattern rendering and texture placement inGlobeView.The vertex shader now flattens sphere coordinates to continuous Mercator coordinates using
project_common_position_to_flat_continuous, preventing pattern seam distortions across the antimeridian. The CPU uniform calculations now usegetFlatCommonOriginso pattern UV origins properly evaluate to absolute Mercator coordinates on the globe instead of spherical common coordinates.Unit and visual regression render test suites are expanded to verify raster and procedural fill patterns across both
MapViewandGlobeView, including antimeridian boundary tests.Reviewed by Cursor Bugbot for commit 29ed3e9. Bugbot is set up for automated code reviews on this repo. Configure here.