layers icon indicating copy to clipboard operation
layers copied to clipboard

A feature that toggle stereo on runtime.

Open ta-koga opened this issue 2 years ago • 5 comments

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.

ta-koga avatar Oct 01 '21 07:10 ta-koga

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 avatar Oct 01 '21 14:10 cabanier

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

cabanier avatar Oct 01 '21 14:10 cabanier

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.

ta-koga avatar Oct 04 '21 07:10 ta-koga

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?

cabanier avatar Oct 04 '21 15:10 cabanier

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?

AdaRoseCannon avatar Oct 07 '21 13:10 AdaRoseCannon

Was this ever resolved?

/tpac Can we put stereo media layers into mono?

cabanier avatar Sep 05 '22 23:09 cabanier

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

cabanier avatar Sep 15 '22 18:09 cabanier

Thank you for bringing this up to TPAC.

ta-koga avatar Sep 20 '22 07:09 ta-koga

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

cabanier avatar Sep 21 '22 16:09 cabanier