aframe icon indicating copy to clipboard operation
aframe copied to clipboard

WebXR mode broken on Vision Pro with A-Frame 1.6.0

Open JL-Vidinoti opened this issue 1 year ago • 11 comments

Description:

In WebXR mode (VR) using the Vision Pro, the gltf-model do not appear correctly. The ordering of the elements is wrong. It was working fine with version 1.5.0 but the bug appears with the latest 1.6.0 version.

  • A-Frame Version: 1.6.0
  • Platform / Device: Apple Vision Pro
  • Reproducible Code Snippet or URL: https://silver-fog-earl.glitch.me/ (https://glitch.com/edit/#!/silver-fog-earl?path=index.html%3A29%3A37)

In browser mode, it works properly. IMG_0030

The issue appears in VR mode IMG_0031

JL-Vidinoti avatar May 29 '24 09:05 JL-Vidinoti

Sadly not in possession of an AVP to test. @dmarcos can you reproduce the issue?

The strange thing is that even when meshes are sorted incorrectly, the depth buffer should still prevent outcomes like this. For completion sake:

  • Are there any errors/warnings logged in the console?
  • Does the issue also happen without the gltf-model or only with the gltf-model?

Can't immediately think of a change in A-Frame that could cause this. I suspect that it's due to a change in Three.js. If you could git bisect between the v1.5.0 and v1.6.0 tags that would be awesome.

A stab in the dark, but could you try adding renderer="stencil: true" to <a-scene> and see if that changes anything?

mrxz avatar May 29 '24 10:05 mrxz

I have one error appearing in the console but I don't know if it's related.

Screenshot 2024-05-29 at 13 56 46

I only observed the issue with the gltf-model but I did only few tests. However, while trying the code snippet shared earlier, I observed that the objects were disappearing when I was looking up. See recording below.

https://github.com/aframevr/aframe/assets/35372626/d0546a4b-2f5b-4134-a91d-393536eb26a2

I tried renderer="stencil: true" but the same problem occurs.

JL-Vidinoti avatar May 29 '24 12:05 JL-Vidinoti

Can you try a different simpler gltf model? Could be the shaders / materials of that model

dmarcos avatar May 29 '24 15:05 dmarcos

only idea is the soring change from https://github.com/aframevr/aframe/pull/5341

arpu avatar Jun 01 '24 11:06 arpu

From the video it's clear that something is up with the depth buffer. It's as if it isn't being used, but the helmet seems fine, so perhaps it's somehow cleared/invalidated after each draw. The sorting is behaving as you'd expect, the closest objects are drawn first. Looking up most likely causes the sky to end up being drawn last, which makes the rest disappear.

Someone with an AVP really just needs to do a git bisect and we'll know the exact change causing this.

mrxz avatar Jun 03 '24 09:06 mrxz

I found the commit causing the issue: https://github.com/aframevr/aframe/commit/a6ec41728d643b54520ff7518bcd298bc70c1e4c

I also did some more tests and it is not related to the gltf-model. The standard scene looks like that with the Vision Pro: visionpro But it should look like that: desktop

JL-Vidinoti avatar Jun 05 '24 13:06 JL-Vidinoti

@JL-Vidinoti Thanks for digging into this. That commit most likely causes the AVP to be considered mobile by A-Frame. The puzzling part is still how this in turn causes these weird rendering issues (as even on mobile devices things should just work).

One thing that differs is that antialiasing is disabled by default for mobile devices. Could you try if the problem persists when you explicitly enable antialiasing: <a-scene renderer="antialias: true">?

mrxz avatar Jun 05 '24 13:06 mrxz

Good catch! It works by enabling antialiasing.

JL-Vidinoti avatar Jun 07 '24 09:06 JL-Vidinoti

Thanks for investigating. Much appreciated. This means that isTablet isIpad return true on AVP after https://github.com/aframevr/aframe/commit/a6ec41728d643b54520ff7518bcd298bc70c1e4c ?

We gotta correct that so antialising is enabled by default again on AVP

Gott understand why lack of antialising affects the rendering order but probably need to be handled in a separate issue.

dmarcos avatar Jun 07 '24 22:06 dmarcos

If that helps, there is this link that was shared on discord a few days ago to detect if you're on Vision Pro: https://github.com/danrossi/ios-detection-utils/tree/main

vincentfretin avatar Jun 08 '24 11:06 vincentfretin

Also had problems with models on Vision Pro that I didn't encounter before, wondering if it's related to Vision OS 1.2 rather than an AFrame update.

Utopiah avatar Jun 14 '24 15:06 Utopiah

Vision OS 2 has been released. Is this still a problem?

dmarcos avatar Sep 17 '24 23:09 dmarcos

Tried on Vision OS 2 today and everything worked as expected, including the initial Glitch shared to open the issue.

IMHO it can be closed unless there is something else specific.

Utopiah avatar Sep 24 '24 09:09 Utopiah

Thanks for testing @Utopiah Closing and can reopen if necessary

dmarcos avatar Sep 24 '24 20:09 dmarcos