immersive-web / layers

A feature repo for working on multi-layer support in WebXR. Feature leads: Rik Cabanier and Artem Bolgar (Oculus)
https://immersive-web.github.io/layers/
Other
90 stars 19 forks source link

A feature that toggle stereo on runtime. #265

Closed ta-koga closed 2 years ago

ta-koga commented 3 years ago

When playing VR stereo video with XRMediaEquirectLayer and displaying UI with XRProjectionLayer, I want to turn off stereo when displaying UI, and close UI and turn back to stereo when finished.

For example, in a VR video, there is a coffee cup on a desk 1m in front of you. If the video is in stereo, you can perceive the coffee cup in 3D as if it were 1 meter in front of you. When overlaying the UI on the video, if the UI is placed in front of the coffee cup (more than 1 meter in front), it will be displayed without any discomfort, but if the UI is placed behind the coffee cup (more than 1 meter behind), it will cause discomfort.

To reduce this discomfort, we need to turn off the stereo when the UI is displayed, and close the UI to turn it on when we are done.

I don't think there is a way to toggle stereo in the current Web XRLayers API, is there?

Thanks.

cabanier commented 3 years ago

No, there is no way. What you can do is create another XRMediaEquirectLayer that is mono and switch between the stereo one and the new one using updateRenderState.

cabanier commented 3 years ago

Let me know if that doesn't work for you (or if you get rendering issues)

ta-koga commented 3 years ago

If the layout is set to mono, XRMediaEquirectLayer render the video split at the top and bottom directly on both eyes. It's Unexpected behavior.

It needs to rendered to both eyes by referring one side of video source (like top-botom's "top"). Because there is no video for mono.

cabanier commented 3 years ago

ok. That is indeed a problem that we could fix in the layers spec. I'll put this on the agenda and we can discuss it in the next WebXR meeting.

/agenda Can we put stereo media layers into mono?

AdaRoseCannon commented 3 years ago

Because this couldn't be discused on Tuesday I am marking it to be discussed at TPAC

/tpac Can we put stereo media layers into mono?

cabanier commented 2 years ago

Was this ever resolved?

/tpac Can we put stereo media layers into mono?

cabanier commented 2 years ago

Discussed at TPAC and agree upon. We will add a new bool attribute forceMonoPresentation to swap to mono.

ta-koga commented 2 years ago

Thank you for bringing this up to TPAC.

cabanier commented 2 years ago

Closing this issue. It's now in the spec and the Quest browser will have it in the next version.