Skip to content

feat(mesh-layers): Port ScenegraphLayer to WebGPU#10112

Closed
ibgreen wants to merge 8 commits into
masterfrom
ib/webgpu-scenegraph-layer
Closed

feat(mesh-layers): Port ScenegraphLayer to WebGPU#10112
ibgreen wants to merge 8 commits into
masterfrom
ib/webgpu-scenegraph-layer

Conversation

@ibgreen

@ibgreen ibgreen commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator

For #9504

Summary

Port ScenegraphLayer to WebGPU and expose the website demo through the device tabs while keeping the existing WebGL shader paths and behavior intact.

clipboard

WebGPU verification: ScenegraphLayer renders the bundled 20-plane flight snapshot with the WebGPU tab selected. After load, the console remains free of Scenegraph/WebGPU errors; the expected OpenSky CORS fallback and existing arc source-map warnings remain.

Changes

  • Adds a WGSL ScenegraphLayer shader path, including automatic shader-module bindings, instance-index picking, layer opacity, and WebGPU-only depth parameters.
  • Adds a Scenegraph-specific WebGPU PBR adapter so glTF base-color textures and the PBR module bindings work with deck.gl's project module.
  • Keeps the existing GLSL flat/PBR selection for WebGL; WebGPU-only branches are gated on device.type === 'webgpu'.
  • Exposes device to the image-based-lighting callback and marks the legacy gl callback field deprecated in favor of device.handle.
  • Enables device tabs for the Scenegraph website demo and updates the WebGPU support docs.
  • Makes the flight demo resilient to OpenSky CORS failures: it renders a bundled 20-plane snapshot immediately, then tries the live endpoint updated in update opensky network urls #10465 and falls back cleanly if that request is blocked.

Website examples

Example WebGL2 WebGPU Notes
ScenegraphLayer Renders the bundled flight snapshot; live OpenSky data is best-effort because the API currently blocks cross-origin browser requests.

Validation

  • yarn build
  • yarn lint (passes with existing repository warnings only)
  • Targeted ESLint and Prettier checks for the Scenegraph shader and demo app
  • Manual Chrome verification on the website: WebGPU renders 20 airplanes and remains free of Scenegraph/WebGPU console errors after load. Screenshot: feat(mesh-layers): Port ScenegraphLayer to WebGPU #10112 (comment)

@coveralls

coveralls commented Mar 18, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 83.367% (-0.005%) from 83.372% — ib/webgpu-scenegraph-layer into master

@ibgreen ibgreen changed the title feat(mesh-layers): ScenegraphLayer WebGPU support feat(mesh-layers): Port ScenegraphLayer to WebGPU Mar 18, 2026
@chrisgervang chrisgervang added this to the v9.3 milestone Apr 1, 2026
@chrisgervang chrisgervang modified the milestones: v9.3, v10 Jun 29, 2026
@ibgreen-openai
ibgreen-openai force-pushed the ib/webgpu-scenegraph-layer branch from 810207d to 3d43d0a Compare July 23, 2026 11:48
@ibgreen-openai
ibgreen-openai force-pushed the ib/webgpu-scenegraph-layer branch from 3d43d0a to f299c6a Compare July 23, 2026 11:58
@ibgreen-openai ibgreen-openai mentioned this pull request Jul 23, 2026
26 tasks
@ibgreen-openai
ibgreen-openai force-pushed the ib/webgpu-scenegraph-layer branch from bb84ae8 to 38405f5 Compare July 23, 2026 12:52
@ibgreen-openai
ibgreen-openai marked this pull request as ready for review July 23, 2026 13:16
@ibgreen-openai
ibgreen-openai marked this pull request as draft July 23, 2026 13: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: c2c6121c97

ℹ️ 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".

Comment thread modules/mesh-layers/src/scenegraph-layer/scenegraph-layer.wgsl.ts Outdated
Comment thread modules/mesh-layers/src/scenegraph-layer/scenegraph-layer.wgsl.ts Outdated
@ibgreen
ibgreen marked this pull request as ready for review July 23, 2026 18:51

@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: 23f2a37ab0

ℹ️ 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".


export const scenegraphPbrMaterial = {
...pbrMaterial,
dependencies: [lighting],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the IBL dependency for PBR environments

When _lighting: 'pbr' is used together with _imageBasedLightingEnvironment on WebGPU, the glTF parser sets USE_IBL and supplies the environment sampler bindings, and the wrapped stock PBR WGSL still references pbr_diffuseEnvSampler, pbr_specularEnvSampler, and pbr_brdfLUT under that define. Replacing the module dependencies with only lighting drops the ibl module that declares those bindings, so those scenegraphs fail WGSL validation as soon as IBL is enabled; keep the ibl dependency while omitting only the pbrProjection dependency that this wrapper replaces.

Useful? React with 👍 / 👎.

@ibgreen-openai

Copy link
Copy Markdown
Collaborator

Review follow-up: all reviewer threads are addressed and resolved in 23f2a37. Local build, lint, and the focused ScenegraphLayer test passed; GitHub CI is green. This PR is still draft and still requires review before merge.

Copy link
Copy Markdown
Collaborator

Superseded by the split PRs: #10476 contains only the Scenegraph example local-data/fallback update, and #10477 is the stacked ScenegraphLayer WebGPU port. Closing this combined PR so each change can be reviewed independently.

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.

4 participants