Skip to content

refactor(xr): route XR framebuffer through XrBridge; refresh VR LOD example#8713

Merged
mvaligursky merged 2 commits into
mainfrom
mv-xr-bridge-vr-lod-example
May 11, 2026
Merged

refactor(xr): route XR framebuffer through XrBridge; refresh VR LOD example#8713
mvaligursky merged 2 commits into
mainfrom
mv-xr-bridge-vr-lod-example

Conversation

@mvaligursky
Copy link
Copy Markdown
Contributor

@mvaligursky mvaligursky commented May 11, 2026

WebGL XR presentation now binds the session framebuffer inside the graphics XR bridge each frame, instead of in AppBase. The Gaussian splatting VR LOD example is aligned with shared ESM XR helpers and uses the examples control panel for session entry and exit.

Changes:

  • Add XrBridge.beginFrame / endFrame and wire WebGL to set defaultFramebuffer from the XR base layer; WebGPU stubs are no-ops.
  • Call xrBridge.beginFrame at the end of XrManager.update; call endFrame from XrBridge.destroy before tearing down the implementation.
  • Remove per-tick defaultFramebuffer assignment from AppBase.
  • VR LOD example: use xr-session.mjs and xr-navigation.mjs; XR panel titled XR with Enter VR / Exit VR (observer xrActive); remove click-to-enter on the canvas; touch still exits when already in VR.

Examples:

  • Updated examples/src/examples/gaussian-splatting-xr/vr-lod.example.mjs and vr-lod.controls.mjs.

related to #7404

…xample

Move WebGL XR default framebuffer binding out of AppBase into XrBridge
beginFrame/endFrame, invoked from XrManager and cleared on bridge destroy.
Update the Gaussian splatting VR LOD example to use shared XR scripts and
an XR control panel for Enter/Exit VR.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors WebXR framebuffer binding so that per-frame backend render target setup is handled by XrBridge (instead of AppBase), and updates the Gaussian splatting VR LOD example to use shared ESM XR helpers and the examples control panel for entering/exiting VR.

Changes:

  • Add XrBridge.beginFrame() / endFrame() and call beginFrame() from XrManager.update() each XR frame; reset state via endFrame() during bridge destruction.
  • Remove per-tick graphicsDevice.defaultFramebuffer assignment from AppBase.tick().
  • Update the VR LOD example to use xr-session.mjs / xr-navigation.mjs and add an “XR” panel with Enter/Exit VR.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/platform/graphics/xr-bridge.js Adds beginFrame/endFrame to the bridge API and ensures endFrame() is invoked during destruction.
src/platform/graphics/webgpu/webgpu-xr-bridge.js Adds no-op beginFrame/endFrame stubs for WebGPU.
src/platform/graphics/webgl/webgl-xr-bridge.js Implements per-frame default framebuffer routing to the XR base layer and resets back to canvas.
src/framework/xr/xr-manager.js Calls xrBridge.beginFrame(frame) once per XR frame after XR update processing.
src/framework/app-base.js Removes per-tick XR framebuffer binding / reset from the main loop.
examples/src/examples/gaussian-splatting-xr/vr-lod.example.mjs Switches VR entry/exit to shared XR session/navigation scripts and observer-driven UI events.
examples/src/examples/gaussian-splatting-xr/vr-lod.controls.mjs Adds an “XR” panel with a VR enter/exit toggle button driven by xrActive.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/platform/graphics/webgl/webgl-xr-bridge.js Outdated
@mvaligursky mvaligursky merged commit 1c4e47a into main May 11, 2026
8 checks passed
@mvaligursky mvaligursky deleted the mv-xr-bridge-vr-lod-example branch May 11, 2026 11:11
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.

2 participants