Repository navigation
feat(layers): math.gl bitmap UV subdivision (2/3) - #10836
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Low impact] The PR appears safe to merge; no new actionable issues were found. SummaryAdds opt-in adaptive refinement to
All six supplied previous threads are unnumbered, so no numbered classifications are recorded. Their concerns are addressed in the current code: regression tests exist, origin changes rebuild meshes, the viewport helper is valid, meter scales are applied, the helper is exported, and test callers supply scales. No new actionable issues found. Tests and visual checks were not run during this review.
|
|
@charlieforward9 Thanks for connecting these. I compared the current diffs: this PR does not supersede #10350 or close #10011 by itself. #10836 adds opt-in adaptive UV mesh subdivision for CPU preprojecting viewports (such as CustomProjectionView), using a sampled error tolerance in map meters. Its default is off, and the refinement path is not enabled for the current GlobeView. #10350 addresses separate correctness issues: rebuilding bitmap geometry and coordinate-conversion uniforms when the viewport mesh resolution changes, plus remapping Mercator-spaced TerrainLayer rows for curved rendering. Neither fix is included here. These changes can coexist. The reusable math.gl subdivision utility provides a useful foundation for future globe refinement, but the GlobeView lifecycle and terrain coordinate fixes still need their own validation. I would keep #10350 and #10011 open until that work lands and the low-zoom reproduction is verified. |
d81d0c5 to
eb7bb77
Compare
|
Refreshed this branch by rebasing it independently onto current master ( |
|
The first post-rebase CI build caught one API mismatch: |
|
Refreshed this branch by merging current master ( |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2657046. Configure here.
chrisgervang
left a comment
There was a problem hiding this comment.
Reviewed 546d620; recommend approval. No P1s. With _projectionTolerance at 0 the bounds mesh is unchanged, and the 7 bitmap headless tests pass at this head. The open greptile thread on tolerance units still holds, and I added a probe there.
Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.
| image: {type: 'image', value: null, async: true}, | ||
| bounds: {type: 'array', value: [1, 0, 0, 1], compare: true}, | ||
| _imageCoordinateSystem: 'default', | ||
| _projectionTolerance: {type: 'number', value: 0, min: 0}, |
There was a problem hiding this comment.
P2: With #11030 and #11031, a layer with positions, imageMapping or meshMaxEdgeLength takes the mesh path. That path skips _createMesh, so _projectionTolerance is ignored with no error. Both branches refine with subdivideTriangleMesh. This one uses projection error in UV space, and #11031 uses source edge length.
- This head merges cleanly with fefe2dc. I read the merged tree and did not run it.
Should BitmapLayer have one refinement control for both paths? If both stay, should mesh mode refine or throw?
…fresh-10836 # Conflicts: # docs/api-reference/core/custom-projection-view.md

Follow up of #10835
Background
Uniform bitmap grids spend vertices in areas with little distortion. Adaptive subdivision in UV space preserves bilinear quadrilateral bounds while refining projection curvature, including triangle interiors. This PR is independent of the converter adapter.
Change List
BitmapLayer._projectionTolerancein map meterssubdivideTriangleMeshVerified with
yarn exec ocular-build layersandyarn lint. Passed 7 bitmap headless tests. Visual checks were not run.Note
Low Risk
Adds an opt-in experimental property with fallback to existing behavior when unset. Existing layer workflows and rendering pipelines are unaffected.
Overview
Adds an experimental
_projectionToleranceprop toBitmapLayerthat enables adaptive triangle mesh subdivision in UV space using@math.gl/geometry'ssubdivideTriangleMesh. This allows bitmaps rendered in preprojecting viewports (such asCustomProjectionView) to adaptively refine projected curvature while preserving bilinear bounds, altitude, and picking UVs.Refined meshes bypass duplicate projection transforms by assigning preprojected coordinates directly to the
positionsattribute. The layer rebuilds geometry when_projectionTolerance,modelMatrix, orcoordinateOriginchange under preprojection, and validates that target projected coordinates have linear units.Reviewed by Cursor Bugbot for commit da20b44. Bugbot is set up for automated code reviews on this repo. Configure here.