Im trying to get a Sprite with a CanvasTexture to be placed in front of the view on a VR environment.
It does work on non-VR iOS, and it is also working on any other platform both VR/non-VR.
Problem is iOS+VR, is it just not shown, and it’s not giving any specific errors or warning messages.
Any clues why this happening?
Thanks in advance.
Notice that browsers on iOS do no really support WebXR. They have to fall back to a WebXR polyfill which is actually included in your app. I guess this bit makes your sprite rendering fail.
Honestly I don’t think its an iOS limitation because I have seen crazy complex webgl apps working with no issues on iOS+VR like the quake3 gl port or the n64 ports.
Another thing that it is a real issue (and maybe this is indeed related) is:
When entering VR, the position of the “xrCamera” is NOT the same than the original
I mean, Its completely placed somewhere else (seems like z += 1 from the original in this case) even defining a local referenceSpace (that is supposed to keep the view in the same place).
This issue can be tested on any browser on the above codesandbox: when entering VR, the new camera is CLOSER to the front objects than when we are non-VR:
Why is this happening and how to prevent it?