Yes, please a working playground example in the BJS doc about WebXR polyfill.
That would do it indeed.
If I add the polyfill append to my playground,
I get Loading assets… Please wait. forever. And the cube/scene ist not movable.
But not always. That’s just because the server is week.
If I add your
A read square says: createEngine function must return an engine.
I searched the playgrounds for polyfill but none of them seemed to work and show the VR symbol.
Except the Delorian scene ( without WebXRPolyfill! ) https://www.babylonjs-playground.com/#JA1ND3#219
But it is using VR and XR! And I assume, it runs because of the createDefaultVRExperience.
I could delete createDefaultXRExperienceAsync without any change in behavior.
As i constantly write - we don’t officially support the WebXR polyfill, as i can’t control exactly what’s being done in the polyfill. As I know there were users who got the polyfill to work and it was working well, but i can’t help more than showing an example of how it can work. The working example I suggested was this kind of playground - showing how the polyfill can work.
The playground you pasted is a very interesting hybrid of everything-in-one-scene, and I do hope you didn’t find it in the official docs. I would be very happy to get rid of those kind of playgrounds, and they are working with an older version of the XR API.
I got the hint do use polyfill from this BJS forum
Acutally it looks like I don’t need it (because Cardboard only fits with WebVR)
To avoid stubid questions like mine, you should add in the docs, were polyfill is mentioned:
“not supported by BJS”
and a/your good playground example
The collection of playgrojunds and searching is - - - good for another long post tread
Not directly: BJS supports a fallback for Cardboard. The WebXR did not work but the WebVR did.
So I coded an createDefaultImmersiveExperienceAsync:
if WebXR: Oculus Quest etc. - be happy
else if WebVR: Apple Mac etc. - use WebXRPolyfill
else: No WebVR or XR: Cardboard, iPhone etc. - use createDefaultVRExperience fallback
In the last case, I wrote some simple polyfill from that WebVR fallback to WebXR
to always use a WebXR API in the application.