Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebXR mode broken on Vision Pro with A-Frame 1.6.0 #5530

Closed
JL-Vidinoti opened this issue May 29, 2024 · 14 comments
Closed

WebXR mode broken on Vision Pro with A-Frame 1.6.0 #5530

JL-Vidinoti opened this issue May 29, 2024 · 14 comments

Comments

@JL-Vidinoti
Copy link
Contributor

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.

In browser mode, it works properly.
IMG_0030

The issue appears in VR mode
IMG_0031

@mrxz
Copy link
Contributor

mrxz commented May 29, 2024

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?

@JL-Vidinoti
Copy link
Contributor Author

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.

AVP_RPReplay_Final1716983607.mp4

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

@dmarcos
Copy link
Member

dmarcos commented May 29, 2024

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

@arpu
Copy link
Contributor

arpu commented Jun 1, 2024

only idea is the soring change from #5341

@mrxz
Copy link
Contributor

mrxz commented Jun 3, 2024

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.

@JL-Vidinoti
Copy link
Contributor Author

I found the commit causing the issue: a6ec417

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

@mrxz
Copy link
Contributor

mrxz commented Jun 5, 2024

@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">?

@JL-Vidinoti
Copy link
Contributor Author

Good catch! It works by enabling antialiasing.

@dmarcos
Copy link
Member

dmarcos commented Jun 7, 2024

Thanks for investigating. Much appreciated. This means that isTablet isIpad return true on AVP after a6ec417 ?

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.

@vincentfretin
Copy link
Contributor

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

@Utopiah
Copy link
Contributor

Utopiah commented Jun 14, 2024

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.

@dmarcos
Copy link
Member

dmarcos commented Sep 17, 2024

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

@Utopiah
Copy link
Contributor

Utopiah commented Sep 24, 2024

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.

@dmarcos
Copy link
Member

dmarcos commented Sep 24, 2024

Thanks for testing @Utopiah Closing and can reopen if necessary

@dmarcos dmarcos closed this as completed Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants