Skip to content

feat(extensions): support terrain texture draping on WebGPU - #11169

Merged
ibgreen merged 8 commits into
masterfrom
codex/terrain-texture-draping
Nov 18, 2026
Merged

ibgreen merged 8 commits into
masterfrom
codex/terrain-texture-draping

Conversation

@ibgreen

@ibgreen ibgreen commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Background

Terrain texture draping overlays layers on the terrain surface. This completes the draping path after #10751.

Change List

  • Composite terrain covers through the shared dual-language plugin
  • Preserve encoded object and layer IDs during picking
  • Match cover depth attachments to layer pipelines
  • Restore inferred draping mode for geometry layers
  • Unit tests compare path coverage and exact picking results
  • Documentation describes draping without backend support announcements

Verified: build, lint, 202 node tests, and focused draping rendering/picking.


Note

Medium Risk
Expands WebGPU rendering paths by adding WGSL shader injections, render pass options, and picking support for terrain covers. The changes are largely additive and scoped to WebGPU terrain handling without affecting the existing WebGL implementation.

Overview
Enables terrain texture draping on WebGPU within TerrainExtension, bringing feature parity with WebGL for rendering draped layers and picking objects on terrain surfaces.

The WGSL terrain shader module adds fragment and color injections to sample and composite draped terrain cover textures using premultiplied alpha blending, while supporting object and layer ID encoding during picking passes via isPickingCover. In addition, render target creation in utils.ts now configures a default depth24plus attachment on WebGPU to align with layer pipeline formats.

TerrainExtension and TerrainEffect remove the previous WebGPU restriction that forced terrainDrawMode: 'offset', restoring automatic mode inference so non-extruded geometry layers default to 'drape'.

Reviewed by Cursor Bugbot for commit 66d111d. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T23:19:45.634401Z 53529fa PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ibgreen
ibgreen force-pushed the codex/terrain-texture-draping branch from 53529fa to 49fdf1f Compare November 17, 2026 23:17

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53529faa0a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

Adds terrain texture draping and picking on WebGPU while restoring automatic draw-mode selection.

  • WebGPU terrain layers can drape textures over terrain.
  • Picking a draped surface returns its layer and object.

The latest changes clarify the documentation without changing runtime behavior. The earlier translucent-cover issue is fixed. No new actionable issues were found.

Reviews (5) · Last reviewed commit: "docs: describe terrain draping in unrele..." · Reviewed by Greptile

@coveralls

coveralls commented Nov 17, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 82.598% (-1.1%) from 83.672% — codex/terrain-texture-draping into master

@chrisgervang chrisgervang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 3b81265; comments only at this point. One P1: the whats-new edit sits in the released v9.4 section, and Unreleased does not mention WebGPU draping.

WebGL code paths are unchanged apart from a picking clear-color fallback. The WebGPU drape tests ran and passed in the test-webgpu job.

P2: The terrain-extension-drape and terrain-extension-drape-fill-globe render cases still have skip: ['webgpu'] (test/render/test-cases/terrain-layer.spec.ts:69, :99). They are the only tests of a lit, textured TerrainLayer and of globe draping. Could we unskip them on WebGPU, or note why they stay skipped?

Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.


Generated by Claude Code

Comment thread docs/whats-new.md Resolved
Comment thread docs/developer-guide/webgpu.md Resolved
@ibgreen
ibgreen merged commit 6d2092e into master Nov 18, 2026
9 checks passed
@ibgreen
ibgreen deleted the codex/terrain-texture-draping branch November 18, 2026 16:45
@ibgreen ibgreen mentioned this pull request Nov 19, 2026
42 of 61 tasks
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.

3 participants