De-Panther / unity-webxr-export

Develop and export WebXR experiences using Unity WebGL
https://de-panther.github.io/unity-webxr-export/
Apache License 2.0
1.04k stars 110 forks source link

Implement WebXR Layers #365

Open De-Panther opened 7 months ago

De-Panther commented 7 months ago

Is your feature request related to a problem? Please describe. Unity just announced support for Composition Layers. https://forum.unity.com/threads/composition-layers-experimental-package-is-now-available.1551029/ The implementation for their OpenXR package is similar enough to WebXR Layers. It means that we can add WebXR Layers with the same interface for the developers.

Describe the solution you'd like Implement WebXR Layers using the same component and interfaces that the Composition Layers package provides. https://docs.unity3d.com/Packages/com.unity.xr.compositionlayers@0.5/manual/provider-guide.html As its a rendering part, it should be in the WebXR Export package.

Needs a solution for when there's no support for WebXR Layers on a device. Unity has the XR Composition Layers Emulation, which can be built for desktop runtimes. But I guess the solution for WebXR should be to use the WebXR Layers Polyfill. https://github.com/immersive-web/webxr-layers-polyfill

Additional context https://www.w3.org/TR/webxrlayers-1/ https://developer.oculus.com/documentation/web/webxr-layers/ https://immersive-web.github.io/webxr-samples/layers-samples/