Skip to content

Added WebXR Spacewarp on top of Multiview#26

Open
KooIaIa wants to merge 1 commit intosupermedium:devfrom
KooIaIa:dev
Open

Added WebXR Spacewarp on top of Multiview#26
KooIaIa wants to merge 1 commit intosupermedium:devfrom
KooIaIa:dev

Conversation

@KooIaIa
Copy link

@KooIaIa KooIaIa commented Mar 24, 2026

Add WebXR SpaceWarp backend (requires multiview)

This PR adds a WebXR SpaceWarp render pass on top of the multiview pipeline. It creates a dedicated motion‑vector + depth pass and submits it through the WebXR Spacewarp extension.

Summary of Changes

  • New WebXRSpaceWarp helper that manages the SpaceWarp render pass and target.
  • WebXRManager owns the helper and exposes renderer.xr.spaceWarp.
  • SpaceWarp is gated by renderer.spaceWarp and multiview support.

Re‑adds multiview fixes that were lost in an upstream update:
#25

Usage (very minimal)

Since it's doing a second render pass, it works by rendering meshes added to renderer.xr.spaceWarp.scene.
Three.js reuses the same geometry buffer so these meshes just need custom motion materials.

// Apps add motion‑vector meshes to the SpaceWarp scene.
const motionMesh = new THREE.Mesh(mesh.geometry, motionMaterial);
renderer.xr.spaceWarp.scene.add(motionMesh);
// The motion material must output clip‑space motion vectors per eye

For a full simple implementation with a complete motion shader look here:
https://krabbel.dev/p/social-crabs-enjoy

The A-Frame PR to use this is here:
aframevr/aframe#5795

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.

1 participant