Skip to content

fix(TerrainExtension): Handle pick events in TerrainExtension & draped layers#10037

Merged
felixpalmer merged 42 commits intomasterfrom
felix/rotate-pivot-3d-terrain
Mar 4, 2026
Merged

fix(TerrainExtension): Handle pick events in TerrainExtension & draped layers#10037
felixpalmer merged 42 commits intomasterfrom
felix/rotate-pivot-3d-terrain

Conversation

@felixpalmer
Copy link
Collaborator

Followup to #9938 add support for TerrainExtension

Background

Getting 3D picking working with the TerrainExtension is a bit more involved as the shader flows are more complex. We need to handle:

  • Hovering over draped layer, but obtain 3D position of terrain below
  • Hovering over tile containing draped layer, but outside the draped layer
  • Hovering over tile that doesn't contain draped layer
Screen.Recording.2026-02-25.at.16.39.48.mov

Change List

  • Add _getDepthLayers to DeckPicker to explictly filter out correct layers when obtaining height
  • Enhance terrain shader-module to allow depth picking of terrain position
  • Fix blend modes so layer indices do not get lost when rendering via framebuffers

Copy link
Collaborator

@chrisgervang chrisgervang left a comment

Choose a reason for hiding this comment

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

Are there any caveats or downsides, or only net improvements from what you can tell?

The demo looks nice!

deviceRect: viewport,
pickZ: false
pickZ: false,
clearColor: [0, 0, 0, terrainAlpha]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Most of these changes are in the picking pass and I'm assuming won't change draw pass renders. Is this change perceptible to the user?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, except that picking works where it previously didn't

@felixpalmer
Copy link
Collaborator Author

any caveats or downsides

From my testing none, just an improvement

@coveralls
Copy link

Coverage Status

coverage: 91.006% (-0.02%) from 91.026%
when pulling 0fb6205 on felix/rotate-pivot-3d-terrain
into 64af196 on master.

@felixpalmer felixpalmer merged commit 1ecaec5 into master Mar 4, 2026
5 checks passed
@felixpalmer felixpalmer deleted the felix/rotate-pivot-3d-terrain branch March 4, 2026 13:49
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