@plasius/gpu-xr
v0.1.4
Published
Framework-agnostic WebXR session management for Plasius GPU rendering projects.
Maintainers
Readme
@plasius/gpu-xr
Framework-agnostic WebXR session management for Plasius GPU rendering projects. This package isolates VR session lifecycle and capability probing so app layers can replace Three.js and still keep immersive workflows.
Apache-2.0. ESM + CJS builds.
Install
npm install @plasius/gpu-xrUsage
import { createXrManager } from "@plasius/gpu-xr";
const xr = createXrManager();
await xr.probeSupport(["immersive-vr"]);
const session = await xr.enterVr({
optionalFeatures: ["depth-sensing", "layers"],
});
// ... bind WebGPU render state to the session ...
await xr.exitSession();API
isXrModeSupported(mode, options)requestXrSession(options)createXrStore(initialState)createXrManager(options)mergeXrSessionInit(base, override)defaultVrSessionInit
Demo
Run the demo server from the repo root:
cd gpu-xr
npm run demoThen open http://localhost:8000/gpu-xr/demo/.
Development Checks
npm run lint
npm run typecheck
npm run test:coverage
npm run build
npm run pack:checkFiles
src/index.js: XR runtime/session manager and store.tests/package.test.js: Unit tests for support probing and lifecycle handling.docs/adrs/*: XR architecture decisions.
