Skip to content

[geo-layers] Split TerrainLayer mesh and texture max zooms#10296

Draft
charlieforward9 wants to merge 1 commit into
visgl:codex/terrain-globe-mercator-remapfrom
NEW-HEAT:codex/terrain-texture-max-zoom
Draft

[geo-layers] Split TerrainLayer mesh and texture max zooms#10296
charlieforward9 wants to merge 1 commit into
visgl:codex/terrain-globe-mercator-remapfrom
NEW-HEAT:codex/terrain-texture-max-zoom

Conversation

@charlieforward9
Copy link
Copy Markdown
Collaborator

@charlieforward9 charlieforward9 commented May 12, 2026

Summary

Adds separate TerrainLayer controls for terrain mesh zoom and imagery texture zoom.

meshMaxZoom controls the TileLayer mesh zoom. textureMaxZoom controls the imagery zoom, and if unset it falls back to the existing maxZoom prop. There is no separate texture zoom delta prop.

Validation

  • npx vitest run --project headless test/modules/geo-layers/terrain-layer.spec.ts

Stacked on #10293.

@charlieforward9 charlieforward9 force-pushed the codex/terrain-texture-max-zoom branch from 6bbad25 to 421e312 Compare May 12, 2026 20:29
@charlieforward9 charlieforward9 force-pushed the codex/terrain-globe-mercator-remap branch 2 times, most recently from 7a58fd4 to 6bf36a5 Compare May 12, 2026 21:08
@charlieforward9 charlieforward9 force-pushed the codex/terrain-texture-max-zoom branch 3 times, most recently from 02951ca to 8da6806 Compare May 12, 2026 21:36
@coveralls
Copy link
Copy Markdown

coveralls commented May 12, 2026

Coverage Status

Coverage is 83.593%NEW-HEAT:codex/terrain-texture-max-zoom into visgl:codex/terrain-globe-mercator-remap. No base build found for visgl:codex/terrain-globe-mercator-remap.

@charlieforward9 charlieforward9 force-pushed the codex/terrain-texture-max-zoom branch from 8da6806 to c67fba9 Compare May 12, 2026 21:40
@charlieforward9 charlieforward9 linked an issue May 13, 2026 that may be closed by this pull request
5 tasks
@charlieforward9 charlieforward9 marked this pull request as ready for review May 13, 2026 04:18
Copy link
Copy Markdown
Collaborator

@felixpalmer felixpalmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you justify why this change is needed? It seems a lot of extra complexity and I'm not sure what issue it is solving

@charlieforward9
Copy link
Copy Markdown
Collaborator Author

charlieforward9 commented May 15, 2026

cc @felixpalmer, quick field note from trying this in NEW HEAT.

What we need is TerrainLayer using the highest available elevation mesh zoom, while still resolving imagery textures to the imagery provider ceiling. In our current setup that is roughly z15 for elevation and often z21-z23 for satellite imagery.

What we tried was meshMaxZoom: 15 with textureMaxZoom: 21/23. That works conceptually, but direct stitching becomes pathological when the texture zoom is much higher than the mesh zoom: z15 -> z23 requires 65,536 texture child tiles for a single terrain mesh tile. Pitching/dragging then creates huge request bursts and can freeze the app.

Adding a stitch cap makes the layer safe again, but it means the texture never reaches the top imagery resolution. Moving imagery into a separate draped raster layer avoids the request explosion, but then quality depends on the terrain-cover render target and looks under-resolved during interaction.

So the ask is: is there a TerrainLayer-native path where mesh and texture zoom can diverge substantially, without stitching every high-zoom child into one mesh texture and without losing interactive texture fidelity?

@charlieforward9 charlieforward9 marked this pull request as draft May 15, 2026 01:35
@felixpalmer
Copy link
Copy Markdown
Collaborator

Could you use a standard TileLayer with the TerrainExtension providing the 3D?

@charlieforward9
Copy link
Copy Markdown
Collaborator Author

charlieforward9 commented May 16, 2026

TileLayer with the TerrainExtension

Screenshot 2026-05-06 at 6 45 08 PM

the draped imagery goes through the TerrainCover render target, and during interaction it looks visibly pixelated / under-resolved compared with directly sampled z21-z23 imagery

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TerrainLayer texture higher maxZoom

3 participants