aframevr / aframe

:a: Web framework for building virtual reality experiences.
https://aframe.io/
MIT License
16.61k stars 3.94k forks source link

Spectator mode broken #4905

Open wyzwon opened 3 years ago

wyzwon commented 3 years ago

Camera entities with spectator="true" applied do not appear to enter spectator mode when the VR headset is in use. The scene either disappears entirely or freezes on the last frame before entering VR (wasd keys are unresponsive and changes made to the scene by the player are not reflected in the monitor view)

dmarcos commented 3 years ago

What Browser?

wyzwon commented 3 years ago

What Browser?

Whoops! I have updated the list, but I was running Chrome for my testing.

dmarcos commented 3 years ago

Unfortunatetly, Chrome / WebXR doesn't allow rendering simultaneously on 2D / 3D. It should work on Firefox that still ships the old WebVR API

wyzwon commented 3 years ago

This seems like an odd decision for the standard. This will seriously limit the ability for streamers to showcase browser based VR projects.

That said, I have now tested the same scene in Firefox (experimental WebXR support disabled) and see only a blank white screen when VR is in use.

dmarcos commented 3 years ago

It was removed for performance reasons. FYI, Steam VR has a mirror mode where you can see what it's displayed in headset on desktop

wyzwon commented 3 years ago

To be honest, I was certain that only displayed the binocular headset views, but I just checked and that's not the case so I guess that solves that concern for steamVR devices (I assume other headsets have something equivalent).

To bring it back around to the main topic though, it does appear to be technically broken on my machine. That said, what is the plan going forward? If simultaneous 2D/3D rendering is out at the WebXR level, that's pretty much it for the feature right? At the very least it seems to me that the docs should be updated to state that this is a WebVR exclusive feature, and I still think rather than freezing on the last 2D frame, the screen should be painted over with a "Scene is in XR mode, please put on headset" message as part of the process to enter XR mode.

What actually is the plan for WebVR support in Aframe moving forward? Even Firefox now apparently has an experimental build for WebXR in the works so will there even be a need to keep it in future versions of AFrame? If not, references to spectator mode can be removed all together in future versions of the docs. It also means there would seem to be little reason to fix it and this issue could be considered closed.

wyzwon commented 3 years ago

@dmarcos

It was removed for performance reasons.

Are you saying it was removed from THREE or AFrame itself? Because it appears to be supported in WebXR. I just ran this demo and I was able to watch the scene via a spectator view in Chrome.

dmarcos commented 2 years ago

@wyzwon What's your use case? SteamVR can mirror content in the headset as well as the Oculus Runtime. That should cover most desktop headsets without paying the performance penalty of rendering a scene twice in browser.

Firefox has no plans to officially ship WebXR anytime soon to my knowledge since the team was laid off at Mozilla. A-Frame will keep supporting WebVR until further notice.

wyzwon commented 2 years ago

@dmarcos My main concern had been that there is a good way to stream games, but from what you have told me that seems pretty assured. It would also be nice for onlookers outside of VR to be able to wander freely around and spectate but that could be handled through a second client tab and a home brewed spectator player mode. The goal of my previous comment was mostly for clarification since I had the impression before hand that "removed for performance reasons" meant removed at the WebXR level up until I tried the demo and discovered there was still support for it.

I guess now my only concern is that the docs get some kind of explicit note that spectator mode will not be supported in WebXR so new developers don't confuse it for a feature they can use and waste time trying to implement it/debug it when it doesn't work in their WebXR projects.

There is also the matter that the feature was not working even when I tried to explicitly use WebVR in Firefox, but if I am being honest, I am just not all that concerned if no one bothers to fix it if it really is WebVR only.

Also for the record, there is indeed some WebXR support in Firefox albeit hidden behind a flag. I don't know what part of the team is implementing it since they laid off their dedicated team.