Skip to content

fix(extensions): apply terrain lighting and opacity to drapes - #11205

Merged
ibgreen merged 3 commits into
masterfrom
codex/terrain-drape-parity
Nov 18, 2026
Merged

ibgreen merged 3 commits into
masterfrom
codex/terrain-drape-parity

Conversation

@ibgreen

@ibgreen ibgreen commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #11191.

Background

Drapes on WebGPU skipped terrain lighting and layer opacity. Translucent WebGL drapes mixed straight and premultiplied colors.

Change List

  • Composite terrain covers before mesh lighting and opacity
  • Keep final mesh filters after highlighting
  • Blend translucent covers in premultiplied space
  • Verify opacity, translucency, and picking in browser tests
  • Enable existing textured map and globe render fixtures

Verified: lint, 207 node tests, three browser regressions, and both WebGPU render fixtures.

@ibgreen
ibgreen marked this pull request as ready for review November 18, 2026 20:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 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-18T20:21:10.578846Z 1fc722e Draft marked ready
ℹ️ 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.

@greptile-apps

greptile-apps Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge; no new blocking issues were found.

Summary

Separates terrain cover blending from ordinary mesh color filters, so WebGPU drapes receive lighting and opacity without overriding soft filtering.

  • WebGPU terrain drapes now receive lighting and layer opacity.
  • Translucent WebGL terrain covers now blend with the surface color.

Browser and render tests were not run during this review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Mesh color or texture] --> B[Blend terrain cover]
  B --> C[Apply lighting and opacity]
  C --> D[Apply highlight]
  D --> E[Apply ordinary color filters]
  E --> F[Premultiply output color]
Loading

Reviews (2) · Last reviewed commit: "fix(terrain): separate cover compositing..." · Reviewed by Greptile

@coveralls

coveralls commented Nov 18, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 82.522% (+0.01%) from 82.511% — codex/terrain-drape-parity into master

@ibgreen
ibgreen requested a review from felixpalmer November 18, 2026 20:47
@ibgreen
ibgreen merged commit 57e81e0 into master Nov 18, 2026
9 checks passed
@ibgreen
ibgreen deleted the codex/terrain-drape-parity branch November 18, 2026 21:42
@ibgreen ibgreen mentioned this pull request Nov 19, 2026
42 of 61 tasks

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@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 54667a4 after merge; follow-ups below.

No P1s.

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


Generated by Claude Code

Comment on lines +254 to +256
float alpha = pixel.a + color.a * (1.0 - pixel.a);
vec3 rgb = pixel.rgb + color.rgb * color.a * (1.0 - pixel.a);
color = vec4(alpha > 0.0 ? rgb / alpha : vec3(0.0), alpha);

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.

P2: The GLSL composite changed, but no WebGL test covers translucent terrain. The translucent-cover and opacity tests in terrain-webgpu.spec.ts still run only when backend === 'webgpu'.

Could we drop that guard on both tests so WebGL checks the same values?


Generated by Claude Code

wgsl: {parameters: 'color: ptr<function, vec4<f32>>, geometry: FragmentGeometry'}
},
{
name: 'DECKGL_FILTER_COLOR_BEFORE_LIGHTING',

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.

Non-blocking: This new injection target is WGSL only, and only SimpleMeshLayer calls it. Could we add a TSDoc line saying so, or list it next to fs:DECKGL_FILTER_COLOR in writing-shaders.md?


Generated by Claude Code

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.

Verify terrain draping parity for lighting, opacity, and globe rendering

3 participants